long low-power timing with 14m not using adc0 (like 10 min)

hobgoblin

New Member
I'm making a remote tank level meter with a 14M and am using the 5 ADC inputs already (4 for the levels and 1 for battery voltage sense)
I'm trying to get it to wake up every 10-20 min and take a reading and send it to the wireless module and need to know how to generate this long a delay without the hibernate command as this uses a ADC pin that I don't have. also the lower the current consumption during this the better as it is running of a low standby current regulator (1.5uA!!!!) and low self discharge battery.

edit: i just realized that only the 28X1 and 40X1 can use the hibernate command, even so i still have my problem.
 
Last edited:

hobgoblin

New Member
no code yet

I haven't written the code as yet ,its still an idea but the code on the transmitter would go something like this:

'***re-configure pins to make all ADC pins available*** (easy to do but cant be bothered looking it up yet)

symbol sensor1= 'adc pin of sensor 1
symbol sensor2= 'adc pin of sensor 2
symbol sensor3= 'adc pin of sensor 3
symbol sensor4= 'adc pin of sensor 4
symbol battpin= 'adc pin of battery (connected via a voltage divider)
symbol txpin= 'pin the TX module is connected to

do
readadc sensor1,b0
readadc sensor2,b1
readadc sensor3,b2
readadc sensor4,b3
readadc battpin,b4
sertxd txpin,N1200,(85,85,85,85,"DATA",b0,b1,b2,b3,b4) 'need to add a checksum at some stage

'***delay of some sort for 10-20min***

loop


(there are probably some syntax errors in this but you get the idea)

the receiver would then receive this data and, depending on how it is calibrated will determine if the value for each sensor means it is under water, if it is then it will light the appropriate led is a column of four. If a button is pressed it will then display the battery voltage on the leds.
i should also mention that the sensors each contain a NPN transistor and 2 resistors and are soldered onto the end of the wire with the probe (gold plated header pins)
 

hobgoblin

New Member
when you say

"Enablebod (M2.60)"

do you mean disablebod to lower the current consumption??
and what does the "(M2,60)" mean? (probably reeeeely obvious but its late and im not thinking so well!!)
 

Dippy

Moderator
Why not just diasble unwanted peripherals as said by Ec and then put it to sleep?

Just keep in mind that Sleep timing is not very accurate. Is that a problem?

If you want to now the consumption of specific PIC peripherals then you'll vahe to read the Microchip Data Sheet for the specific PIC.

And, of course, the rest of your circuit will have been optimised too I assume?
If you want assistance/suggestions then post a GOOD drawing/schematic.


"Enablebod (M2.60)"

I'd put a fiver on it meaning "Manual 2 , page 60".
 
Last edited:

hobgoblin

New Member
im planning to switch the TX module and sensors (via a transistor) off after each cycle (oops let that out of the code) and im planning to use a MAX1724EZK50+T (element14 part no. 1673192) and 2 AA cells to power it. hopefully this should give it a long battery life.
"Manual 2 , page 60" Sooooooooo obvious as i said, im tired
 
Last edited:

hobgoblin

New Member
so the code now looks something like this????


'***re-configure pins to make all ADC pins available*** (easy to do but cant be bothered looking it up yet)

symbol sensor1= 'adc pin of sensor 1
symbol sensor2= 'adc pin of sensor 2
symbol sensor3= 'adc pin of sensor 3
symbol sensor4= 'adc pin of sensor 4
symbol battpin= 'adc pin of battery (connected via a voltage divider)
symbol txpin= 'pin the TX module is connected to
symbol enableperipheralspin ='pin the transistor for the sensor and TX is connected to

do
high enableperipheralspin
pause 5 'wait for the regulator to stabilise
readadc sensor1,b0
readadc sensor2,b1
readadc sensor3,b2
readadc sensor4,b3
readadc battpin,b4
sertxd txpin,N1200,(85,85,85,85,"DATA",b0,b1,b2,b3,b4) 'need to add a checksum at some stage
sleep 391 'about 15 min
loop

one other question if i was to slow down the picaxe while it was sleeping (and put it back to 4MHz while sending) , how much power would i save and how low can i go but still keep it reliable. ( the http://www.picaxeforum.co.uk/showthr...light=clocking thread doesn't say this)
 

Dippy

Moderator
When a PICaxe is put to Sleep the main clock oscillator is shut down.
You don't need to worry about that.

I would strongly suggest that you go to the Microchip site and get the PIC data sheet and read up on this and also it will show you a table of consumption for the PIC peripherals.

One of the many things I don't know about PIC firmware is if it switches the ADC peripheral on and off.
If it doesn't then a Poke may be required.
 

hippy

Ex-Staff (retired)
Calculating how much power you save can be tricky; but a rule of thumb is that if it sleeps for 900ms and 'does something' for say 100ms you'd be saving 90%, or looking at it another way, (900ms+100ms)/100ms = 10, you'd get 10 times more life out of it.

An accurate measurement can only come knowing what current is drawn and seeing exactly what code you are using.

How low you can go is up to you, you could sleep for a day rather than 15 minutes which will extend its lifetime, or reduce the WAIT time so it's awake for a shorter period. I'm not sure how you mean about "still keep it reliable", what would be considered unreliable ?

The best approach is to get the code working without worrying about power consumption then replace the simple PAUSE you will probably have with the code for entering low power mode, sleeping and restoring full-speed operation.
 

Dippy

Moderator
Think of it as a power 'duty cycle'.
Getting an estimate should be realisable.

Don't expect accuracy as there are a number variables possible beyond your control (e.g. ambient temp) - and some within your control. i.e. don't buy Anonymous (probably Chinese-made) lightweight batteries.

Time for you to do a bit of work now....
 
Top