Go Down

Topic: [Newbie] 24v Relay + transisor + optocoupler -> arduino (Read 6598 times) previous topic - next topic

SurferTim

You could be switching 2400vac with the relay contacts. That has nothing to do with the coil. It is +24vdc.

I would drop the opto-isolator.

luismanson

but that way there is a very small chance that in case of failure of the transistor i send 24v to the arduino pin, right?

SurferTim


but that way there is a very small chance that in case of failure of the transistor i send 24v to the arduino pin, right?

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.

luismanson

ok. i will trust you XD

so, to make the schematic in the first post work OK with an input of 24vDC i have to replace R2 with one of 1K?? and thats all?

SurferTim

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.

luismanson

ok, i have something to start, i will check this after work, thank you very much!!!

SurferTim

You are welcome.

Warning: BE EXTRA CAREFUL around those high voltage contacts! They have the potential to do more damage to you than to the Arduino. The Arduino can be replaced.

Go Up