Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By RobotPandaRocket
#93054 Hello,

A while back, I built a small solution to measure my 5t rainwater tank. It's a esp8266 running esphome with a waterproof SR04 attached. I'm currently only measuring the first tank as it's near a powerplug. The next tank is about 7m further away. I won't be able to reach it with the SR04 cable (~2m). For a different project, I started experimenting with using Cat6 cables to extend sensor cables (DS18b20 in the other case) which worked really well.
For the SR04, I thought it'd be easiest to mount a small box with the small eletronics board close to the tank and then run the two signal + 5v + gnd back to the main esp8266 by the first tank. I connected each of the twisted pairs to one of the four needed lines (trigger/echo/5v/gnd). For testing, I'm using a Wemos D1 Mini, powered via usb. Now to the problem:
When I connect the wires and start up the Mini, nothing happens. When I start it without the 5v connected (side note, same behavior on the 3.3v pin) connected, it boots up and gives 0cm measurements. If I then plug the 5v in, the measurements are correct.
I'm not particularly knowledgable about electronics. My very amateur reasoning was that the long cable creates a higher-than-spec amp draw which kills the Wemos. Is that correct? What can I do to prevent that? My currently only plan would be to put the 5v behind a mosfet and switch it 'live' only after a few ms after boot.

much appreciated
User avatar
By RobotPandaRocket
#93080 Here's a schematic:

Image

The 5v pin actually only spits out 4.6V, so there's essentially no voltage drop across the 7m cable.

I then kept the ech/trg wires attached via the 7m cable, and used short jumper cables to run 5v + gnd directly from the wemos. Same issue! It still crashed. As before, if I boot without the 5v attached, it starts. I can then add the 5v wire and the measurements are correct. Interestingly, if I boot with 5v + gnd (via short jumper wires) but WITHOUT the echo/trg (7m cable), it also boots ok. I can then attach these two and the measurements start.