loading
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 
<p>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. </p>
<p>As far as I remember - the code by the link is fully-functional robot logic, with two bumpers and up to 5 ultrasonic sensors.</p><p>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.</p><p>Probably even MCU ATtiny maigh be sufficient (e.g. http://www.forkrobotics.com/2012/04/run-arduino-code-on-an-attiny )</p><p>If the speed of the robot not need to be adjustable - no PWM required, just two digital pins used to change motor direction.</p>
<p>where did you connect the ultrasonic sensor.? pls hel us in making a project like this</p>
Program, by the link in the instructables, has comment on top. It describes how the sonar was connected:<br><br>&quot;Ultrasonic sonars can be connected to analog inputs (tested on LV-MaxSonar-EZ1):<br> - put pins in array sonarPins in following order: left, right, front, others..<br> Examples: <br> 1. only left and right sonars connected to pins 2 and 3: sonarPins[] = {2,3}<br> 2. left, right and front sonars connected to pins 2, 3 and 5: sonarPins[] = {2,3,5}<br> 3. only front sonar connected to pin 5: sonarPins[] = {-1,-1,5}<br> 4. only left sonar connected to pin 2: sonarPins[] = {2}<br> 5. only right sonar connected to pins 3: sonarPins[] = {-1,3}<br> 6. 5 sonars connected to pins 1,2,3,4,5: sonarPins[] = {1,2,3,4,5}&quot;

About This Instructable

5,459views

25favorites

License:

More by revrekad:Another cardboard robot-vacuum-cleaner controlled with Arduino How to create 3D model of mechanism 3D models of gears for 3D printing 
Add instructable to: