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.

Controlling 12V with 5V (transistor)

Status
Not open for further replies.
I know this must be really basic but I am trying to control a 12V circuit with a PIC (obvious 5v)

so I tried the following in the attached picture

the idea is


I apply ON/OFF (5V/0V) to the base with a RB=82K and a RC=300Ω

I need to generate a signal ON/OFF (12V/0V) in the arrow (for a H-bridge...)

but in the point with the arrow I only get 12V to 8V (and inverted!!!!)

What am I doing wrong????

I tried to put the resistor in the emitter and it goes from 0v to 2V

Help please

Kansai
 

Attachments

  • trans5to12.JPG
    trans5to12.JPG
    9.3 KB · Views: 13,236
Last edited:
Try a totem pole. Here is a picture where totem pole is used to drive a MOSFET.

**broken link removed**
 
Last edited:
I know this must be really basic but I am trying to control a 12V circuit with a PIC (obvious 5v)

so I tried the following in the attached picture

the idea is


I apply ON/OFF (5V/0V) to the base with a RB=82K and a RC=220Ω

I need to generate a signal ON/OFF (12V/0V) in the arrow (for a H-bridge...)

but in the point with the arrow I only get 12V to 8V (and inverted!!!!)

What am I doing wrong????

I tried to put the resistor in the emitter and it goes from 0v to 2V

Help please

Kansai

hi,
Your drawing does not show the transistor type ie: npn or pnp.
I suspect you are using a pnp, which you should not in that circuit.??

If you used a npn it can switch +12V with a 5V PIC signal, but it will be inverted.

As simple method is to use a 74LS07 IC.

EDIT:
attached pdf
 

Attachments

  • 74LS07.pdf
    334.2 KB · Views: 1,442
Last edited:
Try a totem pole. Here is a picture where totem pole is used to drive a MOSFET.

**broken link removed**
You need a series input base resistor to limit the current.
 
Last edited:
Sorry . It is a NPN.
Anyway I suspect that my error was that I was not saturating the transistor.
I changed RB to 10K and now it works to some extent although inverted.

When I apply 5V to base I got 0.5V to the bridge
when I apply 0v to the base I got 12V to the bridge

I suppose I will invert the base signal to make it correct.

I am not calculating anything about currents... I am a little bit worried about that.
edit: I measured the current going to the bridge . goes to 0.0375A or 37.5mA


I tried changing RC to 550 and now I got 22mA and good 0.17v~12V.
so I guess changing RC reduces the current without affecting the voltage. News to me





hi,
Your drawing does not show the transistor type ie: npn or pnp.
I suspect you are using a pnp, which you should not in that circuit.??

If you used a npn it can switch +12V with a 5V PIC signal, but it will be inverted.

As simple method is to use a 74LS07 IC.

EDIT:
attached pdf
 
Last edited:
The two important questions are how much current do you need and how fast do you need to switch it?

I have previously driven 12v LED lights from a 5v PIC using just a 2N7000 FET. This has a low Vgs so I drove it directly from the uC. I'm unsure if that is a sensible way of driving a FET, perhaps someone can correct me if not. However, it worked :)
 
I have previously driven 12v LED lights from a 5v PIC using just a 2N7000 FET. This has a low Vgs so I drove it directly from the uC. I'm unsure if that is a sensible way of driving a FET, perhaps someone can correct me if not. However, it worked :)

hi ed,
That will work OK.
If I was switching an inductive load with the FET, I would have a series 1K resistor from the PIC pin to the FET Gate.
In the event of a Drain/Gate breakdown the 12V will not drive enough into the PIC pin to destroy the PIC's internal clamp diode.
 
Status
Not open for further replies.

Latest threads

Back
Top