Presentation is loading. Please wait.

Presentation is loading. Please wait.

Breadboards and LED’s with Arduino

Similar presentations


Presentation on theme: "Breadboards and LED’s with Arduino"— Presentation transcript:

1 Breadboards and LED’s with Arduino
A Microcontroller

2 Notes This material has been put together by the Outreach coordinator of the School of Engineering and Computer Studies (SECS) at Victoria University of Wellington (VUW), New Zealand. It is free to distribute and pass on to all who may find it useful. The author of this presentation and supporting documents can be reached at:

3 Prior knowledge (Year 10 science)
Voltage, Current, Resistance and Ohm’s law ohms-law What is a circuit Working with wire Reading schematics

4 Learning Objectives Students learn about, how and why to use a breadboard Students can identify patterns about connector colours Students can configure and use a POT Students can configure a basic RGB LED

5 Breadboards Orientation doesn’t matter, what matters is the connections across the slots: Power rail Ground rail

6 Inside a breadboard The wholes/slots are also called tie points

7 Why is it called a breadboard?
Wire wrap 1960’s

8 Why use one? No soldering required Reusable Prototyping
Extending connectors for GND and Power

9 Exercise 3 – Fade… Run the Fade script: <File>,<Example>,<01. Basics>,<Fade> Normally we would use the blink script as a test, but this is just to explore a slightly different effect and using a breadboard This script uses a basic PWM (thus pin 9 marked with the ~) Note on the code: 255 – modified by a fade amount (5) with a small delay (30ms)

10 Journal entry Date it!!! Aim, Equipment, method, experiment, conclusion For the method: fritzing diagram Also for method: a copy of the code (annotate this) Experiment: what you are exploring/changing (note it on the code that you have added to your journal) Conclusion: notes on what you found through exploring the code and changing it. Note down a real world example or application

11 Colour coding Does it matter what colour the wires/connectors are?
Generally for connectors no But for sensors and other modules they usually follow a code: Red -> danger -> power Black/brown -> darkest colour -> GND (ground) White/Yellow -> lightest colour -> communications Note this in your journal…

12 Exercise 4 - Potentiometer (Pot)
When you turn the knob of a Pot the resistance changes, so they are sometimes called variable resistors. At a pots lowest level of resistance they let enough current though to read as HIGH (5v) At a pots highest level of resistance they let enough current though to read as LOW (0v)

13 So now… It should be becoming familiar….
Date, aim, kit, method, experiment, conclusion Add a fritzing diagram Add a copy of the code Annotate the code with notes on what changing the code does Make some notes in the conclusion, I could use this for, I am interested in this because, it is used for ‘x’ in the real world….

14 Journal…

15 Pot What happens when you turn the Pot? What could we use a Pot for?
<File>, <Examples>, <SIK_Guide_Code_32>, <Circuit_02>

16 Advanced concepts The Pot is an analog device
Computers count in bits/bytes -> range of 0 to 1023 So it is not just HIGH/LOW, it is a function with a range of The Arduino can read external voltages on the analog input pins using a built-in function called analogRead(). This function takes one input value, the analog pin we're using (sensorPin, which we earlier set to 0). It returns an integer number that ranges from 0 (0 Volts) to 1023 (5 Volts). (SIK circuit 2)

17 Exercise 5 - RGD LED <File>, <Examples>, <SIK_Guide_Code_32>, <Circuit_03> Where have you seen a RGB LED used?

18 Fritzing diagram: The diagram uses connectors related in colour to the pins of the RGB LED (yellow instead of red so as not to confuse it with power)

19 Notes on the code A "function" is a named block of code, that performs a specific purpose. A number of functions are already built-in to the Arduino, and you can write ones yourself A variable is a named number, they can be different data types (more on this another lesson). You must "declare" variables before you use them, so that the computer knows about them ‘int’ = integer, a named variable The ‘const int RED _PIN = 9;’ indicates a constant that wont change

20 Random resources pulse-width-modulation-using-analogwrite/ breadboard/step3/Lets-make-something-circuit-1/


Download ppt "Breadboards and LED’s with Arduino"

Similar presentations


Ads by Google