4
\$\begingroup\$

I'm a programmer by nature, but I thought I'd try dabbling in programming a micro controller.

I've hooked up my voltage meter, and have figured out how to switch my output ports on/off, and they're currently outputting 3.3V.

What must I do to increase the output of my DigitalIO pins to 12V? I've seen others doing this, but I have no idea what it looks like.

Thanks in advance.


Edit

I'm assuming I need something along these lines, but I'd still need to learn how to actually get the right stepping so that I don't fry anything.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

The microcontroller pins digital high voltage will always be limited by it's supply (as you are probably aware but just in case), so if it runs on 3.3V the pins will switch from 0 to 3.3V.

To level shift to 12V, you would need a separate power rail. This could be created with a DC to DC boost converter from the 3.3V supply like the one you link to. The datasheet should give enough info to set it up correctly, but they can have quite a few catches for the newcomer so you might want to think about a ready assembled module like this.

Once you have the 12V rail, you would need an external transistor (or level shifter IC) to switch it as you cannot apply more than the microcontrollers supply voltage to it's pins (e.g. 3.3V)
This could be as simple as a common emitter/drain setup like the diagram below. The 5V can be replaced with 12V and pull up resistor (10k is a good start point) adjusted as necessary (the full discussion came from page 8-6 of this useful Microchip document):

Level Shift

Here is another example in this RS232 level shifter (the Tx part is the bit you are interested in)

\$\endgroup\$
4
  • \$\begingroup\$ Would this unit work to finish the circuit (instead of wiring it up on my own)? \$\endgroup\$ Nov 28, 2011 at 17:22
  • \$\begingroup\$ @ChaseFlorell - not for 3.3V to 12V no, it's minimum input voltage is 3.5V according to the specs given (it may appear to work at 3.3V but you can't guarantee it will behave correctly so I'd avoid it) You need something that includes 3.3V in it's input range. \$\endgroup\$
    – Oli Glaser
    Nov 28, 2011 at 17:51
  • \$\begingroup\$ Great, so that's heading in the right direction though? My Netduino can also output 5V. \$\endgroup\$ Nov 28, 2011 at 17:53
  • \$\begingroup\$ Ah, if you have a 5V supply available then you can use the module you linked to. I was thinking you only had 3.3V available. \$\endgroup\$
    – Oli Glaser
    Nov 28, 2011 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.