How to flash an LED as mailbox notification and use sleep mode?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

How to flash an LED as mailbox notification and use sleep mode?

#1 Post by Regolsis » 28 Oct 2022, 17:21

Hi,

I would like to build a mail notification, which sends MQTT infos from my mailbox at the door when getting mail. This works fine in my breadboard tests. But there is an issue:

On the outside of my mailbox I have an LED, which should also flash on incoming mail. This seems to be a showstopper, because keeping the ESP-12F running the whole time uses about 20-40mA (I have a Lipo battery with a small solar panel build in my mailbox).

When I use deepsleep instead with the shortest sleeping time (1 second), the flashes have a time distance of 4 seconds and the ESP uses also a lot of energy, as the startup needs 70mA and deepsleep is only one second with 0,05mA.

Any idea how I could solve this and get the LED flashing until I open the mailbox? Thanks.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: How to flash an LED as mailbox notification and use sleep mode?

#2 Post by ThomasB » 29 Oct 2022, 05:25

My first thought was to add a circuit with a blinking LED that would be enabled by a GPIO when the device was awake. But I don't have a schematic to offer you.

But a far better solution would be to have the ESPEasy device send a MQTT or HTTP message to a separate AC powered IoT device (ESPEasy, Hue Light, etc.) that handled the lighting control. This would allow the alert light to be placed anywhere that is convenient to you.

BTW, mailbox notification systems are a real time saver. Due to the long distance I use a LORA based solution. Going on four years and I have only charged the 18650 LiPO a couple of times. The transmitter uses a battery powered Arduino and the receiver is uses a ESP8266 (powered by mains). Details to the project are found here:
viewtopic.php?p=33882

- Thomas

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: How to flash an LED as mailbox notification and use sleep mode?

#3 Post by Regolsis » 29 Oct 2022, 09:27

Thank you. I know this thread about mail notification, quite interesting.

For about 8 years I used an Arduino with 433MHz sender as mail notification, which used to work fine, but in the last years it did not work correctly any longer. Could be that there is another sender nearby which distorts my one. Now I want to use wifi and ESP, because all of my other sensors now also get upgraded to ESP8266 and use openHAB.

When in deep sleep mode, the GPIOs of the ESP8266 loose their set state, so this would not help. The only solution I could think of would be light sleep mode, which ESPeasy does not support at the moment. If someone knows how or where to implement light sleep in ESPeasy, I would really appreciate this feature.

My mailbox is right to the entry of my home and I have already a notification light in my living room. But when returning home I also would like to see the notification right on spot with the flashing LED, as it was since many years now. I think I have to leave the ESP awake for now when new mail arrives and use a large battery. Hopefully my solarpanel on the mailbox is sufficient during winter.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How to flash an LED as mailbox notification and use sleep mode?

#4 Post by TD-er » 29 Oct 2022, 16:34

433 MHz is always a bit tricky as it is also used for (cheap) weather stations and similar other cheap appliances like door/window sensors.
An outside thermometer with an almost empty battery can start "spamming" the 433 MHz spectrum with noise and keep doing this very effectively for a remarkable long period.
This will make communicating on that band nearly impossible and the range of such disturbances can also be remarkable far.

Some (all?) car key fobs also use 433 MHz, which makes it also hard to open/close your car in range of such a thermometer or weather station.

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: How to flash an LED as mailbox notification and use sleep mode?

#5 Post by Regolsis » 29 Oct 2022, 17:24

Yes, 433 is bad, so I prefer wifi over this. Wifi has also a better range in my case.

By the way, is there any chance to disable wifi? I read about "wifimode,off", but when using this, there is no difference and the eco mode obviously gets disabled, so wifi is consuming 70mA against the 20-40mA in eco mode with "wifimode,off".

As ESPeasy does not support light sleep (at the moment), I would like to cut off all things to achieve less energy consumption instead of deep sleeping for LED flashing.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How to flash an LED as mailbox notification and use sleep mode?

#6 Post by TD-er » 29 Oct 2022, 17:51

Not right now, but I am working on cleaning up the WiFi/network state machine.
When this is done, you can also have the "WiFi off" state.

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: How to flash an LED as mailbox notification and use sleep mode?

#7 Post by Regolsis » 29 Oct 2022, 17:54

Sounds great. Perhaps it would lead to light sleep like in this table?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: How to flash an LED as mailbox notification and use sleep mode?

#8 Post by ThomasB » 29 Oct 2022, 18:32

When in deep sleep mode, the GPIOs of the ESP8266 loose their set state, so this would not help.
That is true. That is why I mentioned the blink circuit would be enabled by GPIO when the *device was awake*.

For example, a Dual D Flip Flop with a clock, data, and set/reset pin. Such as a 74HC74 IC. Or one that uses I2C. Such as a PCF8574 or MCP23017. With a thoughtful design the ESP8266 GPIO pins could control the chip's state before it went to sleep. The chip's output on/off condition would remain after the GPIO's were turned off.

Use either of those with a blinking LED and I expect you would achieve success.
An outside thermometer with an almost empty battery can start "spamming" the 433 MHz spectrum with noise and keep doing this very effectively for a remarkable long period.
+1. That one got me too. Used a spectrum analyzer to find the source, was the outdoor temperature transmitter mounted under the eaves of my roof. Battery was nearly dead, yet it spammed 433MHz with gusto.

- Thomas
Last edited by ThomasB on 29 Oct 2022, 18:44, edited 1 time in total.

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: How to flash an LED as mailbox notification and use sleep mode?

#9 Post by Regolsis » 29 Oct 2022, 18:43

ThomasB wrote: 29 Oct 2022, 18:32 For example, a Dual D Flip Flop with a clock, data, and set/reset pin. Such as a 74HC74 IC. Or one that uses I2C. Such as a PCF8574 or MCP23017.
All of this only for a flashing LED? Sounds like a little bit of overkill, as we already have a microcomputer running :D

If TD-er finds a way to set wifi off or make the ESP light sleep, the problem would be solved. Light sleep works fine with standard ESP8266 F12/07, I tested it with success. But for this I did not use any framework like ESPeasy, which now I prefer over my own complete implementation.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: How to flash an LED as mailbox notification and use sleep mode?

#10 Post by ThomasB » 29 Oct 2022, 18:48

If TD-er finds a way to set wifi off or make the ESP light sleep, the problem would be solved.
Good thing he has a lot of free time to do this. Otherwise it would mean you would have to build a circuit that takes about an hour to complete. :)

Sometimes the easiest software fix is solder.

- Thomas

User avatar
Regolsis
Normal user
Posts: 41
Joined: 08 Oct 2022, 13:07

Re: How to flash an LED as mailbox notification and use sleep mode?

#11 Post by Regolsis » 29 Oct 2022, 18:54

Of course, you are right. But I don't have these components, have to get them, test the circuit etc. So far I will let the ESP run the whole LED flashing time (battery with small solarpanel should work) and hopefully in the future ...in 10-20 years... there will be an update and I only have to change the firmware :ugeek:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How to flash an LED as mailbox notification and use sleep mode?

#12 Post by TD-er » 29 Oct 2022, 20:22

Regolsis wrote: 29 Oct 2022, 18:54 [...] and hopefully in the future ...in 10-20 years... there will be an update and I only have to change the firmware :ugeek:
I think it will be finished within 10 years, but I can't promise anything ;)

seersucker
Normal user
Posts: 24
Joined: 11 May 2020, 17:01

Re: How to flash an LED as mailbox notification and use sleep mode?

#13 Post by seersucker » 30 Nov 2022, 23:22

TD-er wrote: 29 Oct 2022, 17:51 Not right now, but I am working on cleaning up the WiFi/network state machine.
When this is done, you can also have the "WiFi off" state.
I have a situation where an esp-32 is controlling another wifi device, and they interfere with each other, so having the option to shut down the wifi would be great! The wifimode switches don't really work properly right now.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests