Go Down

Topic: few questions on opti isolator (Read 3786 times) previous topic - next topic

calvingloster

I'm busy designing, or trying to design a battery charger. I have run into a problem now though. I am trying to measure the voltage of a battery with one of my arduino uno analog pins connected to a voltage dividing circuit. But when I connect the analog pin and ground to the voltage dividing circuit the ground pin causes one of my transistors to switch on even though it's switched off. This will cause my charger to permanently be switched on which is not what I want.

My question, is an opti isolator a dirty fix for a bad designed circuit? Or do some circuits just require ground loops to not be connected?

CrossRoads

Can you post the schematic of that?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

calvingloster

Yes I can, here it is. When the wire from the voltage divider is connected to the atmega ground then it drives the NPN transistor high

calvingloster

From what I can see on my diagram is that the two grounds going to the ATMEGA ground are causing the collector and emitter to be "shorted" or basically bridged with a wire if I can say that.. is that the cause of my problem?



CrossRoads

Yes, you've taken the PNP transistor out of the control loop doing that.
Why wouldn't you have the PNP collector to LM317 output, and emitter to Battery+ ?
Then Battery - to Arduino Gnd.
If LM317 out is > 5V, you will need pullup on base to LM317 out to turn it off, and NPN driven by Arduino to pull base low to turn PNP on.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

calvingloster


Yes, you've taken the PNP transistor out of the control loop doing that.
Why wouldn't you have the PNP collector to LM317 output, and emitter to Battery+ ?
Then Battery - to Arduino Gnd.
If LM317 out is > 5V, you will need pullup on base to LM317 out to turn it off, and NPN driven by Arduino to pull base low to turn PNP on.


Well I was trying to avoid complication so I avoided high side switching. With high side switching my PNP base resistors got very hot without the battery connected. With NPN transistors I don't have that problem anymore

MarkT

Perhaps if you post your PNP circuit diagram we can see what you got wrong...

High side switching is usually far simpler for charging circuits.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

calvingloster

Ok I sorted out the problem of the circuit being perminantly on when my transistors were off, I was shorting the collector and emitter with my voltage dividing circuit. So now I have a new problem. What the idea here is I want to switch from constant current source to constant voltage. But if I try switch I only get constant current source, here is a diagram of how it looks. I forgot to draw in the resistors for the transistor bases but just pretend they there

MarkT

#8
May 31, 2014, 12:34 pm Last Edit: May 31, 2014, 12:40 pm by MarkT Reason: 1
You really need to learn how to draw circuit diagrams, I'm going to
have to redraw that to understand it.

+ve rail at the top, ground rail below it, general signal flow left to right....

[ well I've figured out what the circuit is, and its very confused... ]

You should perhaps explain exactly what you want to achieve, so we can figure out
a plausible approach.

BTW why use a 32V supply to charge a 12V battery? 
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

calvingloster

I'm sorry I'm new to this. What happens if you have two grounds and two V+ rails like my situation?

calvingloster

Ok it's basically two separate circuits put together. The one circuit is a constant current source. The other one is a constant voltage source. They are both connected to the battery. The transistors there to select which circuit I want to connect to the battery, either constant current or constant voltage. But my problem is the transistors some how connect both constant voltage and constant current circuits at the same time, even though one of the transistors are LOW

MarkT

But the two transistors are connected in parallel.

You can't simultaneously have constant voltage and constant voltage at the
same point in a circuit!  The load determines the relationship between current
and voltage.

You probably want a circuit that has a programmable current limit,
but which is otherwise constant voltage (in other words one circuit
in which the normal constant voltage control is overridden by
a current limit as necessary.  In other words one circuit with two modes
of operation.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

calvingloster

Ok I think this could be the problem but I'm not sure, so if someone could please help me, I struggle to understand some high end technical electronic language so maybe please explain like you explaining to a child?

I do want 1 circuit with two modes like you say so do you get what I am trying to do now? How can I fix this? Must I incorporate high side switching as well?

calvingloster

In the last diagram I posted the left transistor is on and the right one is off

polymorph

Take MarkT's advice to heart, learn how to properly draw schematics. Often, just redrawing it will cause the fault to jump out at you.

http://opencircuitdesign.com/xcircuit/goodschem/goodschem.html

Your basic problem is that you are trying to switch the low side of the battery to select between sources that have a common ground (the 32V power supply). And PNP are absolutely the wrong transistors to use in a low side switch.

You have enough charger voltage headroom to simply connect the two CC and CV circuits in series. Put the constant current first, then constant voltage. Then you have a current limited, voltage limited charger. It will never put out more current than the setpoint, and never put out more voltage than the setpoint.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Go Up