im struggling to make this work, but since i have a big lack of transistor working im asking for help
i have an optocoupler to drive a 24v relay, to switch 220V... can someone give me a light here or give me a working example? i was thinking on using a 2n2222 but the more i google the more im lost i came up with a site with this schematic:
yeah, im giving a 30vDC input to the regulator, my only problem is that i sent the relay as a load to the optocoupler and i THINK that the relay is too much current for the opto, thats why my first post is about a working schematic or the possible need for a transistor :S
sorry SurferTim but i made a mistake in my translation:
im NOT using that schematic, im currently trying to drive the relay directly with the opto and its not working.
im interested in the schematic i pasted but im not sure if it will work in 24V AND if that transistor is the right one
im not sure if you understood, but i want to use that circuit, im NOT using it now, i posted it to get an opinion if it was ok for using it in a 24v enviroament
about your question, the relay works OK if I put the coil to the 7824 output
Is there a reason you need the opto-isolator? Is the Arduino power supply completely isolated from the relay power supply?
No common ground connection?
im using an opto because of arduino protection from the reverse voltage of the relay coil (yeah, i also have the diode too) and because im switching 220vAC with the relay
There is also a small chance that the 240vac wires will become disconnected from the relay contacts and connect to the Arduino power supply. That would be 240vac into the Arduino.
If you use those components correctly, there is very little chance of that happening. The 2N2222 is pretty good at this kinda stuff as long as the current is less than about 200ma.
Yes. The 2N2222 has a high gain at that current. A 1K resistor should put about 3ma into the base. At a gain of 100, that would be 300ma collector-emitter. You could probably use a higher resistance than 1K. Maybe 5K would be ok.
You want to insure it is on all the way, not just partially. That could cause heating problems with the 2N2222. Best is to check the collector-emitter voltage when it is "on". The voltage drop across the transistor should be close to zero.