Giter Club home page Giter Club logo

ultrasonic-sensor-control-system's Introduction

Displaying distance data from an ultrasonic sensor onto a LCD with C and a Raspberry Pi 4.

A project that periodically displays the distance data from an ultrasonic sensor to a LCD as "Dist: 0.00cm." For GPIO pin mapping, I used WiringPi (Made by Gordon Henderson under GNU-LGPL) to simplify. Link: http://wiringpi.com/

WiringPi Note: The author has discontinued public releases of WiringPi. The last update was 2.52 for the Raspberry Pi 4B. Although WiringPi is preinstalled on Raspbian systems, the code for installation is as follows:

sudo apt-get install wiringpi

Use:

gpio -v

to check if your version is 2.52.

For more details visit http://wiringpi.com/download-and-install/

To upgrade, visit http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/

Hardware components used:

  • (1) HC-SR04 Ultrasonic Sensor
  • (1) I2C LCD1602 Module
  • (8) Male to Female Jumper Cables
  • (1) Breadboard
  • Raspberry Pi 4B Rev. 1.2

Voltage Usage Note: The Raspberry Pi in this project is using the original power supply to support both 5V components. It is not recommended to use anything else since the Pi may not have enough voltage left over, causing restarts of the Pi.

When compiling the code, run the following commands in terminal at the location of the file:

sudo bash
gcc UltrasonicSensorInfoOnLCD.c -o UltrasonicSensorInfoOnLCD -lwiringPi -lwiringPiDev
./UltrasonicSensorInfoOnLCD

This project was possible through an electronics kit I purchased from Freenove that provided me with all of the components I used. If interested, it is the "Freenove Ultrasonic Starter Kit for Raspberry Pi" (FNK0024).

ultrasonic-sensor-control-system's People

Contributors

christophermilian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.