What is the best method of achieving low power consumption while using irin?

I would like to run a battery-powered PicAxe with as little power as possible. As I understand it, running the clock as slowly as possible is one way to reduce power consumption. On the M2 parts, the clock can be set down to 31 kHz by using setfreq. However, I would like to have my PicAxe waiting for an IR signal to be read by the irin command, and it seems the irin command will cause the PicAxe to wait around for the IR signal while running its clock at 4 MHz, which would cause the chip to consume more power.

Is there some way to have the chip run at 31 kHz while waiting for some kind (or any kind) of IR signal, then when the PicAxe detects IR flashes, it jumps to a subroutine that activates an irin command (and thus runs at the required 4 MHz), reads the data, then sets itself back to 31 kHz until the next IR flash is detected? If so, what would be the best way to implement this? A separate phototransistor on a separate pin? Or can an IR detector module be used to do that somehow even with the PicAxe operating at 31 kHz?

Thanks.
 

hippy

Ex-Staff (retired)
Polling or interrupt should work. The IR receiver output goes low when IR is received so one can monitor for that, then execute an IRIN with timeout to get the command the next time it is sent. Most IR remotes send the same code multiple times.
 
Polling or interrupt should work. The IR receiver output goes low when IR is received so one can monitor for that, then execute an IRIN with timeout to get the command the next time it is sent. Most IR remotes send the same code multiple times.
eclectic, hippy, thank you.

Okay, so interrupts make sense, but I'm now thinking that using the IR decoder/sensors to trigger the interrupt might be a bad idea. While I could not find a data sheet for the specific part (LED020) that PicAxe sells, I found similar units elsewhere and they seem to consume about 2 to 3 mA of current. So I'm now guessing that a phototransistor type of circuit might be best for triggering the interrupt. Does a phototransistor circuit make sense? Any suggestions on what specific component might work best?

Thanks again.

:)
 

ljg

New Member
the only problem i see with using a phototransistor is that you lose the 38KHz modulation that the IR reciever provides. it would seem you would get many more false positives from the environment.
 
the only problem i see with using a phototransistor is that you lose the 38K modulation that the IR reciever provides. it would seem you would get many more false positives from the environment.
Larry, that's a good point. But are there phototransistors that have a built-in IR-filtered capability? And since the phototransistor would only trigger the interrupt that jumps and waits (via irin) for an actual coded IR signal from the IR detector/decoder, the program itself won't take any action unless it gets the proper code. So, you're right about random environmental signals triggering the interrupt, but I'm guessing (hoping) it wouldn't be too bad on the batteries. So far, I haven't been able to think of any other way to do this.
 

BeanieBots

Moderator
I'm inclined to agree with Larry.
The LED020 is essentially a phototransistor with IR filter 38kHz demodulator and amplifier built-in. Without the extra bits you will almost certainly get false triggers and probably very poor sensitivity.
Not sure how pushed you are for space but if you used three off AAA size recchargeable batteries at ~500mA even if you pulled 10mA you should still get a good two days of non-stop running.
 

Janne

Senior Member
How fast do you need to have the picaxe respond to the incoming ir signal? If you can wait for some time, a working scheme might be to power the IR receiver off a picaxe's output pin.
Then, if no ir-signal is coming in, turn off the ir receiver, sleep picaxe for some defined time say 2 seconds. After that, wake up, check for incoming signal, if nothing there, sleep again.
 
How fast do you need to have the picaxe respond to the incoming ir signal? If you can wait for some time, a working scheme might be to power the IR receiver off a picaxe's output pin.
Then, if no ir-signal is coming in, turn off the ir receiver, sleep picaxe for some defined time say 2 seconds. After that, wake up, check for incoming signal, if nothing there, sleep again.
Interesting! I never thought of powering the IR receiver off of a PicAxe pin. That's a great idea because, indeed, I don't need a very fast response time, so your idea might be the perfect solution. Thanks! :)
 

erco

Senior Member
There are dozens of different IR receiver modules; they all have sophisticated internal demodulators, filters and amplifiers, and most have AGC. Each one has very different electrical characteristics (60 hz filters, flourescent filters, sunlight filters, continuous signal, minimum operating voltage, etc) and current consumption. You have to check all the datasheets, or you could contact Vishay. For instance, a Vishay TSOP4838 uses 0.85 mA, and a TSOP38238 uses 0.35 mA. That's nothing. It's nearly impossible to create a phototransistor circuit using discrete components that offers anywhere near their high performance and operational reliability at such low currents.
 

AllyCat

Senior Member
Hi,

IMHO, it's time for a proper specification. How low is the required power consumption, e.g. very low power for 24/7 operation from a couple of primary cells? What IR range (and available transmitter power)? Are there any potential interfering sources (including daylight, sunlight, lamps, etc.)?

Methods I'd consider are: IR optical filter (to cut visible light); single transistor sensor, possibly with a separate low pass filter/integrator to a second ("wakeup") pin; PICaxe at ~k250 (each instruction at k31 takes ~100ms); avoid any "floating" digital input pins and of course switch off unnecessary hardware (e.g. brownout detector, etc.), either permanantly or run with a reduced duty cycle.

Cheers, Alan.
 
...

IMHO, it's time for a proper specification. ...
Hi Alan,

Good question. I would be running this unit off 3 AA batteries (I think), hoping to get as much battery life as possible, yet I don't really know what to expect because I've never used PicAxes before. To answer: I suppose the unit might need to be capable of responding 24/7, but there might be some room for solar power helping out. The IR range would be approximately 4 meters, but there would definitely be sunlight, streetlights, etc. that could potentially interfere once in a while. I greatly appreciate your tips on de-floating the input pins and killing the BOD. I guess, generally speaking, I'm trying to play PicAxe limbo on paper at this point and see just how low my current consumption requirements might be.

Thank you very much! :)
 

AllyCat

Senior Member
Hi,

A PICaxe runs easily (with care) below 1mA at 4MHz, so 100uA should be possible at k250 or even k500. k31 might get to 10uA if careful attention is paid to the base PIC data sheet and the hardware design, etc..

However, 4 metres range is quite large, particularly if you're considering an "outdoor" application. In particular the possible presence of sunlight will very probably necessitate good "optical" design (e.g. a collimator to exclude sunlight from the sensor) and detection of modulated signals (only).

BTW: I'm currently considering using an IR Phototransistor as a "sunshine" sensor. If direct sunlight strikes the chip the (reverse) diode leakage is around 10 mA, which means that the collector current would (try to) be over 1 AMP (but of course something would limit/fail first).

Cheers, Alan.
 

erco

Senior Member
I think the data sheet is talking about absolute max rating when it mentions 3 mA, not its typical operating current of 0.35 mA.
Yes, typ 0.35 mA spec at http://www.vishay.com/docs/81733/tsop382.pdf

Per http://www.electronics-base.com/index.php/general-description/ir-remote-control/137-sony-sirc-protocol , "Commands are repeated every 45ms(measured from start to start) for as long as the key on the remote control is held down." So using a low current sensor like that in conjunction with shutting the sensor down at regular intervals could really reduce average current demands.
 
...so 100uA should be possible at k250 or even k500. k31 might get to 10uA if careful attention is paid... I'm currently considering using an IR Phototransistor as a "sunshine" sensor. If direct sunlight strikes the chip the (reverse) diode leakage is around 10 mA, which means that the collector current would (try to) be over 1 AMP (but of course something would limit/fail first).
...
Great info! And, yes, I now see what you mean about the sun causing the phototransistor to peg out, which I suppose might take me back to erco's suggestion to use the low-powered IR receiver.... well.... unless there's some trick to using a phototransistor so only the change in its state draws any significant current???

Thanks for providing some important insights into this problem.
 

AllyCat

Senior Member
Hi,

Yes, a dedicated IR RC receiver looks to be a better choice, but don't overlook that it will also have an IR phototransistor at its input. It may have more sophisticated filter/control/feedback/detection circuits but they can't overcome a total overload (or temporary "blinding") of the sensor.

There is as much energy in the "IR" spectrum from the sun as there is in visible light (you can't see it, but can feel it on your skin). The IR used for RCs is very "near" to the visible band and the spectral response of the "IR" phototransistors is typically very similar to that of the sun. Take a look for example at the Wikipedia entry on Lux which shows that the outdoor light level can be 1,000 times larger than a typical room indoors.

Note that most (cheaper) digital cameras are actually sensitive to IR as well. Try directly viewing the LED of a transmitting Remote Control on its LCD screen, first indoors and then outdoors.

Cheers, Alan.
 
...

Yes, a dedicated IR RC receiver looks to be a better choice, but don't overlook that it will also have an IR phototransistor at its input. ....
Thanks to you and all the other fine people here, I now have much to ponder. I really appreciate the help you've given. Now I just need to think all of this over, buy a few parts, and try a few things.

First impression: there are some very smart people on this forum!
Thanks everyone. :cool:
 

erco

Senior Member
BTW: I'm currently considering using an IR Phototransistor as a "sunshine" sensor.
Alan: As long as you're sensing direct sunlight, did you consider a small solar cell? You could connect that directly to an input pin. Anything above 1.3V reads high to a PicAxe TTL input; below 1.3V reads low.
 

AllyCat

Senior Member
Hi erco.

Thanks for the suggestion, but yes I've had an assortment of "Solar Garden Lights" dismantled all over my "kitchen table" for some time. It looks to be a fascinating (and challenging) project to extract the maximum power from a PV panel using a PICaxe. They appear to have "interesting" I/V characteristics, if you consider all the other variables (light intensity and angle of incidence, colour and thermal temperatures, etc.).

However, the (other) project I have been considering is to determine specifically "Is the sun shining?" (at any time of day and year) in a much lower cost (but less precise) version of this Sun Recorder. A photodiode has a closer spectral response to the sun itself (than PV, which I believe is more towards the blue end of the spectrum) and the small chip size is better if diffusing or "imaging" light directly from the sun. Incidentally, the linked Sunrecorder started life a few years ago as a "low cost" hobby project on another forum, but you'll get a fright if you look at the selling price now (see Enquiry Form).

Cheers, Alan.
 
"...thermal temperatures..."

:)

I'm certainly no Einstein, and maybe I shouldn't speak for Alan, but he's probably making a reference to "colour temperature" as it pertains to the thermal, or IR, part of the spectrum. Light is sometimes considered to have a "temperature" as it relates to Wien's displacement law. I know it sounds a little idiosyncratic to some people, but such a use of the word "temperature" is not that unusual.

See for example the following:

http://en.wikipedia.org/wiki/Color_temperature

http://en.wikipedia.org/wiki/Wien's_displacement_law
 
Top