Arduino UNO With OLED Ultrasonic Range Finder and Visuino
by RonFrtek in Circuits > Arduino
1552 Views, 4 Favorites, 0 Comments
Arduino UNO With OLED Ultrasonic Range Finder and Visuino
In this tutorial we will use Arduino UNO , OLED Lcd, Ultrasonic range finder module, and Visuino to display ultrasonic range on Lcd and set the limit distance with a red LED. Watch a demonstration video.
What You Will Need
- Arduino UNO
- Ultrasonic Range Finder
- OLED Lcd
- Red LED
- Breadboard
- Jumper wires
- Visuino program: Download Visuino
The Circuit
- Connect GND from Maduino UNO to breadboard pin (gnd)
- Connect 5V pin from Maduino UNO to breadboard pin (positive)
- Connect SCL from Maduino UNO to OLED LCD pin (SCL)
- Connect SDA from Maduino UNO to OLED LCD pin (SDA)
- Connect OLED LCD pin (VCC) to breadboard pin (positive)
- Connect OLED LCD pin (GND) to breadboard pin (GND)
- Connect Ultrasonic module pin (VCC) to breadboard pin (positive)
- Connect Ultrasonic module pin (GND) to breadboard pin (GND)
- Connect Ultrasonic module pin (ECHO) to Maduino UNO pin digital (3)
-
Connect Ultrasonic module pin (TRIG) to Maduino UNO pin digital (2)
- Connect digital pin (13) from Maduino UNO to LED pin (positive)
- Connect LED pin (negative) to breadboard pin (GND)
Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program ESP 8266! The Visuino:https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2
In Visuino Add Components
- Add Ultrasonic Ranger component
- Add Compare Range component and set under properties MAX: 9 << Add Display OLED component, double click on it and dragr "text field" to the left, under properties set size:2
In Visuino: ​Connecting Components
- Connect Arduino digital out pin[3] to UltrasonicRanger1 pin[Echo]
- Connect Arduino Serial[0] out pin[Out] to DisplayOled1 pin[In]
- DisplayOled1 pin[Out I2c] to Arduino I2C pin [in]
- Connect UltrasonicRanger1 pin[Out] to CompareRange1 pin[In] and to DisplayOled1 Elements.Text Field1 pin[In]
- Connect UltrasonicRanger1 pin[Ping] to Arduino Digital pin[2] and to DisplayOled1 pin[Refresh]
- Connect CompareRange1 pin[Out] to Arduino Digital pin[13]
Generate, Compile, and Upload the Arduino Code
In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Play
If you power the Arduino UNO module, the OLED Lcd will start showing the value number for the distance of any obstacle. If you put any obstacle near the ultrasonic module the value will change and the LED will flash.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.eu