Add an Ultrasonic Sonar to the Robot Vacuum Cleaner

6,835

26

4

Introduction: Add an Ultrasonic Sonar to the Robot Vacuum Cleaner

Sonar LV-MaxSonar-EZ1 is tested.
More than one sonar can be connected such way.
Controlled by Arduino with motor shield.
Sonar is connected to analog input pin.
Project is on GitHub https://github.com/satr/Robot-vacuum-cleaner-controlled-by-Arduino-and-motor-shield

Be the First to Share

    Recommendations

    • Pi Day Speed Challenge

      Pi Day Speed Challenge
    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Microcontroller Contest

      Microcontroller Contest

    4 Comments

    0
    Mariel KateL
    Mariel KateL

    4 years ago

    Do we just copy-paste and add the code from the link above from the original code in Robot Vacuum floor cleaning robot? And also, aside from the Arduino Atmega48, what other MCU can we use as an alternative? Thank you.

    0
    revrekad
    revrekad

    Reply 4 years ago

    As far as I remember - the code by the link is fully-functional robot logic, with two bumpers and up to 5 ultrasonic sensors.

    I used only ATmega MCUs. Other people also use PIC and other controllers. MCU need enough digital and analog (ADC) pins for required amount of bumpers and sensors, also two pins with PWM.

    Probably even MCU ATtiny maigh be sufficient (e.g. http://www.forkrobotics.com/2012/04/run-arduino-code-on-an-attiny )

    If the speed of the robot not need to be adjustable - no PWM required, just two digital pins used to change motor direction.

    0
    CecilleJ
    CecilleJ

    5 years ago

    where did you connect the ultrasonic sensor.? pls hel us in making a project like this

    0
    revrekad
    revrekad

    Reply 5 years ago

    Program, by the link in the instructables, has comment on top. It describes how the sonar was connected:

    "Ultrasonic sonars can be connected to analog inputs (tested on LV-MaxSonar-EZ1):
    - put pins in array sonarPins in following order: left, right, front, others..
    Examples:
    1. only left and right sonars connected to pins 2 and 3: sonarPins[] = {2,3}
    2. left, right and front sonars connected to pins 2, 3 and 5: sonarPins[] = {2,3,5}
    3. only front sonar connected to pin 5: sonarPins[] = {-1,-1,5}
    4. only left sonar connected to pin 2: sonarPins[] = {2}
    5. only right sonar connected to pins 3: sonarPins[] = {-1,3}
    6. 5 sonars connected to pins 1,2,3,4,5: sonarPins[] = {1,2,3,4,5}"