Hello, everybody! I’m currently running my own Arduino sketch on a Heltec Wifi LoRa 32 V3.2 board. My device will only be used for one hour a day to measure time recorded by a remote sensor. What is the board’s power consumption in RX mode? And in TX mode, do I need to add an extra 40mA for the sensor I’m using? What LiPo capacity would be appropriate for charging once a week? Then, when I connect the battery, the device turns on and the code runs. If I want to turn it off, all I have to do is install a kill switch on the battery. But if I do this, I can’t charge the LiPo through the board’s USB. Am I missing some option? Or is this basically what’s going to happen to me? Thanks in advance, and best regards to this community.
Question about battery management
How will it be turned on & off?
Is the remote sensor a clock? If so, why not use the local time? Unless it is in a huge gravitational well, then remote is a better idea, but if too strong, the radio waves won’t escape the event horizon, may be better to get a long lead.
What is the remote sensor? In what way is it remote?
LoRa, BLE or WiFi?
Normally we’d read a sensor and then Tx, if you do both at once, then yes, you’ll need to add the quite substantial 40mA you are quoting.
Depends on power consumption & duty cycle which depends on which sort of radio you are referring to and how often there is a transmission.
Yes, deep sleep mode with a wake up switch or internal timer.
Huh?
Based on your other posts, I suspect you want a Tx unit connected to the unknown sensor that sends over LoRa to a Rx unit that then uses BLE to transfer to a mobile phone.
Do you want to run the Tx, Rx or both units off battery?
Given that the module has a solar charger chip, maybe you don’t need to do complex calculations, just a modest battery, deep sleep and a small solar panel.
This may make things look complicated, it isn’t, it just needs more detail to be able to answer. Quite often it helps to draw out a block diagram with all the main components on it to help you & help us.
Thanks so much for your interest, mmc! Let me explain in a little more detail. I’m building a stopwatch for athletics speed series. It needs to be small and portable. Both modules will run on batteries, and they will turn on and off completely after 1 hour of use a day, perhaps 2 or 3 days a week. The RX LoRa module keeps time, displays it on the screen, and sends the records to the phone via BLE. The TX LoRa remote module has a laser that consumes 40mA and is continuously on while the system is in use. It doesn’t have a display or BLE. Both modules also have a small buzzer. The solar option isn’t feasible; both will be powered by lipo. I think this makes what I’m doing clearer. I’ve measured, and at a maximum distance of 120m, the transmission speed is around 15ms, which is fine for my project. I need to clarify a bit about battery management. I think I read in a post that the Heltec V3 consumes 115mA BLE / 90mA RX / 200mA TX.
Solar only works when there is a LiPo present. You run the risk of discarding a solution that means you almost never need to charge the units.
Sounds in line with the data sheets but without knowing how many times in the hour the LoRa and BLE transmit for, it’s still hard to calculate.
Using a multimeter to measure such stuff is very hard as the duration of each transmission is so short and it’s an overall cumulative effect. You could get one of these to calculate consumption over a period of time: https://www.qoitech.com/otii-ace/
Alternatively buy a battery based on a guess and see what happens. Then you can either buy a bigger battery or a smaller battery, maybe two if you need a bigger. The guess can be informed, you know that the laser needs 40mA and runs for an hour, the module is only transmitting for 15mS.
I’d say the Nordic PPK2 is slightly cheaper and suffices…
I think I’ll start with a small 700mA lipo battery, which is the one I have now, and see how long it lasts. Regarding installing an on/off switch to completely cut off the battery, it would mean that to charge it via USB, the device must be turned on. I don’t know if there’s an alternative, or if there’s a battery with its own USB charging port?
Oscar Mike Golf !!!
And the problem with that is???
You could have a startup sequence that waits for the button to be pressed before it does the laser / LoRa - which might help in your defence when the lawyers ask why you had a device that shined a laser without warning …
At normal USB current of 500mA, the device won’t use much of the juice and the battery will be charged in under an hour.
Probably many and plenty - Amazon, eBay, AliExpress or even Google may reveal options.
If I use Lipo on the board connector, the reference value would be 4.2V to 3V (max/min). But is there any way to control it from the board? Is there an example sketch I can use to see how much battery is left? Would I have to connect an additional pin to the battery?
How we can help you with moving to a more self-service mode? It will give you answers quicker.
The forum is littered with discussions on measuring the battery voltage, the reference value doesn’t change (otherwise you’d never be able to measure it) AND there is an example sketch?
I’m sorry if I seem rude; English isn’t my native language. Most of the information on this board is for use with Meshtatic. That’s why I asked about the Arduino library examples. I’m truly grateful for your attention, first and foremost.
Your native language does not stop you looking at the examples or using search. And your English is fine.
If you aren’t familiar with where the examples are in the Arduino IDE, there is a whole heap of tutorials on the Arduino website.
It’s not that it is rude, it’s just pointless asking questions that are so easily answered by yourself - and quicker for you. And at some point, the volunteers will lose the will to live and stop answering.
Nope, not at all. Recent posts to some extent, but if you try a search, you’ll see so many items to read, like this list: http://community.heltec.cn/search?q=read%20battery - none of which relate to Meshtastic as they have that solved already.
Well, I think I’ve tried all the meter examples, and none of them work. Following this guide, I think it’s not entirely possible in V3.2 yet: http://digitalconcepts.net.au/arduino/index.php?op=Battery In the end, I managed to make an estimate. I think it’s pretty rough. I got a runtime of about 6 hours of continuous use on both of my modules (RX module with Bluetooth enabled and TX module with the laser sensor activated) using a little 700 milliamp Lipo battery. This means I could easily reach three days of use per week at an hour and a half a day. I think it’s interesting to be able to charge via the board’s own USB, and I still need to find out if the LED will light up when the battery is low. I don’t know if there’s some kind of low-battery signal. I haven’t seen one in my tests, so I used a multimeter to see the consumption in real time. Average drain will be at 120 mA mark. So, probably a 1000 mah battery gives me an extra margin, and go to cut-off switch route when not in use. Just remembeeing to power on at home when charging.
There’s a Heltec library with a whooole bunch of examples here:
If you look a little closer, you will find this one:
With the examples there, you should be able to get going… (although the Heltec framework is not perfect).
Thank you so much. I swear I’d already tried that library example, and it was giving me a compilation error or displaying values as 0, I don’t remember. Now it seems to be giving readings. I’ve noticed some lag between what it shows and what I measure with a multimeter. (The internal meter shows 3.96V vs. 4.17V with a multimeter). I suppose this type of drift is normal. Thanks again, and here’s the code to display voltage on the Heltec V3’s OLED screen.
#include <Wire.h>
#include “HT_SSD1306Wire.h”
static SSD1306Wire display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED);
// Función para encender la alimentación del periférico Vext
void VextON(void)
{
pinMode(Vext,OUTPUT);
digitalWrite(Vext, LOW);
}
void setup() {
// Activa la alimentación para la pantalla
VextON();
delay(100);
// Inicializa la pantalla
display.init();
display.setFont(ArialMT_Plain_10);
// Configura el ADC
analogReadResolution(12);
pinMode(37, OUTPUT);
digitalWrite(37, HIGH);
}
void loop() {
// Lee los valores del ADC
int analogValue = analogRead(1);
int analogVolts = analogReadMilliVolts(1);
// Prepara los textos para mostrar en pantalla
char valStr[20];
sprintf(valStr, “Valor: %d”, analogValue * 490 / 100);
char voltStr[20];
sprintf(voltStr, “mV: %d”, analogVolts * 490 / 100);
// Limpia y dibuja en la pantalla
display.clear();
display.setTextAlignment(TEXT_ALIGN_LEFT);
display.setFont(ArialMT_Plain_16);
display.drawString(0, 15, valStr);
display.drawString(0, 35, voltStr);
display.display();
delay(1000);
}
Whiskey Tango Foxtrot???
Why ask for current consumption values that you could have read in the data sheet, for your own unique application, when you had an ammeter to hand?
If we had relayed the data sheet values to you, they wouldn’t of really been of any help.
Perhaps consider typing up your questions and emailing them to yourself so you can think about doing the research yourself. You really need to keep your forum questions for the tricky stuff - that’s why we hang out here, not to redirect people to the obviously Googlable resources.
That would be totally counter-intuitive - lighting up an LED when the battery is low will only speed up the demise of the battery.
This is very normal - the “internal meter” is just a resistor divider and the ADC and for it to run the unit has to be turned on so the battery is under load. When you check it with a multimeter, you are using a high impedance probe so the battery voltage doesn’t sag as it’s not in use.
You are best off leaving a unit turned on and logging the voltage to serial every minute and when it turns off, you’ve got your lowest voltage the unit can manage as your cut off point. You can then create some sort of feedback on screen or LED or the buzzer or something to warn you.
Your code looks rather odd, seemingly providing the same reading at two different scales. Please format code with the </> tool, makes it easier to read.