how to switch 3.3v using 12v source

Hi guys.

I have googled the crap out of this without much success- I think mostly because i do not know the required terminology to ask my question properly.

My arduino project has a series of inputs (pullup) that i need to switch using a 12v signal.

I could do this very easily using bulky 12v relays to do the switching but this is UGLY.

I have found some micro PCB mount 12v relays which would also do the job but really that doesn't seem like the most elegant of solutions either.. they just seem huge considering the tiny currents they will be switching.

How would you guys do it? Ideally I'd find an IC or other surface mount components so that i could make up a really compact PCB.

I have a total of 6 inputs that i'd like to switch.

Any help much appreciated-

How about a 4N25, see figure 14 here. You just need to size the resistor on the led input to limit the current with your 12V input.

(I wonder if there's a version with more than one in a chip?)

Is the input signal digital (ie either at 0V or 12V, never inbetween except on fast transitions?)

How fast must the response be (presumably very slow if relays were an option)?

What is the current sourcing ability of the 12V signals?

You haven't said how you want the switching to work:

0V in, 0V out and 12V in, 3.3V out?

or
0V in, 3.3V out, 12V in, 0V out?

The latter is easily done with a non-logic level MOSFET.

Optocouplers are flexible and can do either sense of switching by putting the output as high-side
or low-side switch.

wow thanks guys.

If it helps- I am currently just using normal pushbutton switches that are between the input pin and arduino ground with pullup code to make it work.

All i need is for the switch to now be activated by 12v eg like a relay would.

I hope that answers your question.

Not sure how to answer the others. I think what im after is a tiny solid state relay? No matter how much i read- i cant figure out how a mosfet or transistor with 3 pins functions like a relay with four pins being used.

ps, my damn chinese nano (the one that was going to be used in my finished project) just blew its usb diode the first time it was plugged in to USB... what a #@$

flyingbrick88:
ps, my damn chinese nano (the one that was going to be used in my finished project) just blew its usb diode the first time it was plugged in to USB... what a #@$

Better to experiment with cheap chinese arduino while learning.

Hi,
Figure 14;
Opto_Input.jpg

Tom.. :slight_smile:

Opto_Input.jpg

Any chance you could annotate which inputs go where? :smiley: thanks

flyingbrick88:
ps, my damn chinese nano (the one that was going to be used in my finished project) just blew its usb diode the first time it was plugged in to USB... what a #@$

Probably your own fault.
Originals and clones have the same circuitry.
There is a 500mA (absolute max) diode between USB 5volt and MCU 5volt.
Of you try to draw more than ~400mA from the 5volt 4.6volt pin, then the diode will release it's magic smoke.
Easy to replace. Use a schottky type.
Leo..

Voltage divider?

https://learn.sparkfun.com/tutorials/voltage-dividers

OK, compact might be a problem, unless you use really tiny SMDs...

Voltage divider, (2 resistors, 1/8 Watt is enough).

12V----///---+---///----GND
15k | 5.1k
|
3V to Arduino in pin.