Introduction
This project is a combination of an Arduino sketch and a Perl program. Existing Arduino sketches were combined and modified for the project and a Perl program created to send commands and receive data from the Arduino.
This all came about after I purchased an Arduino and started playing with and modifying some of the existing sketches. I got to thinking what if... (The rest is history.)
The project uses an Arduino to control a servo and ultrasound sensor to collect data that can be used to locate objects in a grid of cells. Essentially it is a radar (sonar) sweep of the grid cells to locate objects. The Arduino receives commands from a Perl program and returns raw data for processing.
Note: This turned out to more of a programming project than a hardware project.
What conclusions did I come to about the project (so far)?
Documentation
Why Perl and not some other language?
Calculate an Object's Location
Servo
Sensor
My Servo/Sensor Mounting Hardware
LCD
Project Hardware
Project Arduino Sketch
Project Control Program
Project NotesPerl Communication Object
communications.pm
Note: Used by the control program to communicate with the Arduino.Test Programs and Sketches
Perl Test Programs
Arduino Test SketchesDownloads
map-a-grid.zip
map-a-grid.pdfWhat Next (If I feel like it)
- Improve this documentation (polish the cannonball)
- Make the GUI better looking (it's kind of clunky)
- Modify the control program to run the ping sweep in a thread so it does not lock up the GUI.
- Modify the ultrasound sensor with (paper?) cylinders around the receiver (and/or transmitter) to narrow its detection angle.
- Test/calibrate the sensor to refine its distance calculations. I suspect that it may be slightly off.
- Add a second servo to move the sensor vertically and determine how tall an object is.
- Use a more accurate sensor. Microwave? Laser?
- Scan the grid cells. Save the occupied counts for each cell. Move the sensor to a different location and scan again. Add the second counts to the first counts. This, in theory, should increase the accuracy. Move the sensor to a third location Etc.
- Use Wi-Fi rather than connecting directly to the computer's USB port.
- Mount the Arduino, servo, and sensor on a remotely controlled vehicle (car or helicopter). I need to some way determine the servo's location (coordinates) and the servo's orientation (zero direction).
Arduino Documentation