Continue to Site

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.

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

Nightlight

Status
Not open for further replies.

Rescyou

New Member
What would you guys suggest for the most power saving/efficient way to have the pic start a routine when it gets dark out? I can do it now with a CDS cell and a transistor, but am basically wondering what is the most efficent way to accomplish this task, and by efficient I mean a method which draws the least amount of current to get the needed result.

Resc.
 
Rescyou said:
What would you guys suggest for the most power saving/efficient way to have the pic start a routine when it gets dark out? I can do it now with a CDS cell and a transistor, but am basically wondering what is the most efficent way to accomplish this task, and by efficient I mean a method which draws the least amount of current to get the needed result.

Resc.

Use the LDR to charge a capacitor, and simply time it's charging time - to avoid any temperature change problems (and make life easier), rather than using the returned value - use a preset to charge the same capacitor, and compare that value to the one from the LDR. When the LDR value becomes greater than the preset value, turn the nightlight on.

To minimize consumption, put the PIC to sleep, use the WDT to wake it up and check the readings at regular intervals.

This scheme was used in a design in EPE the other year, using a thermistor for a freezer alarm - the PIC used was a 12C508, small 8 pin one. This simple A2D charging scheme, including comparing the value for a threshold, is also available on one of MicroChip's application notes.
 
re:

I was thinking that may be the way to go, thanks for the confirmation. I've figured out a better pwm scheme using interupts that gives me a full scale of pwm at near 10 bit resolution (getting a range of 0-800 instead of the usual 0-255) in up to 12 output lines on a 16f84a @20mhz each running without flicker from 0-5vdc and have made up a bunch of RGB led nightlights and was messing with a battery operated type system.

Resc.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top