Arduino Class 01
Arduino Class 01
We only use bread board to for testing purpose. The final circuit is built on a board
named Veroboard and it is soldered using soldering iron.
Fig 1.2: A Veroboard Fig 1.3: A Soldering Iron
2. If you face any problem look for the tutorial video already
uploaded to google classroom.
1. Connect the cable to Arduino UNO and to your PC. You should
hear a sound from the PC when you plug in the cable. If you
don’t hear any sound try plugging again.
2. Open your device manager. You should see Arduino UNO or
something like this under ports (COM & LPT). (Arduino must
be connected through cable to PC).
If things are all right, you are ready to go. If you are facing any
problem don’t hesitate to ask in our messenger group.
Chapter 3
Our First Arduino Program
1. Connect the Arduino UNO to the PC using the Cable
2. Open the Arduino IDE software.
3. You should see a empty code like this below
(If you faced any problem, it is totally fine. Just try again from 1-7.
If the problem is still there, ask in our messenger group.)
Let’s understand the code later. Just write the below code now and
upload it to Arduino UNO using that same upload button.
(100 instead of 1000)
(Lines starting with // (double slash) are comments and they do nothing
in the code. Just help you to understand. It is a really good habit to write
comments with code for many reasons. You will understand the reasons
on your own with time)
I know everything looks complex. But take don’t think too much. Let’s
play a game.
Now continue reducing the value inside delay. 40, 30, 25, 20, 15, 14, 13,
12, 11, 10. What do you see now?
You know longer see the LED blinking. Instead, what you see is the
LED is permanently ON though the LED is turning ON and OFF very
quickly. This phenomenon is called persistence of vision. The ON and
OFF is so fast that your brain does not process the OFF state any more.
Chapter 4
Adding extra things with Arduino
(The LED has two legs. The shorter leg goes to the GND pin And the
longer leg goes to the 13 pin)
Instead, build the below circuit. Using jumper wire and bread board.
Much better.
(That resistor is a 220 ohm resistor. You know how to find it by seeing
the color.) The job of this resistor is to protect the LED from HIGH
current.
Our pin 13 can take some rest now. Let the pin 8 do some work for you.
Let’s use two LED with Arduino. Built the circuit below and upload the
code. (Note: you cannot plug in two jumper wire into a same port in
Arduino UNO. So how can we build this circuit below)
Hope things have started to make sense a little. Even if things do not
make sense don’t get frustrated. Starting is always the hardest part.
Upload the below code keeping the circuit same. (Two LED: one at pin
7 and one at pin 8)
What do you see? Try to understand how does the code controls the real
world.
Chapter 5
The seven segment display
In previous part, you have learned how to control an LED using Arduino
Code. The Seven Segment Display is just a combination of 8 LEDs. (7
LEDs for the digit and 1 LED for the dot).
We can write different digits by just turning these LED ON and OFF.
Now, we will see how to write 7 on Seven Segment Display (SSD).
See that each LED has a name. And each pin is connected to a pin with
the same name. To print 7 on this display we have to turn on a, b and c
LED.
Build the circuit below and upload the code:
The output should be like this: (turns ON and OFF)
Assignments
1. Try all the codes demonstrated in this whole PDF.
2. Find someone better than Arduino UNO. Describe why this
microcontroller is better. (Anything available in BD online
market. Just google it to see if it is available or not).
3. Find the limit in milliseconds for your perception of vision.
4. Write 0 on seven segment display.
5. Write 1 on SSD.
6. Write 2 on SSD.
7. Write 3 on SSD.
8. Write A on SSD. (Yes, you heard that right. Write A.)
9. Write C on SSD.
10. Write H on SSD.
11. Hard one: Display 0 then 1 then 2 then repeat 0, 1,2….
Details: show 0 then turn off all LED of SSD, then show 1 then
turn of all the LED, then 2 then turn off all LED…thus
12. Display 4, 5, 6 then repeat on SSD.
13. Hardest one: Display your name on Seven Segment Display:
Such as: A then B then C then D if your name is ABCD. (May
not be possible for all characters of your name but give it a try.)
14. Stay happy. Don’t let the toughness of assignments ruin your
happiness. And most importantly, have fun.
(Note: Submit your assignments PDF, Video, Image, Text in google
classroom: Any format that you like.)