On the latest boards, D13 goes to LM358 as a buffer to drive the LED, so there is effectively no load concern (and I think it was only ~0.5mA before that).
meee418:
Here is my total circuit, essentially what we're doing is comparing A0, A1 and A2 to A7 to get our total current/power output through there, then measuring A3 vs A5 and A4 vs A6 to get the actual current going into the battery. I assume based on what I have learned today that these PNP transistors won't really work for my purposes... but I would love to know if I am right in thinking that.
OK, I can't do this right now, but I'll have a deeper look. But at first sight, I think that you'll use Ax values and some calculations to switch on or off the transistors, individually ? If so, it could work, but the base resistor should be less than 1k (yes I know, I'm stubborn
) . Don't forget the 0.4V if you stay with 2907 (there are better switching transistors) . And maybe you could use mosfets transistors, depending on the current, it could be a better choice, some mosfets have a really low RDSon value ....
Actually I built the circuit with MOSFETs initially for that reason, but in the end I couldn't get the right MOSFET and had to make the circuit with some PNPs that I had lying around (because I never used them :D). I appreciate all your input, I am installing the circuit to the device tonight, then it is deployed for a week and taken back to have maintenance done. My idea is to find the right parts for this circuit, then modify the circuit next chance I get. Good to hear that this "might" work, that's actually great. Right now I've tested it and I get some values that roughly correlate to what I am expecting, but the PNPs do worry me a bit in terms of how they are put in the circuit.
Let me know when you can.
To everybody in this thread: Thank you so much for your time and consideration, you will definitely seem me attempting to help others as a result, words cannot do justice to the appreciation I have for what you are all doing.
I attached a modified drawing of the circuit, you were missing a single resistor between 6V and the collector. Also good to know about PNP being LOW to be "on" I've only ever worked with NPN and bought these by accident smiley-red. This resistor issue actually throws a lot of my project into question... much of it involves reading voltages across .3 ohm resistors. I am going to have lunch and then upload another question about PNP switching involving the rest of my circuit. Don't worry I'll draw it this time smiley-wink
Should we not be looking at a cct. like this?
the circuit you posted is a smaller part of the larger circuit, used only to gauge whether the battery should be charging or discharging. The circuit I just posted does not show the circuit from my initial question, but still involves PNP switching.
Ummm... quick answer... "no".
There is no reason to start doing that here since we have so far remained ground referenced on all parts of the circuit. The divider that feeds the analog pins needs to be part of a circuit that the pin can measure.
Sorry, I understand the confusion. All of the analog pins are actually voltage dividers between the points they reference and common ground. Pretty much everything is grounded where it should be. My main question is will these PNP transistors act as "switches" in a way more or less similar to relays. I realize that they are transistors and not relays.
Hi @ all.
Sorry for joining so late. From the first posting I think, that you want to measure the voltage of your batterie(s) which are around 6V nominal. To save the current of the voltage divider, you want to use two resistors of 1K each.
The problem with your circuit is, that the Arduino-pin goes up to approximately 5V only. Since your PNP-emitter is connected to 6V, the base gets some current (1V - 0.7V = 0.3V; 0.3V at 1K gives 0.3mA). Since your complete "load-current is about 2mA, a transistor with a B of 150 will turn on to some degree. So you can never turn it off.
To solve this, you can lower the emitter voltage by replacing the series-resistor with a Zener-diode of two to three volts. Since your "load-current" does not change very much, the voltage could be considered constant and inserted into your calculation.
I would prefer to take away the series resistor in the emitter and put a Zener in the base circuit. So the Arduino-pin has to go down further to turn on the PNP. To be sure, that the PNP turns off, you could add a 22K resistor (rule of thumb, maybe even more) between emitter and base.
hth,
Karl
karls0:
The problem with your circuit is, that the Arduino-pin goes up to approximately 5V only. Since your PNP-emitter is connected to 6V, the base gets some current (1V - 0.7V = 0.3V; 0.3V at 1K gives 0.3mA). Since your complete "load-current is about 2mA, a transistor with a B of 150 will turn on to some degree. So you can never turn it off.
oh, yes, I missed that ![]()
I'm afraid I'm a little rusted !
I'm afraid I'm a little rusted !
, me too! Solution three would be to use an additional NPN-transistor to pull down the base, when you want to measure. If you need a drawing, maybe I can do one on monday (I am not at my office-PC now).
Karl
Since the 6V supply that you are switching is greater than the 5V Arduino pin output, you should also connect a resistor between the base and emitter of the transistor. Make it the same value as the base resistor to get a margin of 1.2v, or half the value of the base resistor to get a margin of 1.8V. Get rid of the resistor in series with the emitter [EDIT: looks like you have already done that bit].
