Things used in this project

Hardware components:
Esquilo%20top%20small
Esquilo Air
×1
51gzz5eu9pl. sx425
HC-SR04
×1
181 02
Adafruit Standard LCD - 16x2 White on Blue
×1
09939 01
Rotary potentiometer (generic)
10k pot
×1
12002 04
Breadboard (generic)
×1
Male/Male Jumper Wires
I used: 5 red, 5 black, 2 white, 3 orange, 1 yellow, 2 green, 2 blue
×20

Schematics

Esquilo HC-SR04 1602A wiring diagram
Esquilo HC-SR04 1602A wiring diagram
Wvon49hbtkthxf2qsrml
Esquilo HC-SR04 Ultrasonic library
Port of Arduino Ultrasonic library to Esquilo
Esquilo 1602A library
Port of Arduino LiquidCrystal library to Esquilo

Code

Esquilo HC-SR04 1602A example codePlain text
Esquilo HC-SR04 1602A example code
// HC-SR04 Ultrasonic Range Finder output to 1602A LCD

require("GPIO");
require("Capture");

dofile("sd:/LiquidCrystal.nut");

trigPin <- GPIO(13);  // HC-SR04 trigger pin (output)
echoPin <- Capture(1);  // HC-SR04 echo pin (input)

trigPin.output();

local duration;
local distance;

local lcd = LiquidCrystal(0x00, 12, 0, 11, 5, 4, 3, 2, 0, 0, 0, 0);

// set up the LCD's number of columns and rows: 
lcd.begin(16, 2, 0);

while (true) {
    lcd.clear();
    lcd.home();
    trigPin.low();
    delay(2);
    trigPin.high();
    delay(10);
    trigPin.low();
    echoPin.arm(0, CAPTURE_EDGE_RISING);
    duration = echoPin.read(0);
    //print("duration=" + duration);
    distance = (duration / 2) / 29.1;
    //print("distance=" + distance);
    // Print a message to the LCD.
    lcd.print("distance=" + distance);
    delay(500);
}

Credits

27eae0443d051e9e246159707c1f2203
Leeland Heins

Hardware & Software H4x0r

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

PHPoC: Web-Based Thermometer
Easy
  • 290
  • 13

Full instructions

This project allows you to check the temperature at home from anywhere using a web browser.

Sorting Hat: Circuit Playground Express Starter Project
Easy
  • 158
  • 3

Protip

Which Hogwarts House do you belong in? A quick first project for this beginner-friendly board from Adafruit.

NeoPixel Thermometer!
Easy
  • 354
  • 5

Full instructions

Transforms a NeoPixel ring into a cool thermometer

Electronic Voting Machine Using Arduino
Easy
  • 260
  • 5

It is an EVM using Arduino. There are five switches in all, assigned for various activities.

Arduino - Web-Based Thermometer
Easy
  • 1,388
  • 18

Full instructions

This project allows you to check temperature at home from anywhere using web browser.

Retro Nokia Snake Game with Arduino
Easy
  • 4,177
  • 28

Full instructions

Ever wish you could go back to the happy 90's and play snake on your old Nokia phone? Grab on to your joystick for this blast-from-the-past.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login