Nodemcu Wifi Issue

Hi,

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?

Maybe have a look at the d1mini pro, has external antenna input

https://www.banggood.com/buy/wemos-d1-mini-pro.html

Do you have a wifi signal sensor on the board so you can see what the connection is like?
e.g.

sensor:
  - platform: wifi_signal
    name: "letterbox WiFi Signal"
    update_interval: 15s
    filters:
      - sliding_window_moving_average:
          window_size: 15
          send_every: 15
          send_first_at: 15
> -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
1 Like

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.

Is this low enough to cause such an issue?

Thanks, I will look into that and give it a try.

I have a signal strength of -66db.
Is this low enough to cause such an issue?

No, as per my table above, that is an excellent signal strength. Are you sure you waited long enough for the filter to update?

Try it without the filter:

sensor:
  - platform: wifi_signal
    name: "letterbox WiFi Signal"

This should update much faster.

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.

Laser

Detector
https://www.ebay.com.au/itm/Sensor-Module-Board-Laser-Receiver-Transmitter-For-Arduino-Tube-Panel-Parts-Set/202718597375?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

I am powering the unit from a 1500mA USB wall socket.

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…

All you need is a resistor divider to shift the 5V detection signal to 3.3V.

http://www.ohmslawcalculator.com/voltage-divider-calculator

10K for R1, 15K for R2. Source + 5V, Out = 3V

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.

Thanks for your help guys, greatly appreciated.

1 Like