• 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.

IR Circuit Help, WAS: Battery Power Supply Help

Status
Not open for further replies.

Gandledorf

New Member
I'm working with a circuit where I'd like to have a battery low charge indicator signal (to either drive an LED, or alert a uC of impending power problems so it can clean up, flash a warning and power off.

The problem is, I'm only an electronic hobbyist, and have only four credit hours (two labs, Analog and Digital) in EE. Most of my experience is CS. I simply have no clue how to design such a circuit. The biggest problem is that I have only a single power source (6V battery pack connected through a 5V regulator circuit) to work with... How do I compare this voltage? I'd like to be able to trigger when I start dropping below 5V, so I don't end up with a system powering down unexpectedly.

Additionally, if I want longer life for my system, would it be enough to build another 6V battery pack and connect them in parallel to the circuit?
 

Roff

Well-Known Member
You might want to look at Maxim's uP supervisors. I'm sure there are other mfr's that offer similar products. Maxim is known for being generous with samples. You could probably get help here if you need application assistance.

You could use a comparator and a voltage reference. The supervisors have those built in, along with some other functions (watchdog timer, etc.).

What kind of regulator are you using? If you are using a switcher, OK. If you have a linear regulator, six volts is not much headroom. In fact, you will need a low dropout type (LDO) if you want to use linear regulation, and even then it's marginal.
 

john1

Active Member
that CS,
makes your eyes sting,
and it gives you a sore throat.
 

Gandledorf

New Member
Ron H said:
You might want to look at Maxim's uP supervisors. I'm sure there are other mfr's that offer similar products. Maxim is known for being generous with samples. You could probably get help here if you need application assistance.

You could use a comparator and a voltage reference. The supervisors have those built in, along with some other functions (watchdog timer, etc.).

What kind of regulator are you using? If you are using a switcher, OK. If you have a linear regulator, six volts is not much headroom. In fact, you will need a low dropout type (LDO) if you want to use linear regulation, and even then it's marginal.
I think those supervisors are a bit more than I am looking for. From what you say, my design for my power supply is probably all wrong. I used to run something similar off of a 9V battery, but the regulator got red hot, so I figured I was wasting a tremendous amount of power. I've been using a 78M05, is this perhaps not the best choice?

My project needs basic 5V supply for my uC's and support chips (a lot of them are CMOS), and probably a separate supply used to generate a high intensity beam. I'd like the device to have a battery life of around 8 hours or more (continuous use).

Any suggestions on that? As for the battery charge indicator, I mainly want to alert the user, with something a simple as an LED, that the battery is low, and he ought to power down or risk running out while in operation.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
I think those supervisors are a bit more than I am looking for. From what you say, my design for my power supply is probably all wrong. I used to run something similar off of a 9V battery, but the regulator got red hot, so I figured I was wasting a tremendous amount of power. I've been using a 78M05, is this perhaps not the best choice?
You could use a comparator, using the output of the regulator for the reference voltage (as it's regulated) and the test input (via a potential divider) from the input side of the regulator. You want the low-battery warning before the regulator starts to lose regulation, probably easiest to do by having a preset as part of the potential divider and adjust it for the reading you want.

As for regulators getting hot, it all depends on how much current you draw off them, the amount of voltage dropped across them, and how large a heatsink you have them mounted on. It's as well to measure the current taken, and if it seems high, try and find where it's going - you may find it's mostly going to one particular section, which you may then be able to redesign to reduce demand.
 

Gandledorf

New Member
Thanks for all the help, I think I'm close to getting this nicked. I was looking through a book I picked up "Designing Embedded Hardware", by John Catsoulis (O'Reilly publishing), and I finished up the section on power sources.

Let me give out some details on my system, and maybe this will help matters. I expect there to be around 2-4 processors (still working out the details), a 16x2 LCD with backlight, and an IR emitter with a 1 Amp peak current.

According to the data I have on-hand, LM78XX's can source 1 Amp steady state, 2 Amps peak, but eat up 5-8mA of quiescent current. Good peak production, but bad for battery life. The book also recommends the MAX603, as it is a switching regulator, with no inductor needed (Maxim evidently builds it into the MAX603). The MAX603 also works over 2.7V - 11.5V, as opposed to 7V-25V. It also only uses less quiescent current. The only problem is, it sources a max of 500mA.

My question is this: First off, where does one buy a MAX603? jameco, mouser, futurlec, all seem to lack that part. Digi-key says it can be special ordered, but only in units of 100 (I need one). Second, if I were to use this, what would be the best way to get 1 Amp(ish) to my IR emitter? I really want to dump a lot to it, as a stronger beam should boost my range.

In any case, what is the best battery choice, for maximum of life of the system?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
Second, if I were to use this, what would be the best way to get 1 Amp(ish) to my IR emitter? I really want to dump a lot to it, as a stronger beam should boost my range.
Power to IR emitters is pulsed at a low mark space ratio - so it's on for very short periods, and off most of the time - you simply provide a large capacitor (470uF is commonly used) on the supply rail to the IR LED. This capacitor provides the large current pulses required by the IR LED, and charges back up in the space periods - if you look in any IR remote control you will find just one big electrolytic - incidently, a common fault is dry joints on this capacitor (through been dropped), which drastically reduces range and eventually stops it working all together (as the battery gets weaker).
 

Gandledorf

New Member
Nigel Goodwin said:
Gandledorf said:
Second, if I were to use this, what would be the best way to get 1 Amp(ish) to my IR emitter? I really want to dump a lot to it, as a stronger beam should boost my range.
Power to IR emitters is pulsed at a low mark space ratio - so it's on for very short periods, and off most of the time - you simply provide a large capacitor (470uF is commonly used) on the supply rail to the IR LED. This capacitor provides the large current pulses required by the IR LED, and charges back up in the space periods - if you look in any IR remote control you will find just one big electrolytic - incidently, a common fault is dry joints on this capacitor (through been dropped), which drastically reduces range and eventually stops it working all together (as the battery gets weaker).
Thank you so much, why I never thought of a capacitor, I have no idea. In the same vein, is there a way to determine how fast the capacitor will charge? My original idea was to have each IR pulse at a given frequency between 1KHz and 255KHz, in effect pulsing an address for others to hear, which they could then bandpass, and use a frequency counter to determine who it was who was talking to them. Will the capacitor charge up enough to sustain a more or less constant current of 1 Amp, oscillating at 1-255KHz?

I assume your suggestion would include a transistor, which would be attached to an output from the processor to control when the current would flow, correct?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
Thank you so much, why I never thought of a capacitor, I have no idea. In the same vein, is there a way to determine how fast the capacitor will charge? My original idea was to have each IR pulse at a given frequency between 1KHz and 255KHz, in effect pulsing an address for others to hear, which they could then bandpass, and use a frequency counter to determine who it was who was talking to them. Will the capacitor charge up enough to sustain a more or less constant current of 1 Amp, oscillating at 1-255KHz?

I assume your suggestion would include a transistor, which would be attached to an output from the processor to control when the current would flow, correct?
Yes, it would use a transistor - have a look at my IR tutorial at http://www.winpicprog.co.uk.

How IR remotes work (as described in my tutorial) is by sending out short pulses of 38KHz modulation, then a relatively long gap (giving time for the capacitor to charge back up) before the next pulse. You can buy (or salvage) simple IR receiver chips that do all the required work, and provide an inverted copy of the original pulses. The 38KHz is used to prevent interference, the receiver detects this to generate the output pulses.

Obviously, regardless of the size of capacitor, if you are continually transmitting 1A current pulses it's going to be taking a similar amount of current from the supply - if the mark/space ratio is 50/50 then it will draw about half an amp.

What actually are you trying to do? - you could easily send out individual device codes (see the Sony codes in the tutorial) to address different users, or to distinguish which user transmitted.
 

Gandledorf

New Member
Nigel Goodwin said:
Yes, it would use a transistor - have a look at my IR tutorial at http://www.winpicprog.co.uk.

How IR remotes work (as described in my tutorial) is by sending out short pulses of 38KHz modulation, then a relatively long gap (giving time for the capacitor to charge back up) before the next pulse. You can buy (or salvage) simple IR receiver chips that do all the required work, and provide an inverted copy of the original pulses. The 38KHz is used to prevent interference, the receiver detects this to generate the output pulses.

Obviously, regardless of the size of capacitor, if you are continually transmitting 1A current pulses it's going to be taking a similar amount of current from the supply - if the mark/space ratio is 50/50 then it will draw about half an amp.

What actually are you trying to do? - you could easily send out individual device codes (see the Sony codes in the tutorial) to address different users, or to distinguish which user transmitted.
I checked out your page, very nice setup! JOOC, why did you decide to go with the PIC over the AVR? After looking everything over, I picked the AVR for my system base because of their use of FLASH (most PIC's I've seen are EPROM or OTP), low price, and good price/performance ratio. Just curious.

Why did you choose a BC337 transistor? I'm fairly unfamiliar with actual use for transistors, I've only used them in a lab setting where the whole task was to find breakdown voltage, etc.

I'm actually working on two projects, the first is for some environmental monitoring equipment, we're going to have several IR probes sending signals underwater to a single detector. We want the detector to pick up the signal, figure out who it is listening to, and then calculate the percentage of transference of the signal.

The second project is one I'm doing as a kind of "all encompassing" learning project to bring my basic EE skills up. The basic idea, however, is building a home brew laser tag set with all the bells and whistles, LCD, multiple weapons, all kinds of options. I want to be able to identify shooters in a similar manner to the way in which I identify emitter probes in the environmental experiment.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
I checked out your page, very nice setup! JOOC, why did you decide to go with the PIC over the AVR? After looking everything over, I picked the AVR for my system base because of their use of FLASH (most PIC's I've seen are EPROM or OTP), low price, and good price/performance ratio. Just curious.

Why did you choose a BC337 transistor? I'm fairly unfamiliar with actual use for transistors, I've only used them in a lab setting where the whole task was to find breakdown voltage, etc.
My reason for using PIC's is pretty simple, I've been using them since before AVR's existed - and I don't see any point in changing :lol:

Interesting you picked AVR's for their FLASH capability - why?. In what way does that give you an advantage - aside from the fact that many 'so called' FLASH processors are/were in fact EEPROM. As far as I'm aware this applies to the early AVR's as well, FLASH was mainly a marketing ploy - which MicroChip also copied later on with some of their EEPROM chips. Now many processors are available with FLASH technology - any differences seem pretty slight, they might program slightly faster - mostly because you program them in blocks of bytes, rather than individual bytes.

The BC337 was chosen because I'd got one!, and it's handles a fairly high current for it's size - 800mA.
 

Gandledorf

New Member
Nigel Goodwin said:
My reason for using PIC's is pretty simple, I've been using them since before AVR's existed - and I don't see any point in changing :lol:
Good reason :wink:

Interesting you picked AVR's for their FLASH capability - why?. In what way does that give you an advantage - aside from the fact that many 'so called' FLASH processors are/were in fact EEPROM. As far as I'm aware this applies to the early AVR's as well, FLASH was mainly a marketing ploy - which MicroChip also copied later on with some of their EEPROM chips. Now many processors are available with FLASH technology - any differences seem pretty slight, they might program slightly faster - mostly because you program them in blocks of bytes, rather than individual bytes.
Mainly because I have had a hard time finding PIC's in anything other than EPROM or OTP. AVR's are all flash, and thus I can monkey around with the code easier. EPROM might as well be OTP for my purposes, I don't have an eraser. This was my primary reason for going with the AVR. It's just a nice side effect that (according to my reading) they are a bit more efficient.

The BC337 was chosen because I'd got one!, and it's handles a fairly high current for it's size - 800mA.
Is there a good reference sheet anywhere for selecting transistors based on the expected load? I have no clue how one would pick one at all.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
Mainly because I have had a hard time finding PIC's in anything other than EPROM or OTP. AVR's are all flash, and thus I can monkey around with the code easier. EPROM might as well be OTP for my purposes, I don't have an eraser. This was my primary reason for going with the AVR. It's just a nice side effect that (according to my reading) they are a bit more efficient.
I didn't say 'EPROM', I said 'EEPROM' - which is what most 'so called' FLASH devices actually were - the popular PIC was the 16C84 (which is how I got started), it was later replaced by the 16F84 ('F' to make you think it was FLASH - thank you marketing department!), this itself has since been replaced by the 16F628 (still EEPROM). I've always presumed that AVR's were based on the idea of the 16C84 (but with a totally different processor of course), the 16C84 was doing it years before AVR's.

Is there a good reference sheet anywhere for selecting transistors based on the expected load? I have no clue how one would pick one at all.
I use 'Towers International Transistor Selector', a fairly expensive book - but well worth having - it gives data on many thousands of transitors.
 

Gandledorf

New Member
Nigel Goodwin said:
I didn't say 'EPROM', I said 'EEPROM' - which is what most 'so called' FLASH devices actually were - the popular PIC was the 16C84 (which is how I got started), it was later replaced by the 16F84 ('F' to make you think it was FLASH - thank you marketing department!), this itself has since been replaced by the 16F628 (still EEPROM). I've always presumed that AVR's were based on the idea of the 16C84 (but with a totally different processor of course), the 16C84 was doing it years before AVR's.
I understood that, I just have had a hard time finding PIC's which have FLASH memory, and when I do find them, they are typically more expensive than an AVR.

Back on the subject of battery power, I now think I'm good on firing an IR LED using the capacitor, and I suppose I can always use PWM to ensure the capacitor doesn't get drained during a prolonged firing, my other question I had asked is this:

What is the best way to get long life out of my batteries then? I'm switching from a linear to a switching regulator, as per your advice, and if I understand drop-out voltage, under the new regulator I can now get [email protected] all the way down to 0.15V charge from the batteries (as opposed to tossing a 9V when it hits 6V on a linear regulator).

Would I get better performance using a 9V, or a set of AA's tied together as a 6V source (or a 9V source). In addition, if I then connect up several 6/9V battery packs in parallel to my regulator, am I correct in assuming that this will give me more mAh, but the same 6V source?
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
What is the best way to get long life out of my batteries then? I'm switching from a linear to a switching regulator, as per your advice, and if I understand drop-out voltage, under the new regulator I can now get [email protected] all the way down to 0.15V charge from the batteries (as opposed to tossing a 9V when it hits 6V on a linear regulator).
No, see previous thread - it would only work down to 5.15V, which is a pretty good result.

Would I get better performance using a 9V, or a set of AA's tied together as a 6V source (or a 9V source). In addition, if I then connect up several 6/9V battery packs in parallel to my regulator, am I correct in assuming that this will give me more mAh, but the same 6V source?
9V's worth of AA's would give much better life than a PP3 9V battery, the trick for long life is to only transmit occasionally - if you transmit permanently and it takes 1A, dropping to transmitting 10% of the time would increase your battery life by more than 10 times (battery life isn't linear, it's shorter at higher currents).

If you study the Sony SIRC's system in my tutorials, you will see that they only send the code every 45mS, and the code itself consists of bursts of 2.4mS, 1.6mS or 0.6mS - with 0.6mS gaps inbetween. Also, there's no need to make the modulation itself (38KHz) 50/50 - if you make it 25/75 it's still 38KHz, but only using half the power. So even when you hold the 'Volume Up' key on a Sony remote it's only transmitting a small part of the time.

For your application there's probably no need to transmit even that often, there's probably an optimum point - which you could either work out, or find experimentally.
 

Gandledorf

New Member
Nigel Goodwin said:
9V's worth of AA's would give much better life than a PP3 9V battery, the trick for long life is to only transmit occasionally - if you transmit permanently and it takes 1A, dropping to transmitting 10% of the time would increase your battery life by more than 10 times (battery life isn't linear, it's shorter at higher currents).

If you study the Sony SIRC's system in my tutorials, you will see that they only send the code every 45mS, and the code itself consists of bursts of 2.4mS, 1.6mS or 0.6mS - with 0.6mS gaps inbetween. Also, there's no need to make the modulation itself (38KHz) 50/50 - if you make it 25/75 it's still 38KHz, but only using half the power. So even when you hold the 'Volume Up' key on a Sony remote it's only transmitting a small part of the time.

For your application there's probably no need to transmit even that often, there's probably an optimum point - which you could either work out, or find experimentally.
Would this be the correct hookup for the IR circuit? I'm a little confused as to where the transistor ought to be.



For the battery, would the parallel packs help at all? I'm planning on cutting down the width of each pulse to save on energy, but I am also supplying power to a number of other components, and would love the option of an extended life battery pack.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
Would this be the correct hookup for the IR circuit? I'm a little confused as to where the transistor ought to be.
No, it should be like the diagram in my tutorial - this looks a little strange with the two IR LED's with the resistor inbetween them, but I drew it like that because it was how I actually constructed it. It doesn't matter if you use one or two LED's, or where the resistor is - as long as they are all in the collector - notice C2 as well, a 470uF.

For the battery, would the parallel packs help at all? I'm planning on cutting down the width of each pulse to save on energy, but I am also supplying power to a number of other components, and would love the option of an extended life battery pack.
I would advise using bigger cells rather than paralleling them, but for a start I should do everything you can to minimise consumption and see how long they last.
 

Gandledorf

New Member
Nigel Goodwin said:
No, it should be like the diagram in my tutorial - this looks a little strange with the two IR LED's with the resistor inbetween them, but I drew it like that because it was how I actually constructed it. It doesn't matter if you use one or two LED's, or where the resistor is - as long as they are all in the collector - notice C2 as well, a 470uF.
Here is my modified circuit:



I wasn't sure what R3 and R4 were for, so I didn't include them, are the needed? What function do they provide? I'm assuming R3 is a current limiting resistor to the base of the transistor, but R4, I haven't a clue, nor why one would need a current limiting resistor on R3, as the base ought to be at low current, due to the fact that a uC can source < 20mA.[/img]
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Gandledorf said:
I wasn't sure what R3 and R4 were for, so I didn't include them, are the needed? What function do they provide? I'm assuming R3 is a current limiting resistor to the base of the transistor, but R4, I haven't a clue, nor why one would need a current limiting resistor on R3, as the base ought to be at low current, due to the fact that a uC can source < 20mA.[/img]
That's looking better! - R3 is advisable, as you say it's a current limiting resistor - the BE junction of a silicon transistor can't go higher than about 0.7V (it's a silicon junction, just like a forward biased diode) - so without R3 it 'shorts' the output pin down to 0.7V above ground. R4 is simply good practice, it's not always needed, but helps to ensure the transistor turns off if the output pin doesn't go all the way to zero volts.
 

Gandledorf

New Member
Nigel Goodwin said:
Gandledorf said:
I wasn't sure what R3 and R4 were for, so I didn't include them, are the needed? What function do they provide? I'm assuming R3 is a current limiting resistor to the base of the transistor, but R4, I haven't a clue, nor why one would need a current limiting resistor on R3, as the base ought to be at low current, due to the fact that a uC can source < 20mA.[/img]
That's looking better! - R3 is advisable, as you say it's a current limiting resistor - the BE junction of a silicon transistor can't go higher than about 0.7V (it's a silicon junction, just like a forward biased diode) - so without R3 it 'shorts' the output pin down to 0.7V above ground. R4 is simply good practice, it's not always needed, but helps to ensure the transistor turns off if the output pin doesn't go all the way to zero volts.
Gotcha, here is my new circuit:



One last question... shouldn't I have a diode between Vreg and the capacitor, to keep it from discharging into the rest of my circuit, 1A would toast my uC's...
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top