I found this blog about some hacks to run an arduino pro mini with AA batteries (I have the 8mhz/3.3v). But since I'm using a NRF24 radio, I'm worried that screwing up with the frequency (and removing the voltage regulator) will not work too well. I'm not able to power a simple pro mini + temperature sensor for more than 10 days with high-end Nimh rechargable AA batteries. Any other tricks to save more power with the pro mini?
Hi, welcome to the forum.
Often three AA batteries are used. The 8MHz 3.3V Pro Mini can still run at 5V.
With rechargeable NiMH batteries, it will be 3 * 1.2 = 3.6V.
What is the voltage after charging ? About 1.25 V ? then it will be 3.75V.
If the Pro Mini is in sleep-mode most of the time, then it should run for more than a year.
The voltage for the Nordic nRF24L01+ is 1.9 to 3.6V. If you buy a cheap NRF24 module, then it has probably a counterfeit chip. Maybe those counterfeit chips only work at 3.3V.
Which temperature sensor is it ? It is a module ? which module ?
Can you show a photo of your project ?
Why would the frequency be affected in any way, and what is wrong with removing the useless voltage regulator?
Perhaps you didn't manage to power down the temp sensor during sleep? Just a guess?
That is the best you can expect, if the pro mini and temperature sensor are awake the entire time. You need to use deep sleep modes to extend battery life.
Post the code, using code tags.
Thank you guys - it sounds like there must be something really wrong with my wiring. I do use the super low power sleep in my code. The unit only goes on to send one NRF24 packet and then stays asleep for 20 minutes.
// read sensor data // send through NRF 24 radio.powerDown(); digitalWrite(TS_PIN, LOW); // TS_PIN is connected to the transistor base delay(100); Debugln("Starting sleep"); #ifdef DEBUG_MODE int sleep_time = 0; #else int sleep_time = (success == 1) ? SLEEP_CYCLES_SUCCESS : SLEEP_CYCLES; #endif for (int il = 0; il < sleep_time; il++) LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF); Debugln("Sleep completed");
This is my diagram. To prevent the sensor to be powered on all the time I use a 2N3904 transistor to gate the power delivery to both my NRF24 and my sensor. Would anyone have a better suggestion?
I read that if you drop the voltage without the regulator - the arduino will slow down to 1Mhz. Nothing wrong with the speed itself but without proper clock, isn't that going to screw up timing on all kinds of protocols like onewire?
The Fritzing diagram is, as usual, most uninterpretable but is also clearly wrong. The radio is probably drawing current the entire time.
Get rid of all those parts and put the radio to sleep as well, as demonstrated in this excellent tutorial: https://www.gammon.com.au/forum/?id=12821
I read that if you drop the voltage without the regulator - the arduino will slow down to 1Mhz
You may have read that, but it is utter nonsense.
I am using the radio power modes and I do put the radio to sleep as well.
I checked the tutorial you sent, but is there any easier way to control the power delivery to the sensors without a separate watchdog board?
Also I apologize the lack of clarity - I guess the one that's hard to read in the diagram is the D18B20 sensor.
And thanks for the clarifications on the voltage regulator. I will quickly get rid of it.
Then why the transistors between the Arduino and the radio, which, incidentally, are connected in a way that will eventually destroy the Arduino (no base resistor to the one labeled "N")?
Always post ALL the code. Snippets are not only useless, they lead to misunderstandings like the above. And DON'T go back and edit your post to correct mistakes that others point out to you. It makes it hard for others to interpret the thread.
Again - sorry for the confusion - there is one transistor and a DS18B20 sensor.
And the other transistor (2N3904), I am using it as switch. Should it still have a resistor? I'm not a pro in electronics, so that part might be really clunky. Would there be a better solution to control/switch the power supply to the connected sensor?
A base resistor is absolutely required, or you will destroy the port pin by drawing too much current.
But there is no reason to control the power to the radio. The current draw is negligible in sleep mode, if you do it correctly.
The temperature sensor can be powered directly from an output pin. The radio cannot.
Ok that should be an easy fix.
Yes, I recently saw power consumption numbers and indeed - I'm not worried about the radio. That is something I will rewire.
So, I believe I tried this in the past already but never got it to work. From what I read also, the current you get from an output port is quite low. I will try it again with the DS18B20 but would there be other alternatives to build a power delivery switch for the sensors?
You seem to be operating on a fair bit of misinformation, and should do some more reading. Cross checks are usually required, as there are a lot of really awful tutorials, like Instructables. The one I linked in reply #9 has lots of useful and technically correct ideas.
The DS18B20 draws about 1 mA in active mode and people very often power it by a port pin. A standard AVR Arduino port pin can safely supply 20 mA, 30 mA in a pinch.
You DO NOT need a power switch for the sensors or the radio.
Get each part of the project working independently before putting the bits together.
Complete gobbledegook in fact.
What does "drop the voltage without the regulator" mean? The regulator is basically useless and should be removed to get rid of its minor current draw, but how the ATmega responds to its supply voltage has absolutely nothing to do with whether that voltage is controlled by that regulator or something - anything - else.
And the Arduino does not switch its clock frequency in any manner relative to its supply voltage.
There is a certain minimum voltage at which it will function with a 16 MHz clock, it will simply not work at a certain lower voltage. You can use a different crystal - such as an 8 MHz - if you want it to operate at lower voltages, but you have to provide that clock or code it to use the internal approximately 8 MHz timebase.
Thank you! I dropped my consumption to 4 mA in sleep mode and 15 mA during signal transmission. And yes it is easy to power the DS18B20 from the pin and I was able to do the same with a AM2301. I believe my previous attemps were to power the NRF24 + sensor from the pin which actually doesn't make any sense since it has a really low consumption in sleep mode.
Oddly enough my AM2301 + nrf24 dropped to ~2mA in sleep mode - can't figure out why this unit has a larger draw.
You should be able to do a lot better than 4 mA in sleep mode. When using deep sleep with the watchdog timer to wake, current consumption is typically < 7 microamps, or about 500x reduced.
However, with 4 mA the expected lifetime for typical 2500 mAh batteries would be 2500/4 => 26 days.
You were totally right. I tested couple arduino boards and couple nrf24 radios and I found the issue... For my sleep loop I had
LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF);
This takes ~3-5 mA but changing it to
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
drops my power usage in sleep mode to 0.01 mA