Digital Design through. Arduino

Similar documents
Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Procedure: Determine the polarity of the LED. Use the following image to help:

Project 17 Shift Register 8-Bit Binary Counter

Introduction To Arduino

Description: 4x 7 segment display module with decimals and colon

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 15. Shift Register 8-Bit Binary Counter

Arduino - DigitalReadSerial

Laboratory 1 Introduction to the Arduino boards

Device: DSP-7S04H. This document Version: 1. Date: 23 March Description: 2.3 4x 7 segment display module with decimals

Digital Pins and Constants

Finite State Machine Lab

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

Arduino Lesson 15. DC Motor Reversing

cs281: Introduction to Computer Systems Lab03 K-Map Simplification for an LED-based Circuit Decimal Input LED Result LED3 LED2 LED1 LED3 LED2 1, 2

BASIC Arduino. Part I

Principles of Digital Techniques PDT (17320) Assignment No State advantages of digital system over analog system.

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5

Counter & LED (LED Blink)

Microcontrollers and Interfacing week 8 exercises

Schedule. Sanford Bernhardt, Sangster, Kumfer, Michalaka. 3:10-5:00 Workshop: Build a speedometer 5:15-7:30 Dinner and Symposium: Group 2

How to Use an Arduino

Workshop on Microcontroller Based Project Development

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Philadelphia University Student Name: Student Number:

IA Digital Electronics - Supervision I

IME-100 Interdisciplinary Design and Manufacturing

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Robotics and Electronics Unit 5

Experiment 9: Binary Arithmetic Circuits. In-Lab Procedure and Report (30 points)

Halloween Pumpkinusing. Wednesday, October 17, 12

More Arduino Programming

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

Arduino Part 2. Introductory Medical Device Prototyping

Experiment 3: Logic Simplification

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

Embedded Workshop 10/28/15 Rusty Cain

Module -10. Encoder. Table of Contents

(Refer Slide Time: 00:01:53)

Digispark DIY: the Smallest USB Arduino

keyestudio Keyestudio MEGA 2560 R3 Board

3. The circuit is composed of 1 set of Relay circuit.

ARDUINO LEONARDO WITH HEADERS Code: A000057

Question Total Possible Test Score Total 100

PART 1. Simplification Using Boolean Algebra

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

PDF of this portion of workshop notes:

EXPERIMENT 7 Please visit to learn all features of arduino before you start the experiments

Laboratory 10. Programming a PIC Microcontroller - Part II

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

Imperativ Programming. morning (again) Jens Dalsgaard Nielsen Aalborg University (1/24)

Microcontrollers and Interfacing

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

Lesson 8: Digital Input, If Else

Project 18 Dual 8-Bit Binary Counters

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Blinking an LED 1 PARTS: Circuit 2 LED. Wire. 330Ω Resistor

Lab 2 - Powering the Fubarino, Intro to Serial, Functions and Variables

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

Arduino 05: Digital I/O. Jeffrey A. Meunier University of Connecticut

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

Score. Test. Issued. Date. Name:

Contents. List of Figures. TermDriver Datasheet 1. 1 Overview 2. 2 Features 2. 3 Installation with Arduino 3

GEORGIA INSTITUTE OF TECHNOLOGY School of Electrical and Computer Engineering ECE 2020 Fall 2017 Lab #1: Digital Logic Module

Chapter 1: Basics of Microprocessor [08 M]

Elektor Uno R4 Installation & Test

Product Manual. Relay Plug

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)


TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

ARDUINO YÚN MINI Code: A000108

Device: FDRV-04S. This document version: v1. Matches module version: v2 [2 Oct 2015] Document revision date: 9 November 2015

EECS 140 Laboratory Exercise 4 3-to-11 Counter Implementation

4X4 Driver Shield Manual

Arduino provides a standard form factor that breaks the functions of the micro-controller into a more accessible package.

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

CMSC838. Tangible Interactive Assistant Professor Computer Science

PROGRAMMABLE LOGIC DEVICES

Dual Digital Pot (100K) SKU: DFR0520

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2

Code No: R Set No. 1

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Lab 2.2 Ohm s Law and Introduction to Arduinos

ARDUINO LEONARDO ETH Code: A000022

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

Arduino Prof. Dr. Magdy M. Abdelhameed

Building your own special-purpose embedded system gadget.

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

Introduction to Arduino

Create moving images in forward and reverse with your Arduino when you connect a motor to an H-bridge and some still images BATTERY POTENTIOMETER

Transcription:

Digital Design through 1 Arduino G V V Sharma Contents 1 Display Control through Hardware 2 1.1 Powering the Display.................................. 2 1.2 Controlling the Display................................. 3 2 Display Control through Arduino Software 5 2.1 Driving the Segments.................................. 5 3 Combinational Logic 6 3.1 Counting Decoder.................................... 6 3.2 Display Decoder..................................... 7 4 Decade Counter through Arduino 8 4.1 Decade Counter through Flip Flops.......................... 8 5 Karnaugh Maps 10 *The author is with the Department of Electrical Engineering, Indian Institute of Technology, Hyderabad 502285 India e-mail: gadepall@iith.ac.in.

2 1 Display Control through Hardware 1.1 Powering the Display The breadboard can be divided into 5 segments. In each of the green segements, the pins are internally connected so as to have the same voltage. Similarly, in the central segments, the pins in each column are internally connected in the same fashion as the blue columns. Problem 1.1. Plug the display to the breadboard. The seven segment display has eight pins, a, b, c, d, e, f, g and dot that take an active LOW input, i.e. the LED will glow only if the input is connected to ground. Each of these pins is connected to an LED segment. The dot pin is reserved for the LED. Problem 1.2. Connect one end of the 1K resistor to the COM pin of the display and the other end to an extreme pin of the breadboard.

3 The Arduino Uno has some ground pins, analog input pins A0-A3 and digital pins D1-D13 that can be used for both input as well as output. It also has two power pins that can generate 3.3V and 5V. In the following exercises, only the GND, 5V and digital pins will be used. Problem 1.3. Connect the 5V pin of the arduino to an extreme pin that is in the same segment as the 1K resistor pin. Problem 1.4. Connect the GND pin of the arduino to the opposite extreme pin of the breadboard Problem 1.5. Connect the Arduino to the computer. Problem 1.6. Connect the dot pin of the display to a pin in the same segment as the GND pin. What do you observe? 1.2 Controlling the Display Problem 1.7. Generate the number 1 on the display by connecting the pins a g to GND according to the following table. a b c d e f g decimal 1 0 0 1 1 1 1 1 Problem 1.8. Complete the above table for all numbers between 0-9. Problem 1.9. Now generate the numbers from 1-9 on the display using the above table. The 7447 IC helps in displaying decimal numbers on the seven segment display. The ā f, pins of the 7447 IC are connected to the a f pins of the display. V c c should be connected to a 5V power source. The input pins of the decoder are A,B,C and D, with A being the lowest significant bit (LSB) and D being the most significant bit (MSB). For example, the number 5 is visible on the display when the A,B,C and D inputs are the following.

4 D C B A Decimal 0 1 0 1 5 Problem 1.10. Connect the 7447 IC decoder ā ḡ pins to the a g pins of the display respectively. Problem 1.11. Connect the V cc and GND pins of the decoder to the 5V supply and GND pins of the breadboard. Problem 1.12. Connect the A,B,C,D pins to pins in the GND extreme segment of the breadboard. What do you observe. Problem 1.13. Now remove the D pin from the breadboard and observe the display output. Problem 1.14. Generate a table with A,B,C,D inputs and the equivalent decimal number output.

5 2 Display Control through Arduino Software 2.1 Driving the Segments Open the arduino software. Check if the ports show Arduino Uno and click the appropriate button. Open Examples Basics Blink. Problem 2.1. Connect the A-D pins of the 7447 IC to the pins D2-D5 of the Arduino. Problem 2.2. Modify the blink program to get the following code and execute. What do you observe? // the setup function runs once when you press reset or power the board void setup() { pinmode(2, OUTPUT); pinmode(3, OUTPUT); pinmode(4, OUTPUT); pinmode(5, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalwrite(2, HIGH); digitalwrite(3, LOW); digitalwrite(4, HIGH); digitalwrite(5, LOW); }

6 Problem 2.3. Now generate the numbers 1-9 by modifying the above program. Problem 2.4. Before the following line in the previous code, void setup() { you can define integer variables as int A = 0; where the variable A is defined to be an integer and given the values 0. Define variables A,B,C,D as 0 or 1 and use the digitalwrite() command as in the earlier code to generate the numbers 1-9.

7 3 Combinational Logic 3.1 Counting Decoder Following is a truth table, where W, X, Y, Z are the inputs and A, B, C, D are the outputs. This table represents the system that increments the numbers 0-8 by 1 and resets the number 9 to 0. Z Y X W D C B A 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 0 Note that D=1 for the inputs 0111 and 1000. Using boolean logic, D=WXYZ + W X Y Z (3.1) Note that 0111 results in the expression WXYZ and 1000 yields W X Y Z. Problem 3.1. Write the boolean logic functions for A, B, C in terms of W, X, Y, Z. The && operand is used for the boolean AND (multiplication) operation, the operand is used for the OR (addition) operation and the! operand is used for the NOT ( ) operation in Arduino code. For example, the expression for (3.1) in Arudino is

8 D = (W&&X&&Y&&!Z) (!W&&!X&&!Y&&Z); Problem 3.2. Write the Arduino code for the outputs A, B, C and verify if your logic is correct by observing the output on the seven segment display. 3.2 Display Decoder Problem 3.3. Now write the truth table for the seven segment display decoder (IC 7447). The inputs will be A, B, C, D and the outputs will be a, b, c, d, e, f, g. Problem 3.4. Obtain the logic functions for outputs a, b, c, d, e, f, g in terms of the inputs A, B, C, D. Problem 3.5. Disconnect the arduino from IC 7447 and connect the pins D2-D8 in the Arduino directly to the seven segment display. Problem 3.6. Write a new program to implement the logic in Problem 3.4 and observe the output in the display. You have designed the logic for IC 7447! Problem 3.7. Now include your counting decoder program in the display decoder program and see if the display shows the consecutive number. A decade counter counts the numbers from 0-9 and then resets to 0. Problem 3.8. Suitable modify the above program to obtain a decade counter.

9 4.1 Decade Counter through Flip Flops 4 Decade Counter through Arduino Open the blink program. You will see the following // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinmode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalwrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalwrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } Problem 4.1. Connect the digital pin 13 of the arduino to the dot pin of the display. Execute the Blink program. Problem 4.2. Change the delay to 500 ms in the program and execute. What do you observe? The 7474 IC has two D flip flops. The D pins denote the input and the Q pins denote the output. CLK denotes the clock input.

10 Problem 4.3. Connect the D2-D5 pins of the arduino to the Q pins of the two 7474 ICs. Use the D2-D5 pins as Arduino input. Problem 4.4. Connect the Q pins to IC 7447 Decoder as input pins. Connect the 7447 IC to the seven segment display. Problem 4.5. Connect the D6-D9 pins of the arduino to the D input pins of two 7474 ICs. Use the D6-D9 pins as Arduino output. Problem 4.6. Connect pin 13 of the Arduino to the CLK inputs of both the 7474 ICs. Problem 4.7. Using the logic for the counting decoder in the Ardunio software, implement the decade counter.

11 Consider the truth table for the segment a 5 Karnaugh Maps D C B A a 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 The boolean logic function for segment a can be simplified using a Karnaugh map (K-map) and results in the function a=a+ C+ B D+ BD (5.1)

12 Problem 5.1. Use K-map generated expressions for segments b f in the program to drive the display. Problem 5.2. Repeat the above exercise for the counting decoder as well.