Ive seen many show-offs and tutorials where peeps have connected arduino with eg, switches and so on.
What im trying to figure out, those switches has 220V I\O, how do one connect arduino with them ? Shouldnt the board
fire up like fireworks with those powers ?
Another question, for led-lights (as example) how exactly do i calculate or get the info about what kind of resistor to use ?
Say i got 9V battery and a led
2a) how do i know how much V this led needs ?
2b) what kind of resistor should i use ?
Resistors have color stripes that i understand are telling what kind of resistance it gives, but im not able to figure out what that "data" actually means.
What im exactly trying to accomplish is that i have a led-set bought from ikea, which has a little controller containing a scroll-wheel for change of colors and 3 buttons (power, colorfade and rapid color change presets). I would love to connect arduino to that so i could control the lights with my phone.
Do not directly connect an Arduino board to line voltage (110 or 220 Volt AC). As you correctly suspects, it will be fried. It is also (more importantly) a shock hazard. If you still want to use an Arduino to switch 220V on/off, use a switching device such as a mechanical or solid state relay or a triac. It is good practice to also add an isolation device between the low power device and the 220V side, such as an opto-isolated diode or triac. You need to research this a lot more before you should attempt to experiment with 220V.
2)You can use an online calculator such as http://ledcalc.com/. You need to know the voltage drop across the LED (check datasheet of LED, else assume 2V) and the target current (this determines brightness of LED). I think something like 20mA is plenty for an LED, anything between 5 - 20 mA should be visible.
The colour coding on resistors can be found online (e.g. http://www.elexp.com/t_resist.htm) or in an electronics textbook. I can't remember the coding so I use my multimeter to measure resistance.
danelk:
2a) how do i know how much V this led needs ?
The voltage is closely related to the energy of the photons produced - thus voltage increases from IR-red-orange-yellow-green-blue-white-violet-UV. White LEDs are blue LEDs really, BTW(*). You can calculate the energy in electron-volts of a photon from its wavelength thus:
eV = 1240 / wavelength(nm)
Thus for red light of 740nm, energy is 1.67eV, so deep red LED should be around 1.7V. Blue light of 400nm is 3.1eV per photon, so blue LEDs are somewhat over 3V
Of course each type of LED has its own peculiarities and inefficiencies, so this is only a rough guide.
(*) There is a blob of fluorescent plastic above the LED die to convert a proportion of the light to yellowish light.
Anyhow, yep the colour system is a little helpfull, but still, not quite sure with the resistors at all...
say i have a 1.5v battery and a 9v and a car battery (12v) each of those would require different resistor.. right ? this leads to the question, how do i know which resistor is preferred ?
I guess trial and error will lead to massive fried leds haha
i think i may have switched som values... the led-light set (im interested in controlling) probably allready uses anything between 0-9V but i have not measured it yet.
if im correct everything between 0 and 5 are pretty much ok with arduino (tho both analog AND digital ?) or correct me ...
the set that im talking about is this one: LED-belysning för hela hemmet - IKEA
Not sure if swedish will tell you anything but i hope some of you guys have similar set and know more about it
your ikea "DIODER" contains an "electronic transformer" ( at least as described in the German page ).
This probably does not supply a defined voltage, but rather the proper current required for the leds.
The resistor method to limit the led current is rather appropriate for small signal leds of typically 20 mA max.
If it's about 3W or more, it's not the best design to simply supply a sufficient voltage and then burn the extra power in a resistor. Such LED drivers are usually constant current sources.
with Leds you design according
to the current through it rather than the voltage acrross it.
Reply:
You need to know the voltage across the LED when the required current is flowing. This is found in the data sheet for the LED.
In the absence of a data sheet assume 20mA maximum and the voltages Mark said.
My analysis was correct, you just have to read as far as items b and c.
Thus for red light of 740nm, energy is 1.67eV, so deep red LED should be around 1.7V. Blue light of 400nm is 3.1eV per photon, so blue LEDs are somewhat over 3V
I have no idea how MT got from 1.67eV to 1.7V and 3.1eV to 3V.
Thus for red light of 740nm, energy is 1.67eV, so deep red LED should be around 1.7V. Blue light of 400nm is 3.1eV per photon, so blue LEDs are somewhat over 3V
I have no idea how MT got from 1.67eV to 1.7V and 3.1eV to 3V.
Well I just assumed devices aren't 100% quantum-efficient, so you'll need a bit more voltage than the theoretical quantum minimum.
[ digression:
Actually thinking about it its not necessarily the case, thermal energy can be involved too (for instance the bandgap of silicon is 1.1V or so, but diodes conduct at around 0.7V at room temperature - 0.4V is due to the fact that only the most energetic electrons jump the barrier (like evaporation)