Ultrasonic Obstacle-avoiding Robot

This is my attempt at designing and building an obstacle avoiding robot! RekaBot (named after a fairy (: ) can detect obstacles with an ultrasonic sensor that can move around with help from a servo. Based on the measurements she takes, the tracks are driven towards the direction with the biggest distance – avoiding obstacles.

Read in and try to build one yourself!

Step 1: Concept, Drawings and Preliminary BOMUltrasonic Obstacle-avoiding Robot

In this project I will tell the story of how RekaBot was built. The target is to build a robot which is capable of avoiding walls and obstacles in an infinite loop.

What do we need in order to build this bot:

  1. Zumo Robot chassis – ebay
  2. Pololu micro gearmotors 1:100 – ebay
  3. HCSR04 ultrasonic sensor – ebay
  4. SG90 servo motor – ebay
  5. DRV8801 carrier boards – pololu
  6. MC34063 DC-DC converter IC – ebay
  7. PIC18F4550 microcontroller – ebay
  8. USB socket – ebay
  9. DIP40, DIP8 IC holders – ebay, ebay
  10. Lithium-Ion batteries – ebay
  11. inductors, capacitors, resistors – local electronics shop
  12. diodes, transistors, LEDs – local electronics shop
  13. PCBs, ferric chloride, laser printer, acetone
  14. drills, bits, saw, screwdriver, hammer, pliers, tweezers, sand paper
  15. soldering iron, solder wik, solder, flux
  16. PicKit2, PicKit3, for programming
  17. multimeters for voltage and current measurements
  18. a laptop with useful software on it, printer
  19. serial to USB converter – ebay

What I had extra:

  1. heat gun to salvage components from old boards
  2. third hand for soldering components
  3. power supply for tests
  4. digital storage oscilloscope
  5. lots of components in stock for quick tests

Long story short

I started with ordering components off E-Bay and local sites, starting with the robot chassis. Nothing special here, just the fact that they shipped without the motors, this hurt a bit – I wasn’t expecting that. I found the warning on their website eventually: “no motors included!”. Of course, it had a link to a quite expensive motor, so I ended up purchasing them separately. After I got those, I assembled the chassis, and drew some initial schematics. With the schematics done, I designed the PCBs with AD14, made the artwork prints on shiny paper, etched and drilled some PCB’s, and soldered the components. Looking back, I can say that all the stuff mentioned in the two lists were really helpful, the oscilloscope in particular. It was extremely useful for debugging the PSU board, all four converters were in trouble at first power-up, but thanks to my RIGOL DZ1104, the errors were easy to locate, and I eventually succeeded powering everything up.

After I got rid of the obvious hardware problems, I used a PicKit3 to write a bootloader into the PIC. This is an important step to fast program update, not to mention, that it only needs a free USB port from the laptop, there’s no need to take your programmer everywhere. Once that was done, I ended up calculating timers, setting up time bases, and writing the C routines for the servo motor, ultrasonic range sensor, LEDs, and other stuff that needed to be handled.

When I got to a point where I was able to turn the servo at any given angle, and read an approximate distance to the closest obstacle with the HC-SR04, I developed a super-simple algorithm which leads the robot away from the obstacles. Once the testing was done, I gathered all the photos I took, all the memo-s I wrote to myself, and compiled it into this instructable for you to read and re-make. I hope you’ll find it interesting, and will try to make one yourself!Schematic In this project I will tell the story of how RekaBot was built. The target is to build a robot which is capable of avoiding walls and obstacles in an infinite loop.

For more detail: Ultrasonic Obstacle-avoiding Robot

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.