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.

MCU Night switch?

Status
Not open for further replies.

HarveyH42

Banned
Had another project idea (not my final year...). It's a solar powered garden light. I've got several variations in might, but what got me started on this line of thought was a spotlight.

Basically, was thinking a small solar panel could charge a NiCad battery pack (3.6 or 4.8 volts, have some 6 volt/50ma panels), through a diode. I could use the ADC to measure the solar panel's output (before the diode, so I'm not testing the battery) to sense darkness, then turn on some LEDs. Brown out detector on the MCU would shut it down when the batteries get low.

New to MCUs, and haven't messed with the ADC or brown-out detection, so not entirely sure this scheme will work. Going to use an ATtiny13v, which will work down to 1.8 volts. Believe the LEDs are 3.7 volts 20mA, white 15 degrees, 80,000 mcd (yeah bright).

Anyway, if this works out, can do simulated firelight, RGB, chasers, pulsers, and well any other LED effect I can dream up (fertile imagination...).

So, any pointers or directions on the ADC and Brown-out? The data sheet makes it sound so simple, but...
 
I certainly wouldn't use a microcontroller for this unless you want to do something complex like an RGB colour changer, even so you don't need anything as complex as a brown out detector to turn the LEDs on when the voltage drops below a certain point.

A simply Schmitt trigger will do the job, all you need to do is replace the thermistor with a suitably sized zener diode, set up the potential divider and replace the relay with the LED and current limiting resistor, or easier still build one with an LM311 comparator.
thermostat-gif.11101


Or simpler still, use a simple common emitter buffer for the LED and connect the base to the solar sell side of the diode via a suitably sized resistor.
 
Brown out detector on the MCU would shut it down when the batteries get low.
Not familiar with the Amtel ATtiny13v, but usually the brownout reset circuit will reset the MCU which usually places all the IO's in a high impedance state. You need to design your cicuit to take this into account. The other problem with brownout reset circuits is that you usually have limited control over what voltages turn it on and off. The main problem with using a brownout reset circuit is that your MCU may cycle on/off in a random fashion when the battery is nearly dead, due to the brownout reset circuit not having enough hysteresis. You may have to design your own brownout reset circuit.
 
Hero, please re-read first post, think you read it too quickly the first time.

If I read the datasheet correctly, the brown-out should put everything to sleep until the voltage increases past the threshold (fuse selectable), then restarts the MCU. Even if it doesn't work or isn't usable, the worse thing that could happen is the batteries get drain, and the MCU will power-up when at sunrise.

The more I read about the ADC, I get confused. Seems to be more geared toward a signal, rather than a DC voltage. Wonder if there is something on chip to just let me read a DC voltage.
 
Seems to be more geared toward a signal, rather than a DC voltage.
You should have no problem reading a DC voltage with your ADC. The reason you probably see more references to reading AC signals with the ADC is because it is more complicated with the issues of sampling rates, lowpass filters, etc.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top