9

I'm currently working on an Arduino project that sends the charge of my car battery once a day via an ESP8266 to me. During the winter I don't drive my car, and I would like to get informed when the battery drops beyond a critical value, so I can charge it and prevent damage.

So energy efficiency is important for the project, so it doesn't discharge the battery itself. I read a lot about sleep mode, efficient drop down regulators etc. These all have in common that the voltage regulator is always running, which is not what I want.

I'm looking for some kind of "swich-on-timer circuit". It should count down 24 hours and then turn on a relay or MOSFET, which connects the voltage regulator to power and with that turns on the Arduino and the ESP8266. When the Arduino has finished with the transmission, it resets the timer, which disconnects the voltage regulator from power, and so on. Of course, the timer circuit should use only very little power.

Does anybody know a circuit like that? I searched on AliExpress with all variations of words that came to my mind, without success. Or maybe an IC which can be used (easily) to create such a circuit?

  • 1
    Not all voltage regulators are the same. Some will only use a few micro-amps. – Gerben Nov 20 '16 at 14:45
  • Thinking out of the box... Won't a standard timer-switch suffice? – user31208 Oct 5 '17 at 13:10
5

One approach would be use of a DS3231 (Precision Real Time Clock) module. Such modules sell on Ebay for under $1. Search for ds3231 arduino.

Typically, these modules have a six-pin connector, with pins labeled 32K, SQW, SCL, SDA, VCC, and GND. As noted in DS3231 specs, the INT/SQW pin is used either for square-wave output or for interrupt output. On page 13 of specs, in the Control Register section, it says:

Bit 2: Interrupt Control (INTCN). This bit controls the INT/SQW signal. When the INTCN bit is set to logic 0, a square wave is output on the INT/SQW pin. When the INTCN bit is set to logic 1, then a match between the time-keeping registers and either of the alarm registers activates the INT/SQW output (if the alarm is also enabled).

Initially, you would run a sketch to set up the DS3231: turn on a daily alarm, enable an interrupt rather than square wave, set the current time, etc. Then, load an operational program that reads car-battery voltage each time it runs, and acts appropriately.

The DS3231 INT/SQW pin would be wired to the gate of a P-channel mosfet that switches 12V power to the Arduino. The P-fet would turn on when the alarm's open-drain output pin INT/SQW turns on. The operational program does its business and then clears the DS3231 interrupt flag, to shut down power until the next alarm occurs. (For debugging, set briefer intervals than a day; for example, once a minute, as described in Table 2, Alarm Mask Bits, on page 12 of specs.)

Typically, the DS3231 draws 0.84 μA when running from a 3.3V battery, or 1 μA from 5V. See Electrical Characteristics, page 3 of specs.

  • 1
    The P-fet gate probably should be pulled up to +12 through something like a 1 megohm resistor; else it would be effectively open when the INT/SQW pin is off, and could float to arbitrary levels – James Waldby - jwpat7 Nov 25 '16 at 17:35
3

The timer or timer-circuit itself would have to draw some current. Any of the pico-power AVR chips draw very little current in sleep mode - in the 10s of micro-amps for the 328, if I recall correctly. Sleeping an AVR for the least current draw needs just about everything shut down but the watchdog timer, and the maximum WDT period is 8 sec. A library like Narcoleptic will manage longer periods for you. What you would need to do though, is to provide a much more efficient regulated power supply than the one built onto the Arduino board (if that is what you'll be using). That done, the Arduino's load on your car battery should be microscopic.

One possible design for an efficient supply is an array of alkaline batteries, say 3 in series for a 4.5 output (while fresh) times 2 or more such strings in parallel, connected directly to the 5v bus.

I haven't done the power budgeting to know the capacity you'd need and whether you'd need D cells or could make a practical array from smaller ones, say AAs, but that is a way to achieve zero load on the car battery (discounting the car-battery voltage sensor's requirement). You might want to include the Arduino battery-array's health in the daily report, or, for the price of a few Alkalines, you might so over-design the Arduino battery that monitoring it would become unnecessary.

A couple of data points suggest a separate battery is a feasible approach:

  • A single 9v Alkaline runs a smoke detector for over a year including over-wintering in an unheated attic (in my own experience), and 9v Alkalines are not known for their capacity.
  • My digital setback thermostat has run for a couple of years on 2 AA cells, before a) they died, and b) I wised-up and started changing them annually. :)
  • I have an ATmega48 (very similar to the 328P) running off a couple of AA cells since June 2012. It's awake for a little more than 4 minutes per day, sleeping the rest of the time. Not changed the batteries so far. – Edgar Bonet Nov 20 '16 at 12:59
  • That's an impressive run-time - thanks for the additional data point, @EdgarBonet! I expected a sleeping Arduino and an Alkaline battery pack could be a "set-it-and-forget-it" system but without calculating out the energy consumption, I didn't guess it would perform that well. So, @DirkPitt, there's some real-world support data. – JRobert Nov 20 '16 at 17:16
  • It's not a full Arduino: I could not manage to get below ~ 40 mA with my Uno, whereas the bare ATmega in SLEEP_MODE_PWR_SAVE, with only the async timer active, took something like 2 µA. – Edgar Bonet Nov 20 '16 at 17:25
0

Consider using "Adafruit TPL5110 Power Timer"
https://learn.adafruit.com/adafruit-tpl5110-power-timer-breakout/overview

  • This is more of a comment. If you want to leave it as an answer, please add further explanation of your solution. – MichaelT Oct 26 '18 at 13:08
-1

you can use a timer switch. you can buy it from ebay for around 5 euros. i am using this one

https://www.ebay.com/itm/CN101-DC-12V-16A-Digital-LCD-Power-Programmable-Timer-Time-Relay-Switch-New/401190616827?hash=item5d68d2fefb:g:K3sAAOSwNRdX3ggT

i have also tried ds3231 but the arduino is on standby mode and it consume energy. this is the best solution i found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.