Difference between revisions of "Ultrasonic Sensor (HC-SR04) + Raspberry Pi"
Jump to navigation
Jump to search
m (Savannahjohnson moved page Connecting HCS04sensor with a Raspberry Pi to Connecting HC-SR04 sensor to Raspberry Pi) |
|||
Line 2: | Line 2: | ||
* Raspberry pi 3 | * Raspberry pi 3 | ||
* Ultrasonic Sensor - HC-SR04 | * Ultrasonic Sensor - HC-SR04 | ||
+ | * A set of resistors for each sensor you are connecting | ||
+ | ** 330Ω and 470Ω | ||
+ | * Jumper wires to connect the sensor(s) to the pi | ||
==Wire setup== | ==Wire setup== | ||
==Software== | ==Software== | ||
+ | ===Python=== | ||
+ | # Create a new script | ||
+ | |||
+ | # Save your script as ultrasonic_distance.py in the ~/pythonpractice folder. | ||
+ | # Open up the terminal | ||
+ | |||
+ | |||
+ | # Type cd ~/pythonpractice to change directory to your pythonpractice folder, and hit Enter | ||
+ | # Type ./hello.py and hit Enter to run your program | ||
+ | |||
==TroubleShooting the pi== | ==TroubleShooting the pi== | ||
[[Category:HowTos]] | [[Category:HowTos]] |
Revision as of 16:53, 2 May 2017
Hardware
- Raspberry pi 3
- Ultrasonic Sensor - HC-SR04
- A set of resistors for each sensor you are connecting
- 330Ω and 470Ω
- Jumper wires to connect the sensor(s) to the pi
Wire setup
Software
Python
- Create a new script
- Save your script as ultrasonic_distance.py in the ~/pythonpractice folder.
- Open up the terminal
- Type cd ~/pythonpractice to change directory to your pythonpractice folder, and hit Enter
- Type ./hello.py and hit Enter to run your program