I am using a Wemos D1 mini clone. I have connected two DHT11 temperature/humidity sensors and have it displaying output via WIFI (using “Web Server: Display Sensor Readings (Table)” from Build Web Servers as a model).
When connected via USB, it functions properly. When I disconnect it from USB and power it directly to the 5V pin, the web page is displayed but the readings show NAN.
The data leads from the sensors are hooked to D5 and D6. All positive power leads connected to the 5v pin and ground to gnd.
When off the USB, I am powering with a 3.3v 5v power supply module using the 5v service and connecting to the 5v pin on the board
When using the power supply, the LEDs on the sensors both light and the input voltage seems proper.
Any thoughts on why the sensors work when connected via USB but not when powered over the 5v pin while everything else seems to function fine would be appreciated.
Also, when on the power supply, I get console log messages but no longer can access the serial monitor. Is there an easy way to access the serial monitor over WIFI when not connected via USB?
I think it must be one of the following scenarios: or the sensor is not wired properly, or the power supply is not enough for the sensors (which I don’t think it’s the case).
Are you connecting GND to the sensors? There must be something missing in the wiring.
The Serial Monitor communicates with the ESP8266 via Serial Communication using the USB cable. When it is not connected to your computer, it can’t establish that connection, so you can’t see the Serial messages. You would need some hardware like a display to be able to see the messages.
I hope this helps.
Thanks for your thoughts. I am connecting the GND to the sensors. This is supported by the fact that they work when powered by USB from the computer and that the LED light come on when connected. I am more suspicious of the power supply delivering adequate voltage and will do some further testing on that. It is interesting that the web server works but that the sensors don’t, and especially that everything works when connected via USB.
Yes, it is weird. And these issues are complicated to troubleshoot. The most probable reasons are either the power source or the wiring.
Otherwise, without further information, it is very difficult to find out what might be wrong.
Meanwhile, if you find something, please share it.
Check with a volt meter the real voltage on power supply, when everything should be working without the USB, probably you’ll get a voltage much lower than expected
I went back and did some further testing. I also measured voltages.
First, I hooked it up with the USB. Everything worked. Voltages were:
5v/gnd on D1 board – 4.40; vcc/gnd on 1st sensor – 4.48; vcc/gnd on 2nd sensor – 4.47; 5v/gnd on power module – 4.47 (the module is wired in the circuit but no power attached)
Next, I disconnected the USB and added power to the power module. Now sensor 1 works and the sensor 2 does not. Voltages were:
5v/gnd on D1 board – 4.68; vcc/gnd on 1st sensor – 4.71; vcc/gnd on 2nd sensor – 4.72; 5v/gnd on power module – 4.72
Next I swapped out sensor 2 for a spare. Now everything works!
I am at a loss for what happened. The voltages seem fine from the power supply. Seems like the sensors may be sensitive to voltages in some way. Thanks Sara and Jose for your help. I’m just glad everything is working.