GarethB
Likes to peek
- Messages
- 2,291
- Name
- I don't even know anymore!
- Edit My Images
- Yes
Hi Gareth
I know nothing of Electronics, they had not been invented when I was at school, the only thing I remember from school was connecting a battery and bulb and using a wire round resister to alter the brightness.
Same here!
Until about a year ago, I had never even heard of an Arduino!
I too remember that lesson with the bulb etc....ruddy nora....it's 35 years ago!!
Time does fly!!
seaodyssey also said:Can you recommend a good book about Electronics, mind you my brain is full and there is no room for any thing too complicated in it.
Unfortunately I can't recommend any books, since all that I have learned over the past year or so, has been from the internet....just bits and pieces of info from various sites etc.
Although I will say that 'the bulb lesson' that we both fondly remember is a good starting point to learning about Ohms Law.
I'm sure you've heard of it, it's a fundamental law of electronics, and is invaluable.
In summary:
V=IR
- V = voltage (volts)
- I = current (amps)
- R = resistance (ohms)
This can be rearranged to find any of the values, like so:
I = V/R - to find the current in amps.
or
R = V/I to find the resistance in ohms.
The wire wound resistor you mentioned (if I remember correctly it was called a rheostat wasn't it?) is another kind of potentiometer.
It essentially varies the resistance (a variable resistor?), so that you can control the flow of current through a device, in this case a bulb.
The resistor 'resists' the flow of current, so if we increase it, therefore we decrease the current flowing through the bulb, and it becomes dimmer.
So lets assume a 5V DC bulb (with a 5V DC supply).
And lets also assume that the rheostat is turned all the way down, so that the resistance is about 1 ohm.
What would be the current flowing through the bulb?
I = V/R
I = 5/1
And that would be 5 amps!
(Providing of course the power supply can deliver 5 amps)
Which is a lot of current, and would surely burn the bulb out quickly!
If you turn the rheostat up to say 1000 ohms.
I = V/R
I = 5/1000
so this results in a current of 0.005 amps or 5 milliamps.
Much less current, and so our bulb will not burn out, though it may be dimmer - a bit of fiddling can get a resistance that yields an acceptable brightness and won't burn out the bulb.
These calculations are very important when choosing a 'current limiting' resistor for LEDs etc...or when selecting a resistor for the input of an optocoupler (which has an LED inside it).
If you don't select the correct value, you're likely to burn out the LED if the resistor is too small, or if it is too large a resistor, the LED won't light up.
(The recommended current for LEDs is usually stated on a datasheet)
The value of 330 ohms (in the drop controller circuit) is a reasonably good approximate value for any LED connected to a 5 V DC circuit.
Since the typical recommended current draw for a (typical) LED is between 20 and 30 mA (0.02 to 0.03 amps), so back to our calculation (rearranging to find the resistance):
R = V/I
R = 5/0.02
So that gives us a resistance of 250 ohms...which I've rounded up to 330 ohms (common practice amongst the 'pros' apparently!)- which is an easily obtainable, typical value and works fine.
(Always better to round up the resistor, than round down - better to 'over-limit' than 'under-limit')
This 'current limiting' resistor is crucial for the longevity of LEDs - without them they'll burn out quickly.
These are very basic calculations (I recommend further reading), and they don't go into the power dissipated through a device, but any decent Ohms Law calculator should have this also.
Here is a link to a handy Ohm's Law calculator that I use from time to time:
http://www.ohmslawcalculator.com/ohms-law-calculator
Just Checking, does that resistor connect to the 12v line of your Diagram, cos it then goes to the 5v Arduino.
Pete
Wow....good catch Pete!!
I had totally forgotten to add that the 10K resistor should be tied (pulled up) to the 5 V DC on the Arduino and not the 12 V DC rail!
I'm so sorry for the mistake - I think it happened due to me working with the older circuit layout with no switch, and therefore no need for a 'pull-up' resistor...I got confused!
I have amended the diagram to show the correction.
I hope it's reasonably clear.
(This of course only relates to 'de-bouncing' of the switch, and you may or may not wish to do it.
It's good practice to de-bounce switches, but in a simple circuit like this, it may not be completely necessary - indeed, I didn't at first, and mine worked reasonably well.
The original circuit without the 'de-bouncing' components - shown right at the beginning of this lengthy thread, linked here - is still correct however)
I will go back and correct the post earlier in the thread too.
[**Now done!**]
Thanks for the heads up Pete....that could have been disastrous!
You certainly don't want to mix up 12 V DC with 5 V DC!
I hope this has all been helpful.
Like I said, I am no expert (I'm an idiot afterall!) and I'm still very much learning myself, but if there's anything that I can do to help, I surely will!
Last edited: