Arduino for ODROID-GO - Ultrasonic Distance Meter
- Make sure that you've followed the Arduino setup guide.
You can have a portable Ultrasonic distance meter in your hand.
Requirements
Make sure that you have these products:
- An auxiliary battery if using it portable
- This module requires 5V input power, but ODROID-GO outputs 3V3 for the power pin(#6) on its header pins. Thus, it is required to use the 5V USB VBUS pin(#10) with an external USB power source.
- Alternatively, you can use a Step-up DC-DC converter and a level shifter.
- A MicroUSB cable
Set up the development environment for Arduino on your system.
Hardware setup
Please refer to the picture below when you set up your hardware.
We use the parts below:
- Ultrasonic sensor: HC-SR04
- Step-up DC-DC 3V3 to 12V(set to 5V for now) converter: MT3608
- Logic level converter: BSS138
- Download Fritzing example file: odroid-go-ultrasonic-sensor.fzz
- ODROID-GO: fritzing_odroid-go.fzpz
- Mini-360 DC-DC Buck converter: mini-360_dc-dc_buck_converter.fzpz
- HC-SR04: hc-sr04.fzpz
Import and compile, upload to ODROID-GO
Click the Files → Examples → ODROID-GO → Applications → Ultrasonic_Distance_Meter menu to import and press CTRL-U to compile/upload.
Uploading is complete when the message “Hard resetting via RTS pin…” is seen.
Check if it works
After the upload completes, ODROID-GO reboots automatically.
The screen shows a measured distance in inch, cm units when an obstacle is detected at the front of the Ultrasonic sensor.
If the measurement conditions are not met, such as a distance that is too far or too short, the result text on the screen will be colored red.
If it measures normally, the text will be colored green.