24V to the electron D1


I have 24V switch, ON=24V, Off=0V. i want to connect this to my particle, using digital input D1 in the electron which can handle up to 3.3V if i am right, so what is the best way to conncet this 24V to my electron to detect when its High and when its low,

I used relay, but i am looking for alternative solution “smaller and easy to implement”.

Thank you.

None of the pins on your Electron are going to handle that much voltage.

According to the docs:

yes i know Mjones, that is why i am using relay right now, but i need an alternative solution

Optocouplers, voltage dividers, op-amps, transistors… Plenty of options to choose from. A quick Google can tell you more than we could in the same timeframe.

Might someone has done this before and recommend the best option of the options you gave above,

Thank you

All of the above are valid, and depending on the application you’re intending to use them for, they could all work. Price/size/complexity could then make the difference, which we can’t determine for you.

1 Like

Is the 24V “switch” and actual switch that you flip or is it a relay? If it is a relay then there should be a smaller voltage flipping it. I had to do something similar only it ended up being a 240V relay, you tap into the two lower voltage wires and then can determine when they are connected or not (on or off).

1 Like

If the load is inductive, I’d vote for Opto Isolation for protection.
Something like This is a starting point for searching. They are very easy to implement.

1 Like

Simplest is probably the resistive divider as mentioned and possibly a pair of clamp diodes just in case input exceeds 24V accidentally.

1 Like

its inductive load

its flip switch and i used a relay before but now i want to use something smaller to fit in my box

Since it’s inductive load, I wouldn’t use a voltage divider from resistors to monitor the 24V side unless the Relay has an induction suppression capacitor and you have confirmed there are no voltage spikes during switching (hard to accomplish).

If your goal is to replace the flip switch with something the Electron can control, then you want to look at Opto Isolated Relay. Look Here for ideas.

1 Like