12v 0v and 5V switched supply voltages

Thread Starter

bodhayannandi

Joined Nov 16, 2013
8
I have made a circuit to generate 12V, 5V and 0V signals for parallel programming, It worked fine when simulated in pspice but, when I tried it on breadboard it does not give 12V it gives 9V or so, The other signal levels(0 and 5V) are fine but not the 12v level, I dont understand this. This are the logic combinations i am using

for 0v PORTXn=1 PORTXn+1= 0
for 5v PORTXn=0 PORTXn+1=1
for 12V PORTXn=0 PORTXn+1=0

when both The transistors are turned off it should draw not more than 15nA of current according to the data sheet but it draws 6mA from source. Here is the circuit i have used the BJT is BC548

 

Attachments

Last edited:

bertus

Joined Apr 5, 2008
22,276
Hello,

I found your post in the "completed projects" forum.
As it says it is only for completed projects.

Bertus

PS I have removed you double posting on the other thread in there.
 

MikeML

Joined Oct 2, 2009
5,444
Here is a more useful simulation. There are four states of two ports. This shows all four.
Look at the supply current I(V3).

What is connected to V(out) when you are measuring 6mA?

Not a very good design; it puts out Vpp during bootup....
 

Attachments

Last edited:

Thread Starter

bodhayannandi

Joined Nov 16, 2013
8
Hello Mr. MiKeMl. Thanks for replying. V(out) was open(no connection) I have measured the supply current, i.e. i connected an ammeter in between 12.5V supply and R2 and found the current to be 1.08mA not 6mA sorry about that(it was from a previous reading with R2=500ohm and R4=400ohm), while base of both the transistors were given logic 0(actually something around 0.3V to be precise, as this is the logic 0 that the Atmega8 device gives at its output pin).
 
Last edited:

Alec_t

Joined Sep 17, 2013
14,313
i connected an ammeter in between 12.5V supply and R2 and found the current to be 6mA
Why connect it there? If you mean the left-hand end of R2 that would have applied ~12.5V to PORTXn and could have blown the Atmega. If you mean the right-hand end of R2 the only thing to limit current would be the base-emitter junction of Q1, plus the ammeter resistance. That could have blown either Q1 or the ammeter.
 

Thread Starter

bodhayannandi

Joined Nov 16, 2013
8
I saw the simulation results. If could've achieved something even close to this i would have been more than happy. But when i try it on breadboard the source current is nowhere near that, which is rated in the datasheet of BC548(15nA)
 

Thread Starter

bodhayannandi

Joined Nov 16, 2013
8
Thanks, that was a great help.. But what i can't understand still, why was there 1.08mA current taken from the source in the first place even though the microcontroller outputs logic 0 from its port to both the transistors, both the transistors should have been cut-off and cut-off current should not be more than 15nA.
 

ScottWang

Joined Aug 23, 2012
7,399
1. I was modified and added two resistors(R5,R8) to the circuit to avoid the Q3,Q4 floating when Q1,Q2 was off.

2. This circuit control is different from yours.
a) 00 -- output is low. (5V and 12.5V control are low(0V))
b) 01 -- output is 5V. (5V control is hi)
c) 10 -- output is 12.5V (12.5V control is hi)

3. To avoid the output pin will output 12.5V when the power is on, so if there is no any hi at the inputs then the output will be low, the output pin will be pulled low by R10(3.9K), no any current output.

 

Attachments

Last edited:

Thread Starter

bodhayannandi

Joined Nov 16, 2013
8
Hello Mr. scott wang first of all thankyou for this wonderful circuit. The circuit is fine except for the value for R8 and R5 they are too high such that when Q2 and/or Q1 is in cut-off, the cut-off current turns on Q3 &/or Q4 using 1K resistor fixed this problem. Thankyou.
 

ScottWang

Joined Aug 23, 2012
7,399
Hello Mr. scott wang first of all thankyou for this wonderful circuit. The circuit is fine except for the value for R8 and R5 they are too high such that when Q2 and/or Q1 is in cut-off, the cut-off current turns on Q3 &/or Q4 using 1K resistor fixed this problem. Thankyou.
Nice, you could correct the value to suit what you need.
 
Top