this is my first instructable.in this instructable I'm going to show a simple project to measure the distance using ultrasonic sensor and i2c LCD adapter. I'm using i2c adapter as it uses only 4pins for connecting to LCD display. let's go into the project!!!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Things Needed
- lcd i2c adapter
- arduino uno/mega
- ultrasonic sensor hc 04
- male to male jumper wires
- male to female jumper wires
Step 2: Connections:-
- lcd i2c adapter connections:-
- the lcd i2c adapter consists of four pins and they are connected to arduino as:-
The connections to ultrasonic sensor as follows:-
TRIG PIN ---->D10
ECHO PIN ---->D11
Step 3: Unzip the Lcd I2c Library
extract the above zip file into the arduino>libraries. then you can include liquidcrystal_i2c library into your code.
Step 4: FINDING THE ADDRESS OF I2C ADAPTER
first we have to find the address of the i2c adapter.So, let us find the address of the adapter.
to find the address we will use the wire library. run the code of i2c scanner then you will get the address of the i2c adapter
Step 5: Final Code:-
after findingthe i2c address we will run the code linked with this instructable.We have to replace the address in the Liquidcrystal_I2c (address,20,4);
then run the code and your project is done. that's it!! completed a project in 15 min!!
for more instructables please subscribe my channel. for more info contact me in fb:- fb.com/vnpavankumar24