background preloader

Sleeping Arduino - Part 5 Wake Up Via The Watchdog Timer

Sleeping Arduino - Part 5 Wake Up Via The Watchdog Timer
OverviewWelcome to the fifth and final part of the "Sleeping Arduino" series, where we will cover how to wake the Arduino from sleep mode using the Watchdog Timer (WDT). When waking your Arduino from sleep, you could use one of the standard internal timers of an Arduino as I have detailed in Part 4, but if you are looking for the maximum sleep time and/or minimum sleep power consumption, you have the use the WDT;As I have mentioned in this table, the WDT can give us a sleep time of 8 seconds, whereas the 'longest' 8/18bit timer will only give us a sleep time of ~4 seconds.Watchdog Timer (WDT)The Watchdog Timer on the Arduino's microprocessor only has one source to drive it: it's own separate internal 128kHz oscillator (as opposed to the 8/16bit internal timers, which can use either the 16Mhz system clock or an external clock). The WDT also has a prescaler, which is used to configure the timeout period. Please refer to my post here for the other operation modes of the WDT. Related:  ARDUINORéduction consommationBattery etc

» Home automation » JeeLabs After two new output plugs, here’s one for input – a dual Opto-coupler: The idea is simple: feed it 5..50 mA of the proper polarity, and the other side can be read out by a JeeNode without any electrical contact. As the name says: light is used to remove the need for a galvanic connection. This can be used for more than just high voltages: there are many cases where two different low-voltage circuits have independent ground levels, and where you want to keep it that way. Electricity always takes the path of least resistance (literally!) A simple example is when you’re dealing with two power sources, and hook them up – accidentally or on purpose. As with the Relay Plug, I’ll mention that you can use this Opto-coupler Plug to sense AC mains voltages (well not directly… more on that in a moment). The terminals on this plug are also detachable, but smaller: they use a 3.5 mm pin separation, and can handle a bit less current. So what can you use as input source with this Opto-coupler Plug?

Sleep Modes on ATTiny85 When using microcontroller in battery-based applications we really need to look at current consumption. This will affect the power consumption and hence the lifetime of the device. This post shows some tests I performed to try and reduce the current consumption of an ATtiny85 AVR microcontroller using sleep modes and switching off various aspects of the IC when they are not required. The test results and code for th Arudino IDE is shown here. I needed a test circuit to check both the correct functioning of the different inputs and outputs and also for comparison of the current consumed when using different power modes. My test circuit comprised of: Software serial output every 1 second on pin 2 (Arudino 3)Fast PWM 32kHz output at 50% duty on pin 5 (Arduino 0)On/Off 0.5s output on pin 6 (Arduino 1)Analog read every 1 second on pin 7 (Arduino A1)FET output being driven at 32kHz (Fast PWM) at 50% duty (but NO load) on pin 3 (Arduino 4) I wanted all of this to function at all times. Yey!

AVR Tutorial - Fuses AVR TutorialFuses Fuses are an extremely important part programming a chip, but are rarely explained thoroughly. You only need to set them once, but if you don't do it right, it's a disaster! Comments? Suggestions? You know about flash, eeprom and RAM as parts of the chip. The fuses are documented in the datasheets, but the best way to examine the fuses is to look at a fuse calculator such as the avr fuse calculator from the palmavr project Click on that link in a new window and select ATtiny2313 for the fuse calculations We'll use the Quick Configuration so use those menus, not the checkboxes The first option is how the chip is clocked. The Clock Source can be either of the following: External Clock, Internal 8MHz clock, Internal 4MHz clock, Internal 128KHz clock, External Crystal (0.4-0.9 MHz), External Crystal (0.9MHz - 3.0MHz), External Crystal (3.0MHz - 8.0MHz) or External Crystal (8.0MHz +) External Clock means that a square wave is being input into the CLOCK-IN pin. text

<avr/power.h>: Power Reduction Management Homeduino : E/S pour la Domotique via Box Bonjour à tous, Alors je vais vous présenter l'un de mes petit projet.Il n'est pas très compliqué mais je suis sûr qu'il pourra servir à certain. Préambule :Je remercie avant tout, tous les personnes qui ont pu contribuer à l'avancement de mes projets. Je pense particulièrement à Skywodd pour son blog ( très riche . Description :Donc mon projet est relativement simple. J'ai donc une box domotique (Zibase) avec laquelle je commande ou lis mon arduino via des commandes http. Dans mon cas présent j'ai installé des spots sur tout le tour de la maison [en cours pas fini l'avant]. La commande indépendante des spots me permet de faire des chenillard extérieur !!! Par rapport à la situation géographique de l'installation, j'en profite pour mesurer la température du ballon d'eau chaude de la chaudière fuel. Je ne suis pas développeur. C'est d'ailleurs aussi ça qui est important dans le partage donnant/donnant.

Test comparatif de la consommation électrique à vide de diverses cartes Arduino et compatible | Carnet du maker - L'esprit Do It Yourself par skywodd | | Licence (voir pied de page) Catégories : Tests Dossiers | Mots clefs : Arduino Genuino Consommation électrique Comparatif Cet article a été modifié pour la dernière fois le Dans ce dossier, nous allons mettre sur le banc de test une trentaine de cartes Arduino officielles et compatibles pour voir quelles cartes consomment le plus et le moins de courant à vide. Il sera ainsi possible de déterminer les cartes parmi celles testées qui seront les plus adaptées pour une utilisation dans des montages fonctionnant sur batterie. Sommaire Bonjour à toutes et à tous ! Il y a quelques semaines, un lecteur m'a contacté pour me demander des conseils par rapport à son montage à base d'Arduino. Son montage était en soit tout ce qu'il y a de plus classique : des capteurs, un module radio, une carte Arduino et une petite batterie 9 volts pour rendre le tout autonome. Quand on réalise un montage sur batterie, chaque milliampère consommé réduit l'autonomie finale du montage. N.B. N.B. N.B.

AVR Fuse Calculator for ATmega328P This is a javascript based AVR fuse calculator. You must have javascript enabled to use this. There are lots of places with mouse-over text (alt-text) to provide some help. You can select a AVR chip from the dropdown menu at the top of the page. When you select another chip, the fuse settings from the current chip will be applied to the new chip (even if the chips are not similar). Presets are known defined settings available for the AVR chip you've selected. Manually manipulating the fuse bits will also cause the calculator to find the preset that matches the fuse bit setting. Be extra careful about anything with a star *, the star * means the setting is related to ISP programming. The AVRDUDE commands may be used as arguments with AVRDUDE to program the fuses. Some bits that are undefined may not be verified as correct, but as they are undefined, that's usually not a problem. Make sure you don't mess up your chip by disabling the programming features or locking the chip completely.

Low power ATmega/tiny with watchdog timer At work recently, the pranks have been escalating. I’ve decided that for my next salvo, I’m going to build the most annoying beeping device I can. I’m using an ATtiny45/85 chip, programmed using the Arduino development environment. The clone army grows The device is intended to be planted somewhere near the target’s desk, and will just beep (or make some other annoying sound), every 5-8 minutes. Three primary factors influenced the design of this, in this order: Low power consumptionInexpensiveSmall size It’s likely to take the subject days, if not weeks, to find it at that rate, so the battery needs to last for at least a few weeks. As I intend to make around 10 of these devices, keeping the cost down was important. Making this as small as possible was quite a challenge, but in the end, the largest parts were the battery and battery holder. Putting the chip to sleep when it’s idle. 1. Putting the chip to sleep is pretty easy: But then you need some way to wake it up. 2. 3. 4.

[Arduino] Lecteur RFID à écran lcd, avec stockage du tag « valide  en EEPROM externe I2C | «Skyduino - Le DIY à la française Bonjour tous le monde ! Aujourd’hui je vous ai préparé un petit « projet tutoriel » bien sympa ! /! Ce projet est simple, j’ai une porte (ok j’ai pas vraiment de porte, je vais la simuler via deux led, mais imaginons que j’ai vraiment une porte) avec une gâchette électrique. Le but : Mon but est « d’arduinoniser » la porte avec un systéme de tag RFID. Le matos :- Une carte arduino UNO, - Un écran SerLCD de sparkfun, - Un lecteur RFID série de parallax (+ au moins 2 tag RFID (merci captain obvious)), - Une protoboard V2 + 2 led (avec résistances de 330ohms) + 1 bouton poussoir, - Un EEPROM I2C 24LC16 (+ résistances de pull-up pour l'I2C). Le câblage : SerLCD / ArduinoVCC -> VCC RX -> D9 GND -> GND Lecteur RFID / ArduinoVCC -> VCC ENABLE -> D7 SOUT -> D3 GND -> GND EEPROM / Arduino VCC -> VCC SDA -> A4 (+ pull-up sur 5v) SCL -> A5 (+ pull-up sur 5v) GND -> GND A0, A1, A2, WP -> GND La vidéo de démonstration : Et bien sur le code :

Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors Summary In this thread I show various power-saving techniques for the Atmega328P processor. They include sleep modes, use of power-reduction registers, and other techniques. Applying all of them can result in a current draw as low as approximately 100 nano-amps (100 nA), well below the self-discharge rate of most batteries. Proof from the datasheet for the Atmega328P (page 405 of my copy): That is 100 nA at at 25°C running at 3v. These techniques would be useful for battery-powered devices where the full power of the processor was only required intermittently, for example a TV remote, calculator, doorbell, or some sort of environmental monitor where you only needed to check things from time to time. Introduction I am going to explore various power-saving options for running your project, presumably from battery power. These examples are specifically for the Atmega328P processor, but the techniques are pretty general. Summary of methods Baseline - Arduino Uno Sketch A Sketch B Bare-bones board.

Setting Arduino fuses manually in AVR Studio Here is a little tutorial about setting the fuses on a blank ATmega328P in AVR Studio so you can use it with Arduino IDE: You need: a board where you have a ISP connector for a hardware programmer a blank ATmega328P a hardware programmer a USB-serial cable (or just a USB cable if your board has the FTDI chip on board) Insert your blank chip in it's socket, careful at the orientation, make sure you insert it with the little D shaped indentation in the same direction as the socket indentation. Open AVR Studio, cancel the new project, click on the Connect button and a Select AVR programmer window will appear. Click on the "Device and signature bytes" and scroll down until you find the ATmega328P device and select it. Click on the Fuses tab, the programmer will read the fuses automatically and show them: Let's take them one by one, top to bottom: BODLEVEL - any Arduino chip has this disabled, but after some people having problems, I set this to 2.7V And this is with the BOD enabled: You're done!