ARDUINO!
Servo Sweep! ( DIY 3D Scanner )
An idea I had was to create my own 3D scanner using two servos and a range finder. In this case the range finder is a SHARP GP2D12 sensor I had purchased some time ago.
The principal is simple, rotate 180 degrees left to right and up and down and record the respective distance at each position.
The first exercise was to scan the shape of a book (seen left). The results (seen in the slideshow below) are grainy at best, but did work to some degree. The reflective nature of the table gave incorrect distance readings and also when recording the distance of sharp angles. The end result was the SHARP GP2D12 is too crude a measurement sensor to yield accurate results.
The second idea was to "take a picture" using a photoresistor. Using the same setup I replaced the SHARP sensor with a photoresistor wrapped in tape to give a narrower field of site. This also proved ineffective, but required further testing. The results can also be seen below in the temperature graphs.
The principal is simple, rotate 180 degrees left to right and up and down and record the respective distance at each position.
The first exercise was to scan the shape of a book (seen left). The results (seen in the slideshow below) are grainy at best, but did work to some degree. The reflective nature of the table gave incorrect distance readings and also when recording the distance of sharp angles. The end result was the SHARP GP2D12 is too crude a measurement sensor to yield accurate results.
The second idea was to "take a picture" using a photoresistor. Using the same setup I replaced the SHARP sensor with a photoresistor wrapped in tape to give a narrower field of site. This also proved ineffective, but required further testing. The results can also be seen below in the temperature graphs.
FIles included in the zip file (below)
readArduino3.m
The code to be run while the arduino runs through its "sweep". Collects the data and saves it as "test.mat". WARNING, will overwrite previous "test.mat" so save it with another name if you desire to keep it!
servo_sweep_range_xyz2.ino
Code to be uploaded to the Arduino. It will run upon powering and output three values and a delimeter (a new line ). The respective values are for left-right angle then up down angle and finally the analog value recorded ranging from 0 and 255 ( for 0 to 5V, which greatly relies on the sensor value meaning). Check the code to see what pins should be connected to what.
sweep_processor_xyz.m
Schematic uses a SHARP GP2D12 sensor This interprets the saved information retrieved. The example "test2.mat" included will show the example scan I did. This converts the three points of information ( both angles and a respective "distance" ) into a 3d graph. Should be noted I got the value meanings from the GP2D12 datasheet, but they may vary between devices. Worth checking.
sweep_processor_xyz_2.m
This schematic uses a PHOTORESISTOR wrapped in a piece of electrical tape with a small opening in the front (like a cheap aperture). The example file "test.mat" is the data I received from the sensor. It was a picture of a door but its very unclear and rather ineffective.
test.mat & test2.mat
Two example tests I created.
readArduino3.m
The code to be run while the arduino runs through its "sweep". Collects the data and saves it as "test.mat". WARNING, will overwrite previous "test.mat" so save it with another name if you desire to keep it!
servo_sweep_range_xyz2.ino
Code to be uploaded to the Arduino. It will run upon powering and output three values and a delimeter (a new line ). The respective values are for left-right angle then up down angle and finally the analog value recorded ranging from 0 and 255 ( for 0 to 5V, which greatly relies on the sensor value meaning). Check the code to see what pins should be connected to what.
sweep_processor_xyz.m
Schematic uses a SHARP GP2D12 sensor This interprets the saved information retrieved. The example "test2.mat" included will show the example scan I did. This converts the three points of information ( both angles and a respective "distance" ) into a 3d graph. Should be noted I got the value meanings from the GP2D12 datasheet, but they may vary between devices. Worth checking.
sweep_processor_xyz_2.m
This schematic uses a PHOTORESISTOR wrapped in a piece of electrical tape with a small opening in the front (like a cheap aperture). The example file "test.mat" is the data I received from the sensor. It was a picture of a door but its very unclear and rather ineffective.
test.mat & test2.mat
Two example tests I created.
|
<---- DOWNLOAD
|
Arduino Recieve InformationI included a list of of what the ascii characters represent if you wish to interpret more than just numbers.
|