sleep watchdog battery

27,703

Circuit Image

This example demonstrates the utilization of the Watchdog and Sleep functions provided by the ATMEGA 168 microcontroller. These functions are beneficial for developing low-power devices powered by batteries or solar energy. Reduced power consumption is achieved through intermittent operation of the system. In the case of Arduino, the main loop executes once before the system enters sleep mode. After a few seconds, the watchdog timer wakes the system, allowing the main loop to execute again. The ratio between the main loop execution time and the watchdog timer duration determines the power savings. For instance, if measuring a sensor and making decisions takes 10 milliseconds and the watchdog is set to 8 seconds, the on/off ratio is 800, which extends battery life by this factor. To evaluate how long the device can operate with standard alkaline AA cells, it is noted that these cells, even the less expensive ones, provide between 2000 and 3000 milliamp-hours (mAh). Assuming the system consumes 20 mA during operation and 0.05 mA during sleep, a demonstration device was constructed to measure daylight and activate a sound when night falls. The Arduino hardware is not used in this instance because the USB chip and voltage regulator consume too much power in sleep mode. Instead, a small circuit is built around a 28-pin DIL socket, where the ATMEGA chip from the original Arduino board is inserted after uploading the code. It is recommended to purchase blank ATMEGA 168 PU-20 chips and burn a bootloader onto them instead of repurposing the Arduino board's ATMEGA chip. An AVRISP-MKII programmer (which is relatively inexpensive) and a 9-volt DC power supply are required to operate the Arduino board without USB. Care should be taken when extracting the chips to avoid bending the IC pins, and a screwdriver can be a helpful tool for this task.

The ATMEGA 168 microcontroller is a versatile component widely used in embedded systems, particularly in low-power applications. The implementation of the Watchdog timer allows the system to reset itself in case of unexpected behavior, ensuring reliability in operation. The Sleep function significantly reduces power consumption by putting the microcontroller into a low-power state when the system is inactive.

In designing the device, the choice of components is crucial. The circuit around the 28-pin DIL socket should include a proper power supply circuit to ensure stable operation. Additionally, the sensor used to measure daylight should be selected based on sensitivity and power requirements. The sound activation mechanism can be achieved using a low-power audio output device, ensuring minimal current draw during operation.

For power management, the use of alkaline AA cells is practical, given their availability and capacity. The calculations for power consumption should be verified to ensure that the device operates within the expected parameters. It is advisable to implement additional features such as a power indicator or low battery alert to enhance user experience.

While programming the ATMEGA 168, care must be taken to ensure that the bootloader is correctly burned onto the chip, allowing for future updates and modifications to the firmware. The AVRISP-MKII programmer is a reliable tool for this purpose, and its use will enable efficient development and testing of the device.

Overall, the integration of the Watchdog and Sleep functions in conjunction with careful component selection and power management strategies will lead to the successful development of a low-power, efficient device capable of performing its intended function effectively.This example shows how to make use of the Watchdog and Sleep functions provided by the ATMEGA 168 chip. These functions are useful if you want to build low power consuming devices operated by battery or solar power.

The reduced power consumption is achieved by through a intermittent operation of the system. In case of Arduino your main loop will be executed once before the system is put into the sleep mode. After a few seconds t the watchdog wakes the system up and the main loop is executed again. The ratio between main loop execution time and watchdog time determines the amount of power that will be saved. When we assume that the time to measure a sensor and making some decisions will take 10 millisecond and the watchdog is set to 8 seconds the on/off ratio is 800 which extends the battery live time by this factor.

Now we want to know long we can operate our device with standard alkaline AA Cells. These Cells even the cheap ones provide between 2000 ad 3000 milliamps per hour (mAh). We assume our system takes 20 mA when operating and 0. 05 mA when sleeping. To demonstrate the watchdog and sleep functions we build a little device that measures the daylight and activates a sound when nigthfalls. We wont use the Arduino hardware here because the USB chip and voltage regulator takes too much power in the sleep mode.

So we solder a little circuit around a 28 pole DIL Socket where we insert the atmega chip from the original arduino board after uploading the code. Instead of raping the arduino board its atmega chip we recommend to buy some blank atmega 168 pu-20 chips and burn a bootloader to them.

What you need is a AVRIPS-MKII programmer (not so expensive) and a 9 Volt dc power supply to run the arduino board without usb. When you extract the chips be careful not to bend the IC pins a screwdriver is a helpful tool for this job.

🔗 External reference




Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713

Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713