I built a letterbox sensor based around a nodemcu and 3 laser beams to detect if anything is in my letterbox, system works well indoors but when I take it out to the letterbox it stops triggering. I’m assuming the wifi signal is too weak to convey data, its a little weird as HA can still maintain a connection and can see the sensors, they just dont toggle anymore…
The other weird thing is when I first installed it in my letterbox it worked perfectly for a couple of days.
So question is, assuming this is a wifi issue, is there a way to extend the range of a nodemcu wifi?
> -66dBm = excellent
-66dBm to -70dBm = good
-70dBm to -80dBm = should be ok for very simple messages, like IoT devices
< -80dBm = starting to get iffy
< -90dBm = expect lost packets
Thanks for the code, I tried this and inside the house where everything works I have -55db, as soon as I move the unit out the front door the sensors stop toggling and I have a signal strength of -66db.
Yes, tried that and it is much faster.
I am testing by continually breaking the laser and watching the sensor toggle on my phone while moving the unit around my house, as soon as I move to where the signal is less than -60db the toggle stops. -59db is good, once -60db and lower no response…
Just wondering if powering 3 lasers & 3 detectors from the nodemcu 3v pin is causing a performance drop…? In re-reading the specs they 5v devices so maybe I am under powering things. I went 3v so I didnt need to level shift the signal out and initial testing worked, will have to try this next.
The signal strength in both cases is excellent and should not be causing you issues.
There is zero information on the power draw of that diode module in the link you posted (it doesn’t even mention if it is a 1mW or 5mW module) so it is difficult to say much about the power it requires. Also it depends on which NodeMCU board you have. Some have better 3.3V LDO regulators than others.
I suspect you are right and that you are operating right on the edge of the 3.3V regulator’s limit, then moving further away from your WiFi AP ups the power of the NodeMCU WiFi transmitter slightly and the regulator cuts out.
As a test you could monitor the 3.3V rail with a multimeter while moving outdoors. Or if you have no meter, just disconnect all but one of the laser diodes and see if that works as you move outside.
So why not use the USB input mini jack on the nodemcu and then the vcc for power - that will be 5v - if the sensor takes 5v… I have a dotmatrix screen and it won’t work barely (very dim) if I power from 3v. You only get 5v output if you use the usb plug on the nodemcu…
Because the diode module may not turn on when powered from 5v but supplied with a 3.3V enable signal from the NodeMCU. Then again, are the laser diodes on all the time?
If so, powering the lasers from 5V would be the way to go.
The detectors might be ok on 3.3V so no level shifting required.
I didnt do that originally because that then makes the signal line out from the detector a 5v high which is too high a level for a nodemcu input but will have to go that route and make a divider circuit to step teh level down, need a few more bits and I will try it…
Yes, will do that but literally have no parts where i am.
I have just disconnected all lasers and detectors and manually injected a zero and 3v level at the letterbox and I DO get the sensor toggling so the problem was due to powering stuff from 3v line.