Introduction: Sonar Room Mapper - MAKE Course
This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
This Inscrutable will take you through all of the steps necessary to build your own sonar powered radar device. The final product will uses a sonar range finder and a stepper motor to map out nearby objects.
Step 1: Step 1: Aquire All Materials
This project will call for the following materials:
1 X Arduino Uno
1 X HC-SR04 Ultrasonic Ranging Module
1 X IIC 1602 LCD
1 X EasyDriver stepper motor driver
1 X Nema 17 stepper motor
1 X breadboard
1 X 12V battery pack
1 X DC-47P Heavy Duty Electronics Enclosure or other box
various wires and jumpers
Step 2: Step 2: Design Your Box in CAD/printing
Since this project will require several 3-D printed parts its recommended to mock up the entire project in CAD software. You will need to design (from left to right) the wire adapter, the shaft adapter, the sensor mount and the sensor base.
Wire adapter: This part is designed to hold the revolved contacts in it and allow the top housing to rotate a full 360 degrees without loosing contact or tangling wires. It is simply a disk with several grooves in it to lay the contacts. There is an extruded ring on the bottom to all it to be press fit into a similarly sized hole in the box. The adapter also has through holes for all 4 contacts and the shaft.
Shaft adapter: This is simply a piece to connect the drive shaft of your motor to the rest of the part being driven. Using an adapter gives you a lot of flexibility in manufacturing for different set ups and safety if your part strips out.
Sensor mount: This part is where the sonar sensor is mounted onto. For ease of printing I made this part separate from the sensor base with a simple threading to connect them. Remember when designing this that the plastic will shrink and plan your mounting holes accordingly.
Sensor base: This part connects the shaft to the sensor mount. It has a slot in the bottom for the shaft adapter and is threaded on top for the sensor mount. There are 4 through holes that correspond to the revolved contacts in the wire adapter and will hold the pins for the contacts. This design could be improved by routing the wires through the inside of the base.
Printing is not really of the utmost important on this project, simply make sure the parts fit together and don't have any large impurities.
Step 3: Step 3: Design Your Control System
The control system for this project can be seen in the image. The arduino board and stepper driver are both powered by an external battery pack. The adruino controls the stepper driver, the range finder and the lcd display. The output to the stepper is just going to be a constant speed which it will correlate to the distance to get a location of the object. It will then display this on the lcd display. Wire the stepper driver into pins 8 & 9 and the sonar range finder into pins 12 & 13. The lcd display gets plugged into analog 0 & 1.
Step 4: Step 4: Write the Arduino Sketch
The meat of the programming for this project was to correlate the revolutions and sonar pings to a location. It uses an integer to count the number of steps the motor makes then relates that to an angle. It uses this angle and the pings distance to plot the location on the lcd. This current coding has that section commented out and replaced with displaying the distance and angle. That was because the lcd I planned to use didn't work and I was forced to use a much smaller screen that could handle the matrix.
Step 5: Step 5: Assemble and Enjoy
All that is left to do is put the thing together. Strip some wires and lay them in the recesses in the wire adapter. Use either brushes or pins in the housing to complete the contact, making sure the wires are wrapped in the direct the head is going to be spinning. Press fit the lcd screen and secure the motor in place, everything else can simply be placed in the box. You're project is done, enjoy watching it map the area around it!
We have a be nice policy.
Please be positive and constructive.