I am working on a project with three sensors, an RTC, and microSD memory. My system is programmed to take measurements every hour and enter low power mode.
My main question is how to power my project for a month, since it will be autonomous. I tried using a power bank, but it only provided power for a day and a half. I guess it stopped providing power because it went into low power mode, even though the battery was more than 75% charged. My second attempt was with a 5V-2A cell phone charger, but it only took two measurements (although the system did not shut down). I've been reading a lot about it, and I thought about using a regulated eliminator to connect it to the jack, but I've read that it can overheat the port.
I am not an expert in electronics, so I would like to hear your opinions on how to power my system easily and safely, please.
I think that it's important to first determine the power consumption of your setup. Based on that you can decide what the best power solution might be.
Further an Uno is not the right board for low power consumption. You can put the main processor (328P) in low power mode and maybe some peripherals but you can't put the serial-to-usb converter in low power mode.
I have calculated the system's power consumption, and it is quite high, mainly due to the Arduino. Thank you very much. I didn't know that the Uno is not the most suitable for low-power mode. In that case, would it be better to change it, or would it cause many problems to continue using it as I have been doing until now?
You can consider a SparkFun Pro Mini. Same processor, no serial-to-usb converter (upload using an external one or using ICSP).
There is a 3.3V/8MHz version which will consume less power than the 5V/16MHz version but that might not work with the other components of your setup.
That should provide a steady 5V till such time that you draw more than 2A. So I don't understand how that can only result in two measurements; it's basically a more powerful USB port on a PC.
It needs to be connected via USB or the 5V pin of the board; in the latter case don't be tempted to also connect USB to read out data.
If you want to power from a battery (or power bank) this is the calculation that you need.
4 weeks equals 4 x 7 x 24 = 672 hours. If your setup draws 200 mA that is a consumption of 134Ah. A battery (or power bank) needs to have that capacity. If your battery (or powerbank) states e.g. 20000mAh you can power your setup 20000/200 = 100 hours. If you however only draw 200mA for a few seconds every hour you should easily get far more out of that 20000mAh.
I did try setting up a power bank to supply a remote sensor containing a rechargeable lithium cell.
Adafruit had some interesting power management modules that seemed to fit the requirements.
This was a couple of years ago, so the details are hazy.
It's also when I found out that while power banks have a manual turn on button, they need a small current demand to turn on automatically.
I tried several power bank brands and Belkin was the the most promising.
As usual, something else came along to distract me, but I am confident that it would have worked.
Another feature of these power banks is the different "stay alive" times from activation.
The times can vary from seconds to nearly 20-minutes on one model.
Rather than introducing new devices, let's focus on the thing that should have worked: the cell phone charger. Assuming that it's plugged into AC and connected to the arduino's USB jack, it should run for years.
So, why did it stop after two measurements? Is there something in your code that's reliant on communication with a PC?
If you already have an RTC, and if it has an alarm output, such as the DS3231, at the cost of adding a P-channel mosfet you can have the RTC switch power on and off to the entire rest of the circuit. The RTC will be running on its own backup coin cell, which will last for years. Then you can set the RTC to trigger an alarm every hour, which powers up the circuit. The Arduino then takes readings and saves them, waiting just a bit to make sure the SD card has finished, then the Arduino sends a command to the RTC clearing the alarm flag bit, which turns off the mosfet, and the power dies. If the sensors need time to warm up, this option may not work so well. But otherwise, there's no current draw at all for the entire hour except the few seconds when it's active.
Below is a circuit you could use. It shows a boost converter if you're using a 5V Arduino, but you wouldn't need that if you have a 5V supply of some kind.
It's possible that even a power bank would work. The minimum current shut off may not take place for something like 20 seconds, and the Arduino might be able to do its thing in that time.
Pullup on ZS-042 module (if present) doesn't cause problem with external higher voltage pullup?
Edit: I see the comment to disconnect on-module pullup.
Thanks for the explanation.
I also don't quite understand why it only took two measurements even though it stayed on the whole time I left it connected. I've read that it may have been due to power drops and the Uno's regulator causing crashes or desynchronization. It should be noted that when I did the test with this type of power supply, I connected it via the USB port.
I run some Nano R3 with fifty WS2812 animations for up to three weeks using "bad" e-bike batteries (capacity reduced to 7Ah versus original 10Ah) with a 5VDC USB port. Each weighs about two kilograms. That's the size you need.
That's what I thought and read too, that connecting it that way to the cell phone charger and the Arduino USB jack would work fine. But I don't know if it has to do with the SD card causing writing errors or power surges, because the code worked fine when connected to the PC and the power bank.
Yes, if the power is shut down, then the on-module pullup becomes a pulldown, because it's pulled up to Vcc, which is now at ground. So you have to cut the trace to the pullup, then rely on the external 100K gate pullup to the supply line. On the ZS-042, the trace to the pullup is here:
Yes, I am using the ds3231 and in my code the lowpower function and alarms so that it takes measurements every hour. Regarding the sensors, I have one that does need a little time to stabilize.
But if the power bank stops supplying power due to low system consumption, as happened previously, will this now happen even more so when the system is almost completely shut down? I apologize if I misunderstood any part of your idea.
Anyway, thank you very much for this advice. I was thinking of using a MOSFET, but for the SD.
If the power bank shuts down because of reduced load, it doesn't matter so long as your Arduino has already finished doing what it needs to do, and has turned off the mosfet. So what matters is how long the power bank continues to supply current after it starts up. I think most are in the 20-second range, but you can test this.
And actually, you want the power bank to shut down when it's not needed. Otherwise it will use up a lot of battery power keeping that boost converter running.
So the only thing running should be the RTC on its coin cell - until the alarm time is reached and it turns on the mosfet.
But this does raise the question of how the power bank knows it needs to power up. If there's no output, there can't be any current draw to get it started. I suspect there actually is some output voltage via a very high-value resistor, and the power bank's controller monitors the voltage drop across that. Presumbly the current flowing through the 100K pullup resistor when the INT pin goes low would be enough to trigger a turn-on of the 5V supply. But you could test that.
Use a MOSFET for the whole thing and save a lot of power.
There was someone here on the forum that did a datalogger with the TPL5110 and 6 AA batteries
Okay, I understand. I did consider using a small charge to keep the power bank on and prevent it from turning off due to low consumption. My question is whether my system will be more stable if, instead of using the power bank, including the MOSFET in the RTC, I use, for example, the USB power supply via the cell phone charger?