-->
Page 1 of 1

Can I use the Sonoff Basic for this project?

PostPosted: Thu May 07, 2020 1:40 am
by AhmedBahgat
Hello Everyone

I need to do a small project that will stop a motor based on a certain distance then activate it again if the distance changes

I will get the distance reading using Ultrasonic sensor HC-SR04 for which I need 5V, GRD, and 2 x GPIOs

Can I connect the HC-SR04 to the Sonoof Basic, I will provide external 5V to the sensor, so all I need is 2 X GPIOs on the Sonoff basic, can I use GPIO 1 and GPIO 3 if I flash the sonoff with ESPHome or I have to use other GPIOs because #1 and #3 are the TX / TR pins?, please bear in mind that I update the sonoff firmware over the air with ESPHome

And if so, how can the sensor's reading controls the Sonoff relay automatically On/Off and based on the changing distance?

Your help, directions, and insight will be very much appreciated as I am really new to this stuff

Cheers

Re: Can I use the Sonoff Basic for this project?

PostPosted: Sun Jun 07, 2020 4:25 pm
by AhmedBahgat
Hello

I did the exact same with Sonoff basic and ESPhome using GPIO 1 and 3 and it is working


Cheers

Re: Can I use the Sonoff Basic for this project?

PostPosted: Wed Jun 10, 2020 2:34 pm
by AhmedBahgat
Yes indeed, it is working great

Cheers matey