is there a better way to drop my voltage

hi,
i m trying to connect to an alarm, when alarm is activated i get a 24v, using this as an input to my pin, so im going to use a voltage devider to drop down voltage to 5v (should i aim for 4.7v ish? dont want to damage my pin), then a current limiting r into the pin

just wondering if this was the best method for doing? or maby there a better way i could do this?

thank you

opto-interrupter / opto-isolator / etc.

yes i did think of opto-isolator, but i still have to drop the voltage down on tee input, max v in on a 4n25 is 6v, i still have the problem of dropping the v down

when alarm is activated i get a 24v

AC or DC?

Lefty

sorry dc

Simple opto-isolator with voltage divider giving the correct entry voltage and if required current limiting resistor then take 5v from the arduino into one side of the output and the other side will be your 5v to go to the input pin of the arduino with no worries about over voltage or current. :smiley:

i did think of opto-isolator, but i still have to drop the voltage down on tee input, max v in on a 4n25 is 6v,

Where does it say that in the data sheet then? It is not in the absolute maximum ratings table where I would expect it to be. The input is an LED so there is no maximum input voltage, you just have to limit the current with a resistor.

hi mike

what is the absolute maximum voltage of a 4n25? im a bit confused, if thats the case that there is no max voltage on the input side then i dont need to drop the voltage (24v) just limit the current to the led?

would this be ok

thank you

Yes although I would make the resistor 2K4 or even 2K7 to keep the current just under 10mA

24k or 27k?

im confused, surely using a 2k r would limit the led's current to 12ma why so high?

you mean 2.4k, 2.7k?

you mean 2.4k, 2.7k?

Yes I do sorry.
Original post edited. I am glad you are playing attention. :slight_smile:

many thanks for the help much appreciated.

jonisonvespa:
hi mike

what is the absolute maximum voltage of a 4n25? im a bit confused, if thats the case that there is no max voltage on the input side then i dont need to drop the voltage (24v) just limit the current to the led?

would this be ok

thank you

The input side does however have a maximum reverse voltage rating as all diodes do, and leds tend to have small reverse voltage ratings of around 5vdc or so. So if one is driving the led input of a opto with a AC voltage then it can be damaged even though you have a properly sized current limiting resistors. The common fix to this is to just wire an external reversed biased diode across the input led pins.

Lefty