Changes between Version 3 and Version 4 of ControlSystems/Electrical/Training/Arduino/Lesson5


Ignore:
Timestamp:
Oct 13, 2015, 9:08:18 AM (10 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/Electrical/Training/Arduino/Lesson5

    v3 v4  
    99When you build your mini-bot, you will mount an ultrasonic sensor on the front to help it navigate.  You can scan the environment in front of the robot by periodically having the robot turn on its axis while range finding; this will let it build a map of what's in front of it (Thanks to Ed Garner for that method!).  Other robot designs often mount the ultrasonic module [http://www.instructables.com/id/Arduino-HC-SR04-Ultrasonic-Rover/ on a servo motor] that continuously scans the area in front of the robot
    1010
    11 Potential problems: The ultrasonic sensor transmits a burst of ultrasonic sound and then listens for the echo.  The echo is received by a transducer that converts sound energy to electrical energy.  The further away the target is, the weaker the received signal will be.  To accurately measure longer distances, the sensor must be able to measure the very small voltages generated by the reflected signal and if the power supply to the sensor is fluctuating rapidly (we call that a noisy supply line) it is tough to do that (sort of like trying to hear someone whispering at a loud concert).  You can reduce the noise on the power supply lines by adding a decoupling capacitor: a small capacitor placed between +5v and Gnd as close to the ultrasonic sensor as possible.  For more information on power supply decoupling, see [DecoulingCapacitor here].  NOTE: you should use a non-polarized ceramic capacitor, however if you use an aluminum electrolytic capacitor (ask a mentor), you must observe the correct polarity, connecting the - lead to ground and the other lead to +5v...otherwise, the capacitor will turn into a firecracker.
     11Potential problems: The ultrasonic sensor transmits a burst of ultrasonic sound and then listens for the echo.  The echo is received by a transducer that converts sound energy to electrical energy.  The further away the target is, the weaker the received signal will be.  To accurately measure longer distances, the sensor must be able to measure the very small voltages generated by the reflected signal and if the power supply to the sensor is fluctuating rapidly (we call that a noisy supply line) it is tough to do that (sort of like trying to hear someone whispering at a loud concert).  You can reduce the noise on the power supply lines by adding a decoupling capacitor: a small capacitor placed between +5v and Gnd as close to the ultrasonic sensor as possible.  For more information on power supply decoupling, see [DecouplingCapacitor here].  NOTE: you should use a non-polarized ceramic capacitor, however if you use an aluminum electrolytic capacitor (ask a mentor), you must observe the correct polarity, connecting the - lead to ground and the other lead to +5v...otherwise, the capacitor will turn into a firecracker.
    1212
    1313**Exercise**: Use your arduino to trigger the ultrasonic module and convert the resulting pulse duration into a distance; change the blink rate of your LED based on the distance to the target (faster=closer).