I have an ESP8266 Wemos D1R2 Board with a JSN-SR04T-2.0 ultrasonic range finder and everything works perfectly when I have the device connected to my computer USB or via a 12V battery into the onboard regulator via the external power jack. However when I use a 240V AC to 12V DC transformer to power the setup my readings become quite erratic. I have checked the voltage coming out of the power supply (12.48v) and the voltage going to the sensor (3.28V, I have it coming off the 3.3V pin) and it is the same on each type of power supply so the onboard regulator is working. Can anyone advise what might cause this? The transformer provides 1A which is more than enough as I have measured the peak usage at <100ma
In what sense are your readings "erratic"? You need to explain.– MichaelTJul 15, 2019 at 5:53
In the working config I get consistent values for the distance that when converted from the echo time match the tape measure I have between the sensor and the test object. In the erratic version the measurements vary considerably, e.g. for an object 150cm an erratic sample would be 107, 58, 86, 107, 36cm– AndrewJul 15, 2019 at 6:49
So the power supply is a switching supply and my sensor is housed in a small aluminium case as it needs to live outdoors and I found that if I connected the case to earth on the same circuit the readings are consistent and correct, I assume this may be something to do with RF from the switching supply don't understand why and could have that totally wrong– AndrewJul 15, 2019 at 11:31
The JSN-SR04T-2.0 ultrasonic range finder is rated to 5Volts. giving it 3.3 volts may not be enough. from my limited knowledge it should work if you give it a separate power supply and not depend on the 3.3 volts of the ESP.
According to the datasheet here: jahankitshop.com/getattach.aspx?id=4635&Type=Product it is rated 3-5V. Note that once I pulled the device out of the aluminium case it has been working fine– AndrewAug 26, 2019 at 22:03