One-third of the Smart Tank that our group [INSERT TEAM NAME HERE] made in the v4LAB Summer Camp at Ryerson University. When the button is pressed, the LCD would display the distance from the ultrasonic sensor to the object (water).

You literally just plug everything in and download the code into the arduino. The LCD should display the distance from the sensor to the object in cm.

Login to post a comment...

andrea 2 years, 1 month ago

hey Zenden, good project!! a couple of inputs: 3 points: - the LCD cable layout is wrong... - the formula for the distance is not so precise... - in some cases the echo should be reset in order to unstuck from the 0 value output. 1- /* VSS = GND VDD = 5V V0 = Contrast adj *RS Register select => 4 R/W LCD 1 => GND *E Enable Signal => 6 DB0 - DB3 not connected *DB4 Databus line => 10 *DB5 Databus line => 11 *DB6 => 12 *DB7 => 13 Led + (3.3v) Led - LiquidCrystal lcd(RS, E, DB4, DB5, DB6, DB7); // Which pins will be used */ LiquidCrystal lcd(4,6,10,11,12,13); 2- distance = duration/5.882; 3- // reset echo pinMode(2,OUTPUT); digitalWrite(2,LOW); delay(120); pinMode(2,INPUT);

ariakesra 2 years, 10 months ago