Blynk timer with gsm808

Hello i would like to get some more informations about blynk timer and how to actually make my project work.

My project is a bee scale which it will get temp and humidity (SHTC3) values from 1 sensor and weight from load cell through HX711 all connected to atmega328P standalone and send data through sim808 gsm. So actually i want arduino and sensors and gsm to be idle and on specific times to be enable and send data through GPRS (might include GPS also but thats another story ).What i want to ask is how i can ask from blynk to receive those values twice per day with the minimum data usage and battery usage. I have seen the blynk timer but haven’t found anywhere whats the max timer you can set. But with timer i was thinking that battery will be drained more than rtc timer? And if rtc timer is better any example code how to ask for values every 8h for example? Or is it better to have something like a powersave mode?
I am new to programming and to blynk so any better suggestion would be appreciated. It is a bit complicated for me but would love to use blynk for that project.
Thank you in advance.

That’s a poor choice of MCU in my opinion. If you use an ESP8266 based board (such as a NodeMCU) or an ESP32, then you can use deep sleep.
If you try to use BlynkTimer instead of deep sleep then your device will be consuming far too much power.

For deep sleep times of the duration that you are looking for then the ESP32 is a better choice.

Have you seen the existing Beehive Connected project?

Pete.

Yea i have seen that project but i dont have an ESP8266 nor a solar panel to charge my batteries nor can use lora wlan in my place i guess so thats why i choosed gsm sim 808 also atmega238 standalone consumes less more power than arduino uno it self so i would guess it was a good choise. Anyway beside deepsleep how about lowpower.idle and rtctimer from blynkdoes that rtctimer works like a physical rtc? Or how it works?

Also i would like to ask on blynk with the value display settings on reading rate if i choose 8h wouldnt i get the value every 8h or i misunderstood, also that means that meanwhile the hardware wghhile still be connecting to app and consume mb? I have read that you can drop that data usage by changing the heartbeat to a bigger value is that correct?

@christophebl was using WiFi originally, and then used GSM then LoRa WAN, although I think he may be going back to GSM for simplicity.

TBH, I think you’re wasting your time with an ATMega CPU.

Data usage is a minor consideration compared to power consumption. Your battery will be exhausted in no time at all of you don’t put everything to sleep.

Pete.

So my only sollution is an RTC connected to ATmega?

I don’t see how an RTC will help.
All a physical RTC module does is to store the current date and time so that your MCU can read this information when it starts-up. Once that date/time has been loaded into the MCU it will be incremented in a way that’s fairly accurate - unless you suspend the processor.

The MCU still need to be running a piece of code that compares the current time with the target time to see if Blynk needs to be updated, which is what uses the battery power. That and keeping the SIM module powered-up of course.

Really, you need a TTGO T-Call ESP32 module with built-in SIM module and deep sleep.

Pete.

Well using a physicall RTC and a MOSFET its a project for bee scale that i ve seen somewhere else but dont know how i can combine that with blynk thats why im looking if there is a way to do it with what i have. Cant really get an ESP right now cause of quarantine but need to build that project cause of spring :slight_smile: Also i would like to ask on blynk with the value display settings on reading rate if i choose 8h wouldnt i get the value every 8h or i misunderstood, also that means that meanwhile the hardware wghhile still be connecting to app and consume mb? I have read that you can drop that data usage by changing the heartbeat to a bigger value is that correct?

Sorry to spam all those questions but one more thing about that ESP. Even if its in deep sleep isnt the processor running so it will count when to wake up? Why is that diferent to atmega?

And one last last question: Maybe if i use HTTP api for blynk its better?

Maybe if you shared a link to this “somewhere else” project then we’d be able to comment on the feasibility of this approach.

I don’t find it a problem getting ESP32 hardware shipped from places like China.

Yes. If you choose to publish data to Blynk every 8 hours then the reading shown in the app would be the latest one, which could be up to 7 hours and 59 minutes old.

It depends how you write your code. If the MCU’s processor is running and you’ve not disconnected from Blynk then there would be a heartbeat/ping every time the Blynk.run command is processed. You could play around with the heartbeat settings to reduce the data usage, but if your MCU and SIM module are running then the battery will be dead in no time at all.

The ESP8266 and ESP32 keep a ting part of the processor running to keep the clock ticking and to look for wake-up signals from external hardware, but this cuts power consumption down to a minute level.

Some boards are better than others at reducing their power consumption levels in deep sleep and there are several excellent comparisons done by Andreas Spiess on his YouTube channel.

It doesn’t make much difference TBH. An ESP32 with some well-written deep sleep code and using Blynk in the regular way will use a similar amount of data/power as an ESP32 with well-written deep sleep code using a series of API calls to update Blynk. It’s just that the conventional way of using Blynk is easier to code for most people.

I understand C++ coding, Blynk and beekeeping, and I’m familiar with lots of different hardware.
You can choose to take my advice or not - it makes no difference to me, but I suspect that you’ll waste quite a lot of time attempting to go down the rout that you’re proposing and that you’ll eventually end-up with an ESP32 TTGO T-Call using deep sleep.

Pete.

I am afraid of that too, but as i said im in a hurry and cant wait for China to deliver or wait for stores to open. Bee season is almost open here in Grece ::slight_smile:

Also i am not sure how ESP as wifi can connect in remote places that my behives will be or how lora works and if it will work in my country.

So that doesn’t use an RTC module, it uses an ATTiny 85 as the timer module. Do you have an ATTiny85?

Pete.

I wasn’t suggesting that you use WiFi.
I suggested that you use a TTGO T-Call which is an ESP32 with an onboard GSM module.

Pete.

Isnt ATTiny 85 an rtc too? i dont have one also but that means that attiny is a chip that works indepentently?

No, the ATTiny is a microprocessor.

Yes, you program it with the code you require to perform the functionality you require.

In the project you linked to, the ATTiny needs to be programmed with this code…

In this example, the ATTiny is being used as an external timer to power-up the Arduino Uno every 120 minutes so that it can establish a GSM connection, send the readings and then power it back down again.
It’s being done in a rather crude way, keeping the Uno powered-up for a fixed amount of time (40 seconds in this case).
In the code that I worked-on with @christophebl the ESP32 goes to sleep immediately after the weight, temperature and battery voltage readings have been sent to Blynk. How long this takes will depend oh how quickly a connection to the Blynk server can be established. because you’re varying this time dynamically, you get the maximum battery life rather than using a fixed time which is set to cope with a worst case scenario.

Either way, if you don’t have an ATTiiny then you’re back in this position…

which means that you might as well order an ESP32 rather than an ATTiny85.

Pete.

Ah ok now i see your point. Didnt know there is a gsm module for ESP32. Well thank you very much Mr Pete. I will try i little more with what i have and test it if cant make it work ill follow your suggestions.

1 Like

Dear @PeteKnight i would like to ask your help again if possible, but it has nothing to do with blynk its about the same project and some wrong readings from my code. So is it ok if a post my question here?