Hi there,
I am really new in Arduino. I am now trying to develop a simple pressure logger using Arduino Mega. The problem is that the system can only run for less than 3 days. To have a longer measuring period, what I want is the system could be start at specific time, let say on 7-Sept-2023 at 8:00:00. I've been searching this forum but I can't find the answer. Please advise.
Any reason you cannot power it from the mains?
The logger will be installed on sea-bottom hence it is battery powered system
start running, or power up / wake up ?
It sounds like you have not optimized the system for low power modes. The Mega is a very poor choice, because there are components on the board that consume as much or more power than the MCU, and can't be put to sleep.
With better choices, months of runtime on a small battery is easily achievable. See About Us | Underwater Arduino Data Loggers
wake up. I need to save power as much as possible to have longer recording
Thanks jremington, I have read your paper. Will go more detail on your website
Not my paper, nor my website!
The best and most complete intro to sleep modes and power saving with AVR-based Arduinos (but generally applicable to most other MCUs) is Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors
I see, still I have to thank you dude for giving me such fruitful information ![]()
Well, that sort of suggests ‘turning off’, but assuming that you really do want low-power sleep, either an RTC, or some other delay circuit to fire a wake-up interrupt.
That would also be needed to ‘power on’ if you chose that route.
Can you tell us about the battery you'll be using? Also, how often do you want to take a reading? Can the Mega go back to sleep, or power down, between readings, so as to save power?
I've used a battery backed RTC (DS3231) connected to an ESP firebeetle designed for very low current needs (see for example ESP32 FireBeetle DFR0654 real current consumption in deep sleep mode |) and a Pololu Power Switches (and some sensors).
the circuit is such that the Mini Pushbutton Power Switch turns all power off - the arduino, the sensors and other circuits are just shut off.
The power switch does not consume anything really (~0.01 μA when off) and can be turned on by the press on a button, which the RTC can simulate by raising an alarm.
Before installing the system in the remote location, the RTC is configured to raise an alarm at a given date using the Adafruit RTClib and then the power switch is pressed (there is a manual button on it) to turn the whole system off.
at the given time, the RTC sends a pulse to the power switch, which powers on the whole system. The arduino boots, does what it needs to do and can reconfigure the alarm1 on the RTC to trigger again at a moment later, like a month later or whatever. Then the Arduino uses a pin to send a pulse to the power switch to turn off power. The whole system goes back off until the next alarm.
This way there is no power drawn from the load when not in use.
PS/ I used a firebeetle as I was writing the data in SPIFF and I used a web based interface to retrieve the data when I was getting the system back. This way no fragile SD card that is hard to protect against moisture / condensation and also when capturing data for some time, you can use the ESP32 sleep modes to minimise current consumption without turning off the whole system
@J-M-L 's solution will be the best you can do with the Mega
I've have done the same thing
It is 18650, 11.1 v 9Ah. My plan is to record pressures, in which every hour it should be10 minutes at 1 Hz with 50 minutes sleep, and I can set the recording to start at specific time. Until now, my code can only instantly start recording continuously at 1 Hz
So you have three 18650 cells in series. Then you must have something other than the Arduino that needs the high voltage. Well if your sensors and other devices can't be put into low-power sleep during those 50 minutes, then J-M-L's solution to turn off the power seems the best option.
If you don't have access to the Mini Pushbutton Power Switch, or want a less expensive option, you could replace it with a P-channel mosfet and NPN transistor. In that case the RTC would turn on the power, and keep it on. Then when the Arduino is finished it sets the next alarm time, then tells the RTC to clear the alarm flag, which shuts off power.
Note however that the DS3231 can set an alarm for a date of the month, but not which month or year. There may be other RTCs with alarm outputs that do better, but I dont know of one.
How are you planning to save your data readings?
True
I think to remember that the DS3232 Has such capability
Why do you need a Mega2560? Where will the log be kept?
A long while back we used batteries that worked with sea water. They would last for decades but when put into the ocean they came alive. In our application they did not have to last very long, maybe an hour. I found this, it may help or I may be way off base. Since you have all that salt water, it is possible it could be a source to charge your battery or super cap.
Where maximum battery runtime is a key concern, you don't want to be wasting power in a linear regulator!
Use of a regulator, and which type, can be a complex issue. At low current, a switching regulator may be no more efficient than a linear regulator. And of course the choice of regulator only matters when the power is on.
