4

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.

Chase Florell
  • 327
  • 2
  • 9

1 Answers1

3

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)

Oli Glaser
  • 54,990
  • 3
  • 76
  • 147
  • Would [this unit](http://cgi.ebay.ca/ws/eBayISAPI.dll?ViewItemNext&item=130607134187&pt=LH_DefaultDomain_0&autorefresh=true) work to finish the circuit (instead of wiring it up on my own)? – Chase Florell Nov 28 '11 at 17:22
  • @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. – Oli Glaser Nov 28 '11 at 17:51
  • Great, so that's heading in the right direction though? My Netduino can also output 5V. – Chase Florell Nov 28 '11 at 17:53
  • 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. – Oli Glaser Nov 28 '11 at 18:06