Using DHT11 + HC-SR04 Ultrasonic sensor and ESP8266 as Wifi

Hello, looks like there are issues with the characters or the
CayenneESP8266Shield.h is not copied to the cayenne libraries folder…

1 Like

can you give me libary folder CayenneESP8266Shield ?

It is already attached to the first topics of this post…

1 Like

i did add it to arduino. but it is

not work

have you disconnected the RX and TX pins of arduino during the download of
the code?

1 Like

no. i have just verified in arduino.

you have to disconnect the RX and TX pins to make the download.

1 Like

how can i do it. can you help me. please


Can you confirm that the board you selected in the Arduino IDE is the Uno board and not the ESP. Also, make sure you have the comport selected for the Uno board. Looks like COM5 isn’t it.

Then as @cassio.lucass states, you need to make sure the RX line on your Uno is disconnected from the ESP shield otherwise you have your PC and the ESP fighting over who gets to talk to your Uno.

Next if all that works and your Uno programs, but you are not connected to Cayenne, please confirm that your ESP is programmed with AT firmware and that it is a newer version.



Is it possible to apply your techniques to the raspberry pi. Specifically, I would like to use the HC-SR04 with the pi and cayenne in a garage door application. I am not aware that cayenne has opened up their interface to allow user added code.


@richard hello, of course you can, I dont have the raspberry yet but should arrive soon, all you need to do is to make the logic for the HC-SR04 inside the micro-controller and send the result value to cayenne. But, why do you want to use the raspberry as it is so powerful for such a small application? you could use an arduino nano… or similar…

Do you think it would be difficult to add on top of this masterpiece a LCD displaying the reading of the sensor? Imagine you lose WiFi and need to know the distance from a container that is sealed, simply as a backup.

you can add a LCD Double Temperature, rain, humidity on LCD with ESP8266.

but this wont work, as cayenne does not have a offline feature. when wifi is lost the code keeps looping for re-connection and no other code is run.

I see. Then I guess a solution would be to add an Arduino with a second sensor. That would also serve as redundancy safety check for the wifi sensor readings.

Of course you can, especially if you have a Uno and have the I2C or SPI interface free.

Network does not need to be active to show results of your sensors. I like this little baby.