mombro
August 21, 2024, 6:03pm
1
Hi all,
I’m not very good with this, so I need basic help I am very happy I was able to upload a firmware to my ESP32 and feel like a hero already
I want to test this ultrasonic sensor that people are talking about here:
I’ve been trying it out with one of the cheap HC-SR04 sensors. When testing it against a wall It only works up to about 1.5m (even though the spec sheet says up to 4.5m). Has anyone got one reliably working up to 2m or so?
This is mainly a PoC and I don’t need anything reliable at the moment.
But the first question is how I can get this working at all. I have it all wired up, flashed the firmware on the ESP etc., but I don’t get any sensory input.
My config looks like this:
esphome:
name: ultraschall
friendly_name: ultraschall
esp32:
board: esp32dev
framework:
type: arduino
sensor:
- platform: ultrasonic
trigger_pin: GPIO2
echo_pin: GPIO4
name: "Ultrasonic Sensor"
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "el1a4m1ePshETDxxxxxxxA7NKo/wAXECnZZwJQ="
ota:
- platform: esphome
password: "1be87d0e2cxxxxxxx2b5e0b669b2"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ultraschall Fallback Hotspot"
password: "aoeiaoeiaoeiaoeiaoeiaoei"
captive_portal:
And the flashing worked, but then looked like this:
I tried drawing a Fritzing, but there is no esp32 board with my very ordinary pin out? I tried taking some photos:
Tried to get a better picture of the breadboard:
It does show in HA, but no status of the sensor:
Any idea what I might have done wrong?
Spiro
August 21, 2024, 6:13pm
2
HI
I take it you have tried pointing the sensor at something within 2m rather than just having it pointing up at the ceiling.
Advanced options:
timeout (Optional , float): The number of meters for the timeout. Most sensors can only sense up to 2 meters. Defaults to 2 meters.
Your log says it’s a distance timeout.
1 Like
mombro
August 21, 2024, 6:24pm
3
Your answer made my heart jump a bit as I thought that would have been a very stupid mistake, but I held my hand in front of it for two minutes and also put an object in front of it with no change:
Spiro
August 21, 2024, 6:25pm
4
Good. Now double check your wiring. Breadboards are prone to bad connections.
mombro
August 21, 2024, 6:28pm
5
I moved every cable by one or two “boxes”.
Do you think I should wire it directly? I’m a bit nervous … I burnt the last ESP a week ago when I had a short circuit(?)
It looks to me that you don’t actually have a connection going on the breadboard?
And yeah, try using female->female Dupont wires and make direct connection instead.
Spiro
August 21, 2024, 6:31pm
7
Yes those 4 wires aren’t connected to anything on the breadboard
mombro
August 21, 2024, 6:31pm
8
I do have connections from the ESP to the breadboard, I highlighted them a bit:
mombro
August 21, 2024, 6:32pm
9
oh no, it is not connected from left to right?!
haha, ok:
They need to be in the same row. Try putting the ones in row 4 up to row 2.
1 Like
Nice! Glad you got it working. Btw. You shouldn’t be scared of making a direct connection, just check it carefully before powering up.
1 Like
pepe59
(Pepe59)
August 21, 2024, 6:46pm
12
According to the pictures, you do not have connected wires on the non-soldering field
trigger_pin: GPIO2
echo_pin: GPIO4
with board esp
1 Like
I think that was already established several posts ago and the issue has been solved
1 Like