The code for the Arduino UNO + W5100 + HC-SR04


#1

This is my code for HC-SR04.
Distance is measured in cm.

Cayenne-HC-SR04.txt (2.3 KB)


ULTRASONIC SENSOR hcsr04
#2

Awesome, thank you for sharing it with the community. Do you have any plans in mind for that sensor?


#3

hi @tad.dvor,

Woohoo! Thanks for sharing this :slight_smile: I have this sensor and now you make it easy for me to connect it with your code.

-B


#4

I have not any plans.
Tadeas


#5

The code for Arduino UNO + W5100 + HC-SR04 + OLED.

Cayenne_HC-SR04_OLED.txt (2.1 KB)


#6

The code for ESP8266 and HC-SR04
I used a converter logic levels between ESP8266 and HC-SR04.

Cayenne_ESP8266_HC-SR04.txt (1.6 KB)


#7

The code for Arduino UNO + W5100 + HC-SR04 + 16*2 LCD.

Cayenne_HC-SR04_LCD.txt (2.1 KB)


#8

Nice project Tad.dvor!

    I would like to know if this code will also work on an Arduino Mega or do I need to change the code and can you let us know which LCD display you used for this project? Thanks

#9

With Arduino MEGA should also work.
s-l300


#10

Let us know if you make anything @futureoils :slight_smile:

~Benny


#11

Great!!!
It works perfectly I have adapted it a bit to let it work on a USB connection (I do not yet have a WiFi Shield). You have to remove all the writes on the serial port.

Thank you very much for sharing.

Paolo


#12

Glad to here @paolo.capitelli. If you create a project, share it with the Cayenne community :slight_smile: