Back to Robotics Project Overview
Arduino Practice Journal
I am using the kit lessons because I know I will have all the parts. The reviews say the lessons are not the best, but I have to start somewhere.
Lesson 01 – Install and Setup
- Install Arduino
- Install and Manage Libraries
- Include Libraries
Lesson 02 – Blink Fast or Slow
- Load Blink Example
- Edit Blink example to make it blink faster
- On/Off = High/Low Voltage Level
- Identify pin number (usually 13) for built in LED
- Note: Code was not written in example. I added the line “isn’t led=13”
- Edit seconds/milliseconds 1000 milliseconds = 1 second
- Change to 50 for very rapid blinking
- 500 for fast blinking
- 1000 for slow blinking
- 2000 for very slow blinking
Lesson 03 – LED
- Change LED brightness using resistor
- LED, Resistors, Male to Male Wires, Breadboard
- Breadboard, for prototyping: short rows join components together electronically
- Legs of two components in the same row joins them together
- Long deep channel indicates a break in connection
- Rails are two outer rows, Pairs of +5 Volts & ground.
- Rails allow you to connect power to many components on the board
- Breadboard circuits are unreliable b/c no Solder
- LEDs come in 3mm, 5mm and 10 mm
- Can’t directly connect LED to Battery bc
- Has positive and negative lead that must be placed the right way
- Must be used with a Resistor to limit current or it will burn out
- Positive LED wire = LONGER
- Negative LED wire = Flat side by connection to plastic
- Resistors RESIST the flow of electricity
- K Ohm (Ω) = 1000 Kilo
- M Ohm = 1,000,000 Mega
- No positive or negative leads
- Changing the resistor changes the brightness. Easy/
- Note: I followed the diagram and it worked but I suspect I don’t actually understand how I have to design the circuits. I will need to work on that, but I think practicing by following instructions is a good start. I need some context to build on.
- Note: Clearly keeping all these little bits organized is a huge challenge. The kits looked labeled when I got them, but not all the labels are correct. Once they are out of the box, they don’t fit back in it. I am going to have to make a better system. I ordered thick, small plastic bags for the resistors. I can label them and keep them in three boxes. The sensors are too small for the drawer box I bought. If it had dividers that would be better. The one I used to have had dividers! Maybe I can keep the small sensors in a series of divider boxes like I use for jewelry pieces. Once I have been through all the lessons, I will try and sort it out.
Lesson 04 – RGB Light
- RGB Lights – LED Lights with blendable colors
- Common Anode RGB Lights = Connects to 5V on the Common Pin
- Common Cathode RGB Lights = Connects to Ground
- Analogue Write function allows variable power to LEDs marked with a ~
- Single negative -, three positives +
- Blue (shortest), Green, Cathode (longest), Red
- Pulse Width Modulation (PWM) technique for controlling power
- Define Pins that control each color
- Then Setup
- Define Three Pins as having OUTPUT function
- Define them as HIGH Power
- Analogwrite sets the value, so Red is 255- whatever the assigned red value is
- Loop runs continuously
- Define delay between color changes
- Everything works fine.
- Question: How fragile is the breadboard? I had to yank pretty hard to get some of the lights out.
- Note: This seems fairly easy. The color change works. I understand the code. However, I need to get a reference book to memorize what all the functions mean. That’s how I did it the first time. I wrote code and hyperlinked every single word or symbol to a definition of what it meant in a popup box. As a side note, it makes me wish I had bought independent server WordPress instead of a higher data account. That way I could customize the design if I want to do something as complex as a detailed code explanation with hyperlinks. On the other hand, I really don’t have time for that!
Lesson 05 – Digital Inputs
- Buttons to turn something on and off.
- Note: I am a bit bored but I know I need to do this, not just read it.
- Note: And I hooked it up. I had more trouble following the diagrams this time. I clearly don’t fully understand the circuits.
- Define Pins.
- LED = Out Pin
- Buttons = Input
- The Default state is “high” or “on” This is kind of backwards and the loop fixed it, but I am not sure why it has to be done that way.
- Why is it backwards?
- If one button is pressed, then low
- If the other is pressed then high
- Easy if/then statement
- Note: I am more comfortable with the code but less comfortable with the electronics.
Lesson 06 to 8 – 8 LEDs with 74HC595, Serial Monitor and Photocell
- Don’t waste your main board pins. Use the Serial to Parallel Converter to extend
- Okey Dokey. SO I got two lights to light up. I redid everything several times and it still won’t work. I clearly do not understand the circuits. Today at school I got some books that will help.
- I left it alone overnight. I needed a break and more information.
- I worked on this for a long time. I added some extra research to help. Sean gave me a basic electronics book from the school. I am reading it and making notes as if it were a class. It is helping me get the concepts better. I also went through two or three different sites on how to use a Breadboard. Then I read the specs on the 74HC595 (Shift Register). This also helped since I could not really figure out how the pins were different. The instructions say they are, but it’s not visible. You have to check the spec sheet. After all of this, I finally figured out how to make everything have power. I then figured out how the resistors worked. I had to cut them down so they didn’t touch each other, but resistors are cheap. I’ll get more. After that, I got the whole circuit to work. All the LEDs lit up. Then I added a photo resistor. The code is still pretty easy, but I would really like to take some time to dissect it. Still, I should learn more about the electronics first.
- The photo resistor didn’t work perfectly. I don’t know if it is anything I did. I think it has more to do with the sensitivity of the resistor.
- Question: How limited are photo resistors?
Lesson 09 & 10 – Active and Passive Buzzer
- You just attach it to the Mega and implement code. I didnt really try to play with the code. I am tempted but I feel like I need to practice putting thinsg together first.
Lesson 11 – Ball Switch
- Mercury switches, tilt switches, rolling ball switch (all the same)
- Easy to use, don’t wear out
- Not as precise as accelerometer but they can detect motion
- Big ones can switch their own power
- Also easy to put together. I am not sure what to do with this
- Question: How will I use this?
Lesson 12 – Relay
- I did everything right that I could see, but the parts described don’t match what I have and the instructions are somewhat unclear. I finaly gave up.