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.

PNP Voltage Switch Question

Status
Not open for further replies.

Hopperito

New Member
I'm definately not an electrical engineer, but I figured something this simple was within my limited grasp. I studied the schematic for my PIC programmer, researched via google, and found out the parts are ok substitutions. I want to be able to switch the 12v coming from my programmer board via the Vpp1/MCLR line to any one of multiple PIC chips. My programmer board does exactly that, but when I try to duplicate it on my breadboard, it fails. It works fine if the supplied voltage is 5v, but when I apply the 12v, it supplies 12v at the output no matter what state the input has. Could someone take a look and tell me what they see? Vpp3 is the output, and I'm using RD0 from my PIC to control the circuit's on/off state.
 

Attachments

  • pnp_12v_switch.jpg
    pnp_12v_switch.jpg
    79.7 KB · Views: 731
If you can configure your pic drive as open collector (drain) it will work. 74LS06 is open collector. Check the datasheet on which pins can be used in this way.
 
Ah, ok. Does that explain why when I disconnect the line from the 7404 completely (like a high impedence state) the circuit DOES shut off? I toggle high or low, and I have 12v, but leave the line not touching anything, and it shuts off. That's what confused me. Live and learn I guess, thank you!

Oh, I don't have any 74LS06s lying around. Maybe I could do this with (pnp)3906s or (npn)3904s? Thanks for the help.
 
Yes, if you put a 3904 in place of the 7404 and drive it from the pic you will be ok. You can also use the pic to drive it directly (without the 7404) when you have the output set as open drain.
 
Thank you! I'll do just that! I was a bit nervous about connecting it directly to my 452 because when I measured the voltage at the base of the 3906, it read at 11.6v and I was afraid I would fry it. Sounds like I need to start doing some reading on basic electronics. =|
 
Remember to leave the 4.7K in series!
 
Hehehe. Thanks for that advice. Actually, I know that much. :shock:

I'm going to try to quickly educate myself in the area of transistor circuits. I certainly have enough hardware lying around my office. I want to design this so selecting which PIC to program is addressable, since I need to channel the data, clock, AND Vpp lines to the selected chip. I already have five various PIC projects breadboarded that I switch around working with, and moving the darn wires is getting really old. If it was all 5v, I'd have it made, but the 12v throws me. I've found a couple of sites that focus on open collector circuits using transistors, but if you can think of any additional places that might help, I'm all ears!
 
TheOne said:
Yes, if you put a 3904 in place of the 7404 and drive it from the pic you will be ok. You can also use the pic to drive it directly (without the 7404) when you have the output set as open drain.
I have no experience with PICs. Can they really tolerate 12 volts on an output when configured as open drain?
 
I must admit that I have not looked at the datasheet. Maybe they can't because they may have a protection diode to VDD?. I am sure Nigel will correct us.

EDIT:
Just looked it up. You are limited to 8.5V on the open drain output, so he will have to use a transistor or 3.9V zener in between.
 
Just looked it up. You are limited to 8.5V on the open drain output, so he will have to use a transistor or 3.9V zener in between.
I have both, and I just tried using the 3904 npn in the circuit. Again, 5v, it works great, but with 12v, same thing. I'm certainly missing something here. Back to googling.
 
Hopperito said:
Just looked it up. You are limited to 8.5V on the open drain output, so he will have to use a transistor or 3.9V zener in between.
I have both, and I just tried using the 3904 npn in the circuit. Again, 5v, it works great, but with 12v, same thing. I'm certainly missing something here. Back to googling.

This is all you need!
 

Attachments

  • tran_sw_232.gif
    tran_sw_232.gif
    2.1 KB · Views: 700
Could you post some values for the resistors? I used various values similar to what I found online, but the results are still the same. Works for 5v, doesn't (always on) for 12v. At this point, it's become somewhat of a quest, but I'm beginning to feel like I would drive 50 miles round trip for a 75 cent 74LS06.
 
Hopperito said:
Could you post some values for the resistors? I used various values similar to what I found online, but the results are still the same. Works for 5v, doesn't (always on) for 12v. At this point, it's become somewhat of a quest, but I'm beginning to feel like I would drive 50 miles round trip for a 75 cent 74LS06.

The resistors aren't at all critical, 4.7K or 10K for all of them would be fine.

The circuit is extremely simple, and there's nothing really to go wrong, the PNP transistor is normally held OFF (the resistor between base and emitter reliably guarantees this), as long as no current flows through the NPN transistor. As soon as the NPN is turned ON, this provides base current for the PNP transistor turning that one ON as well.

If it doesn't work (pretty well regardless of values), you must have something wrong somewhere.
 
I don't know. This is very disappointing. I've double checked everything, even replaced the transistors (I have 20 each of the 3906 and 3904). I've tested each transistor with an LED, and again all together with 5v. Everything works until the voltage on the emitter of the PNP goes above 5v, then it just stays on.

I get different results on my DVM depending on the resistor values I use. The higher the value, the larger the difference in on/off readings. At 1k, there is very little difference. I thought maybe I had the EBC pinouts mixed up, but then my transistors wouldn't have passed the LED test I gave them before. I confirmed the pins are right after a google search anyway. They are inline, TO-92 plastic.

I'm sure your suggested circuit is fine, but I can't for the life of me figure this out. I appreciate you taking the time to help. I'll snap a picture and post it so you don't think I'm crazy. Actually, I'm close to being driven there right now. =)
 
Here is a photo of the circuit Nigel, and I'll stop beating this dead horse. Notice that this photo was taken when 5v was used for the voltage input, but that's irrelevant for the photo.
 

Attachments

  • 121_2162_002.jpg
    121_2162_002.jpg
    74.9 KB · Views: 640
You have swapped emitter and collector on both transistors. Rotate them 180 degrees.
 
Hopperito said:
Here is a photo of the circuit Nigel, and I'll stop beating this dead horse. Notice that this photo was taken when 5v was used for the voltage input, but that's irrelevant for the photo.

Like any other fault finding exercise, it's helpful to try and break down the circuit to find where the problem might be.

For a start remove the resistor between the NPN collector and PNP base, does the LED light then? - it shouldn't.

If it doesn't light, refit it, and remove the resistor to the base of the NPN, again it shouldn't light the LED.

Let us know what happens!.
 
Oh my, do I feel stupid. I even have 3906 transistors on the breadboard, with the emitter clearly marked. I don't know what I was thinking that caused those to be turned around. All that time waisted for such a stupid mistake.

It's like searching for your glasses, and they're on your face. :oops:

Thanks Ron and especially Nigel for the patience. Wow.

Oh, it works fine now. Voltages are fine, after I discovered that the weird negative voltage readings on my DVM were caused by one of the probe cables being too close to my halogen desk lamp. It's been an interesting morning!
 
With them connected backwards their base-emitter is breaking down with 12V, but not with 5V.
 
That's interesting. If I didn't lose so much time for my stupid mistake, I was thinking of setting up the circuit in reverse again and test it. Funny, but when it comes to my TTL and MCUs, and electrolytic capacitors, I'm really careful of orientation, because of scary past experiences probably. :roll:
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top