Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Switching 5V and 12V on Arduino

Status
Not open for further replies.

gregmcc

Member
I've got a circuit I'm building to program a EPROM using an arduino. The schematic I found uses a npn and pnp transistor to switch vpp between 5V and 12V.
Trying to understand why a npn and pnp transistor are both used?

So when pin3 is high, 12V is on vpp. When pin4 is high, 5V on vpp.

I've added the schematic on the right, just using just a npn transistor. Won't it accomplish the same thing?
 

Attachments

  • rsz_screenshot_from_2018-10-19_09-15-25.png
    rsz_screenshot_from_2018-10-19_09-15-25.png
    7.1 KB · Views: 134
The single transistor is working in "emitter follower" mode; the emitter will always be no more than 0.7V lower than the base.

With the base running from a 3.3V or 5V logic circuit, the emitter will only rise to 2.6 or 4.3V, not 12V.
That configuration has good current gain, but zero voltage gain.

The two-transistor circuit uses the first transistor to apply base current to the second transistor. The second (PNP, in "common emitter" mode) has it's emitter connected to the +12V supply and it's collector will be able to switch up to very near 12V.

That circuit is not well designed, it should also have a moderate value resistor, eg. 4k7, connected between base and emitter on each of the PNP transistors, to avoid problems with any slight circuit leakage currents.

Edit - info on transistor operating modes:
https://www.radio-electronics.com/info/circuits/transistor/circuit-configurations.php
 
Last edited:
The 12v switching part of your schem is a voltage regulator not a switch.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top