I am totaly new to electronic, I will recieve my Arduino Uno in a few days, and I'd like to reproduce a schema I have found on the web.
But as I have started electronic 2 days ago, I have some question that I don't really get, sorry if they are really stupid ^^
Here is the schema :
My questions are :
On the left side, there is a photoresistor with a 1k Ohm resistor, is this resistor only there to prevent a electrical short in case "analog in 0" is set to OUTPUT by error ? Or does the photoresistor need a resistance like a LED ? (if yes, how do I find this information).
On the right side, there is a optocoupler with a 330 Ohm resistor, even if this resistor is put "after" the octocoupler, it will reduce the current inside it ?
About the optocoupler, on the datasheet of it, where I should look to find the voltage and intensity I have to put in, so I can calculate the resistor capacity with the ohm law.
And my last one, about the transistor at the upper right, when you apply a 2.5k ohm resistor on a transistor, will it also reduce the current intensity for the laser behind him, or it only reduce it on the "transistor door" ?
I hope someone will find 5 minutes to light me up a bit ^^
On the left side, there is a photoresistor with a 1k Ohm resistor, is this resistor only there to prevent a electrical short in case "analog in 0" is set to OUTPUT by error ? Or does the photoresistor need a resistance like a LED ? (if yes, how do I find this information).
No, the two resistances form a potential-divider - the voltage at the middle depends on the ratio of the resistances and thus changes as the photo-resistor changes its resistance. Without the fixed resistor the analog pin would always read 0 since it would be connected to ground.
On the right side, there is a optocoupler with a 330 Ohm resistor, even if this resistor is put "after" the octocoupler, it will reduce the current inside it ?
Yes, the current is determined by the sum of resistances round the whole loop, which doesn't depend on their ordering. The resistor could be before or after the opto-coupler, and the same goes for the red and green LED's current limiting resistors.
About the optocoupler, on the datasheet of it, where I should look to find the voltage and intensity I have to put in, so I can calculate the resistor capacity with the ohm law.
The forward voltage and recommended forward current should both be there prominantly - it is likely to be about 1.7V and 10mA (the sender-side is simply an infra-red LED).
For ohms law you'd subtract the forward voltage from 5V to get the voltage drop across the resistor, then calculate its value from the desired current. The 330 value fits the 10mA guess of mine.
I then looked up the datasheet - the forward voltage is actually about 1.15V and max forward current 60mA - so you could use a smaller resistor for higher current. The max output current of an opto coupler depends on the input current, note. The ratio of output current to input current is another key spec - for this device it is about 70% (typical), 20% (worst-case). Depending on what the output has to do you can select an appropriate input current level.
And my last one, about the transistor at the upper right, when you apply a 2.5k ohm resistor on a transistor, will it also reduce the current intensity for the laser behind him, or it only reduce it on the "transistor door" ?
Both - bipolar transistors amplify current, so the collector current is roughly proportional to the base current (unless saturated). The base resistor will limit the maximum collector current (unless saturated) and also prevent the Arduino output sourcing too much current (you musn't go above 40mA on any pin, note). The transistor is probably being used as a switch, so it will be saturated - the resistor will allow enough current to flow to ensure saturation, but prevent too much (wasteful, ultimately could damage Arduino or transistor).
The other point to make is that the Vbe (base-emitter voltage) of a small bipolar transistor is limited to about 0.7V - you cannot connect the base to 5V directly or it will draw a huge current and melt/vaporize! The base-emitter junction behaves very like a forward biased diode (as well as controlling the collector current).
I hope someone will find 5 minutes to light me up a bit ^^