Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Resilient on February 01, 2012, 07:49:49 PM

Title: On/Off circuit based on voltage
Post by: Resilient on February 01, 2012, 07:49:49 PM
I am sure there are plenty of good examples of this, but I just don't know what to google for.

I want to be able to, when using solar power and a rechargeable battery, turn on a micro-controller and sensors when the battery gets to some voltage while charging, then turn it off when it gets below some other threshold.

The key requirement is that this on/off circuit draw as little power as possible when in the off state.

Could someone point me in the right direction?

Thanks
Title: Re: On/Off circuit based on voltage
Post by: Soeren on February 01, 2012, 09:29:41 PM
Hi,

I want to be able to, when using solar power and a rechargeable battery, turn on a micro-controller and sensors when the battery gets to some voltage while charging, then turn it off when it gets below some other threshold.

The key requirement is that this on/off circuit draw as little power as possible when in the off state.
Use the microcontrollers A/D-C port to sample the voltage and then let it sleep for whatever time you like, wake up, take a new sample and if it still don't have to go to work, let it snooze a bit more (just like when the alarm clock goes off in the morning :))

If you can only make it nap for a couple of seconds at a time and you want a longer sleep, just update a counter and count off however many times the nap-interval you want between measurements.

Another method could be to make a micro-power sampling comparator to wake up the micro when needed (it has to put itself to sleep when it gets the power down message though, unless you want it to go completely off). I don't think you can get it to use less current than a sample-nap-sample-nap micro though.

Modern micros use less than the self discharge current of primary cells when napping and some of the low power jobs can run at very low currents as well - As an example, the PIC family has got the XLP range and a random member of that range is the PIC16LF1827, with a sleep mode current of 30nA. Running the watchdog timer costs 500nA and the timer1 oscillator when clocked at 32kHz (for clock use or for power saving - it has a range from 31kHz to 32MHz) takes 600nA.

A regular 2Ah AA NiMH cell has got a self discharge of somewhere around 800µAh, so the drain of a low power micro won't be noticed at all.
Title: Re: On/Off circuit based on voltage
Post by: Resilient on February 02, 2012, 04:46:08 PM
I didn't realize that the micro-controller draws that little current while in sleep mode.

What about sensors which require current to operate? Say I had a IR sensor I wanted to turn off an on. Would I just use an NPN transistor and the micro-controller to turn the sensors on and off?

Thanks
Title: Re: On/Off circuit based on voltage
Post by: Soeren on February 03, 2012, 02:28:39 AM
Hi,

I didn't realize that the micro-controller draws that little current while in sleep mode.
The numbers I gave was for the low power range of PIC controllers, apart from the MSP430, which is also running on "thin air", I am not aware of what each controller family may have in the low power department, so you'll have to check that out if you use another controller.

Which controller are you working with?


What about sensors which require current to operate? Say I had a IR sensor I wanted to turn off an on. Would I just use an NPN transistor and the micro-controller to turn the sensors on and off?
That will depend on each of them and how they work, but IR sensors, where the LED(s) will be the major consumer(s), it could be done like...
Sharp PSD's: PNP to cut of V+ (keep a low resistance ground connection).
Simple non-modulated IR LED: Either line can be cut off.
Modulated LED: just set the modulating pin to input (and make sure the non-driven transistor is biased off.
The photo transistor used with the last two should be cut off as well.

It really has to be judged when the entire set-up is known, but in most cases, you would have the positive supply to all sensors controlled via a single pin. Make this supply line as stable and stiff as possible (caps at every sensor).

Not knowing your application, its purpose or construction, I'll point you towards super caps as a possible replacement for the rechargeable battery - for low power use, the cap can be more efficient (battery cells can only return around 2/3 of the power it took to charge it).
To throw some example numbers at it...
A microcontroller circuit with a working voltage range down to 1.8V and an average current of 25µA (for the entire circuit!), driven from a 1F super cap charged to 4V will run for more than 24 hours (with no further charging).
Title: Re: On/Off circuit based on voltage
Post by: Resilient on February 03, 2012, 01:57:07 PM
This gives me a good starting point.

I don't have a lot of specifics. I am currently taking a data visualization class and after seeing some of the interesting results they got looking at data over long periods of time I decided I wanted to make something so that I could make my own datasets.

I am just looking to make something I can leave out in my back yard or out in a field somewhere, come back in a few months and get data. Maybe it will be river temperature, barometric pressure or depth of leaves that I have yet to rake in my back yard.

Basically just a general purpose data-logger that I can leave for extended periods of time and hook various sensors to. I know it will change slightly based on sensors, but the more general I can keep it, the better.

Thanks again.
Title: Re: On/Off circuit based on voltage
Post by: Soeren on February 05, 2012, 08:43:14 PM
Hi,

I am just looking to make something I can leave out in my back yard or out in a field somewhere, come back in a few months and get data. Maybe it will be river temperature, barometric pressure or depth of leaves that I have yet to rake in my back yard.
A river in your back yard... Doesn't that just beg for a tiny water mill generator to back up the solar power? ;D

When planning out the logger, you need to consider what amount of samples you need and at what frequency you need them, to find out how much memory and which kind (EEPROM, Flash RAM or whatever) you need.


Basically just a general purpose data-logger that I can leave for extended periods of time and hook various sensors to. I know it will change slightly based on sensors, but the more general I can keep it, the better.
An option that might be worth exploring is to use an RTC (Real Time Clock) with an adjustable alarm output interval and let that power up the controller and sensors (which could then be completely off until it needs to take a sample (and then power off when done).
You probably need an RTC anyway, if the data you get relates in any way to the time of day.

The DS1307, that comes in a standard through hole 8 pin DIP, is very simple to use and while it haven't got a programmable alarm output, it has got a 1Hz output that could be used to wake up the controller once a second. The controller can then increment a counter and go to sleep (i.e. not power down completely) until it reaches a count of what your sample interval should be.

The DS1375 takes even less power and has got two very versatile alarms, which each can be programmed to whatever interval you need, but unfortunately it only comes in a very small package.

If you'd rather know the time an event happened (to save memory perhaps), the DS1678 would be a good choice (comes in 8 pin DIP).
Title: Re: On/Off circuit based on voltage
Post by: Resilient on February 15, 2012, 11:19:03 PM
Soon... I will get this project underway. I just need to finish a CnC router I am working on. Thanks a lot for the help. Also, I love the water mill idea. :)

Also, people from the future who come and visit this thread I found this guide on how to configure an AVR micro controller for low power.

http://www.sparkfun.com/tutorials/309 (http://www.sparkfun.com/tutorials/309)
Title: Re: On/Off circuit based on voltage
Post by: Soeren on February 16, 2012, 09:40:02 PM
Hi,

Also, people from the future who come and visit this thread [...]
People from the future??? :o ;D