Don't forget to share



After the success of the first test of making a LED flash on the #Arduino microcontroller board here.  I was excited to do the next project/test, hopefully it will be even better.


I returned to reading the book, 3 pages about pumping….  I must admit I was like a bat out of  hell speed reading this part, wanting to get on with some action. It was concerning resistance and voltage, ok I get it but come on I want more hands on stuff.

Use a push button to control the LED

Rubs hands together… 

Ah, Remember I told you I knew nothing about electronics, well I wasn’t joking. The book is asking me to gather the parts that I will need for this test and I don’t know my resistor from my capacitor!  Luckily that is what god gave us Google for.  Which works incredibly well until I come to the next dilemma

I have jumper wires of many colours and sizes, and the diagram is not in colour so I don’t know if I have to use specific colours. I ponder over this for a while, and have search or two but I can find nothing about colour coding on jumper wires so I am just going to assume that it doesn’t matter.

I was told that if I had a problem several people could  help over at http://www.designspark.com/ could help on the boards there, which I’m sure they could but I wanted to see if I could figure it out alone. 

Typed the sketch ………

And I create the circuit and pray.

Hey presto ……… as if by magic – it works, I am now controlling the LED with a button.



But something isn’t right………… 

Back to the book, I’m now reading about something called bounce, this is the problem it seems. There are another 2 codes to work through before it will finally works correctly, a learning experience it seems. 

Controlling Light with PWM

I learned that PWM is Pulse width Modulation, sounds exciting right?  It seems that if you blink the LED fast enough you don’t actually seen it blink anymore. And with this circuit we will be able to change the brightness. 

I was glad I knew that because the first example I did was sooooo faint I didn’t think it was working until I turned off the light and saw it glowing.
   

The next step is to…. Turn on the LED when the button is pressed and keep it on after it is released including the simple debouncing – if the button is held the brightness changes. 

Argh, the book tests me and asks me to set up the circuit that we created to read the button before, but as this was two days ago I seriously cannot remember, feeling a failure I look at the diagram. 

Now it says to combine the two circuits.

This is getting tricky right?  I was thinking this but I followed the instructions in the book with a little bit of what I had learned , added sketch and again it worked! 




Now to use a light sensor instead of the pushbutton. 

Set up the same circuit as with the pushbutton and replace button with sensor, sounded easy as pie, but its not functioning!  I could not work out why, I even convinced myself I had a faulty sensor as I tried it again with the push button and it worked, and without the sensor the LED is constant.

Start again from the beginning but still nothing from the sensor – decide to move on, maybe I can find out what it is.


Analogue Input

To blink LED at a rate specified by the value of the analogue input.

This one went very smoothly again, and I discovered that there is nothing wrong with the sensor.

Now to alter this circuit by hooking up the LED to pin 9 without over lapping the circuit.

I thought I’d done that……….. but the LED was darker than the bottom of a deep well even with the lights off.

It seems I had the wrong end of the stick. I thought that I could add the LED and the wire on the same circuit but I believe it need its own circuit with a resister.

Well it worked so that was me satisfied.  



Next we set up serial communication, followed the instructions for that and it says that any software that can read from the serial port can talk to Arduino!!

Chapter 6

Now this was very confusing, and I needed a lot more parts. I did try it but I didn’t get very far.

This is what happened.

I didn’t know that a Processing sketch was different to what we’d used already. This sketch was running from the PC and I had to download a separate IDE for this code/sketch. However I was relived that on googling that I wasn’t alone.

Secondly I was told to change the font, and the IDE didn’t have the font requested and I couldn’t find it online. 

I did create the circuit which looked good but after reading further to complete this properly I needed some more equipment so I decided to quit while I was ahead.

I had fantastic fun with the Arduino, and I really feel like I have learned a lot of great information, I’d like to progress to the next stage now.

If you are thinking of getting in to electronics or just wonder what this is all about, I do suggest to you get a starting kit  its not expensive and you will enjoy it.


The Arduino Duemilanove is available from RS Components


Also see my blog over at @DesignSpark http://bit.ly/gcc7pb