As you can see in the tutorial video, the address for our I2C module is 0X27, so we will use that value in our Sketch to communicate with it.

We will use the “NewPing” library to communicate with the HC-SR04 ultrasonic range sensor.

We are also using the “NewLiquidCrystal” library in our Sketch, this library unlike the one included with the Arduino IDE is more recent, faster and can use the I2C bus, so might as well use it.

You can download the libraries at the bottom of this tutorial page.

*Rename the original LiquidCrystal folder in the Arduino/Libraries to something like LiquidCrystal_Old before extracting the NewLiquidCrystal library, since the folders have the same name, and the original library will conflict with this new one.

4 Comments

Harry:
Thanks for letting me know! I’ve gone ahead and updated the links. They should be functional now!

shaun ewing- Jan 30, 2017

mine will not read past ping 3. its accurate to that pint and that’s it plz help

Alejandro Davila Ibarra- Jan 30, 2017

Read the entire document and very well explained and written. I was pleased with the results and how easy it was to follow step by step. All links worked and so did the code provided. HIGHLY recommend others to try.