Arduino - Awesome Project, Need Help

Okay, here's me... I'm fairly new to Arduino. I've got some motors and sensors to work (not accurate reading, but working). I understand bits and pieces of code. I learn extremely fast if I know what I'm doing.

Here's my goal... My goal is to create a 3D image using Arduino and the open source rendering program called Blender. The first step is getting everything working with Arduino, then using the Blender/Python API to build a 3D image (automatically based upon data from Arduino).

Here's my plan... (Imagine you have an object in front of you) (Now imagine you have a robotic arm controlled with motors using Ardunio). On this arm you have a couple sensors -

1) To measure distance from an object I have close range IR sensors (Infrared Proximity Sensor Short Range - Sharp GP2D120XJ00F -sparkfun). For this example lets tell the IR sensor always to stay 2" and perpendicular from this object at all times.

2) I need a sensor to measure xyz coordinates - that talks to the IR sensor - that calculates the xyz coordinates on different parts of this object.

3) This data has to be recorded and input into Blender using Python

4) As the IR sensor measures distance - and as the 3D sensor measures coordinates based off these distances - I have a camera (CMOS Camera Module - 640x480 - sparkfun) that will take jpeg snapshots of the object as readings are taking place. I then import the jpegs into coordinates within Blender. Blender then takes both the coordinates and jpegs that places them into their corresponding positions.

5) The motors must pan front-back, left-right, always staying perpendicular and 2" away.

This project must be: Automated and done within a decent amount of time

I'm asking for help - If this is possible - Which I highly believe it is (with some hard work). Am I missing anything, and if this was your project, where would you start.

PS. There's more to this project, but I think this is enough for now.

I'm asking for help - If this is possible - Which I highly believe it is (with some hard work). Am I missing anything, and if this was your project, where would you start.

Nope, just the hard work and at the beginning by researching how to achieve the objective.

Is this project :- a) a commercial enterprise b) a university project


It's an idea that's been taking over my mind for about 6 months. I've been researching how to do it, and Arduino is the defiantly the answer. No, its not an enterprise or school project, its a personal project. I'm currently in my senior year of chemical engineering - wish i had taken electrical or mechanical - then i could make it a school project.

I'm asking for help - If this is possible - Which I highly believe it is (with some hard work). Am I missing anything, and if this was your project, where would you start.

Personally, I would start with something simpler, but if you are intent upon doing something of this complexity, I would instead approach it in a different manner.

First, mount your object to scan on a turntable, which can be rotated by a specific and accurate number of degrees, perhaps via a geared-down stepper motor with optical feedback. This stepper should be controllable by the Arduino.

Then mount a red laser and cylindrical lens to project a thin vertical line on the object being scanned. This laser should be controlled to be able to turn on/off via the Arduino.

Orient a multiple-element single line CCD imager with lens such that it looks at the area where the line is, but at an angle; the Arduino would be connected to the sensor, and to another device that can pan the sensor back and forth by a certain small number of degrees. Basically, you are using the CCD as a 2D scanner in this manner.

Now, your process would be:

1) rotate the turntable w/ object by small amount. 2) turn on laser 3) scan with the CCD (serial output from the CCD to Arduino) over the area where the laser is, noting changes in brightness levels, this should give you (with further processing) a silhouette line values. 4) turn the laser off, and scan again (maybe with a controllable RGB light?) to get color values for the line/area for your texture. 5) stream all the data to the PC for further processing, etc for 3D extraction. 6) repeat steps 1-5 until the object makes one revolution on the turntable.

No need for a complex arrangement of a mechanical robot arm, 3D sensors, etc - all of which will only lead to errors and frustration, not to mention a really fuzzy object.

People have done something similar to the above, but using a PC web camera instead of a CMOS line imager and Arduino, etc - I was just trying to apply the same principles, but within the limits of the Ardunio. Even so, it would still be a challenging project...

Good luck, whatever method you decide to use!


Oh - btw; the CCD should be a black and white imager, outputing (in a serial method) voltage levels corresponding to the grey-scale value of the pixel being imaged in it view. Since it is grey-scale, you could rig up three laser - red, green, and blue (the blue one will be $$$$) - and image it three times, then use the values from the CCD obtained to gain the color of the image (like they used to do old-school back in the day with image digitizers by taking 3 images with filters); then you would easily get the silhouette values and the texture values...


Thanks cr0sh for the input. The rotatable turntable is a great idea. But I’m limited to about 180 degrees of rotation. I plan on having the “arm” fully rotate 180 degrees. maybe a few degrees more, but not much. I really like the laser idea… To add to the complexity factor - I have a Color Light Sensor Evaluation Board/Senor that needs to plot a line between different colors. Is this still possible with the laser method, and if so how accurate would it be compared to actual jpeg images?

Another question… Is a mechanical arm going to give me a scratchy image? And if so, staying within the ~180 free degrees of rotation what other “turntable” “arm” methods are there?

I should have specified the following: suppose I’m imaging a cube: I only need to image the back, top, left and right planes.

You can use a line scanner from here(; Then put it on a vertical track so it can move up and down.

Is a mechanical arm going to give me a scratchy image?

I assume you mean low resolution, the answer is yes.

There a few problems with your original proposal, most of which boil down to accuracy and precision.

Your distance sensor will not give you a very accurate reading, it will also suffer from the fact that the returned value will not be a spot value but taken over quite a distance. It will also give you a different reading if the target area is sloping with respect to the sensor, this will change as the cosine of the angle of tilt. All this is subject to what type of distance sensor you use.

Your sensor that returns the XYZ coordinates of the robot arm is a bit of a fantasy. Although you could deduce these values by counting the pulses you send to the stepping motors that position the arm.

Thanks mike. Your right, from the beginning, i knew that precision was going to be my biggest enemy. I have a sharp sensor 3cm - 40cm (see 1st post for part #) Last night I calibrated it using an equation generated by reproducing the plot given in Sharps IR datasheet: It seems to give fairly good readings, that is as long as the object is perpendicular. I just bought 2 more of the same IR sensors (3-total). In my head, I plan on setting them up side by side ||| with the outermost sensors angled - in the same direction, but reflected. The side view would look something like this \ __ / (but flipped horizontally). The angel (say 20deg.), for the outter IR's, will be such that they read to the left and right of the center IR.

Assuming all 3 IR's are calibrated the same, I can use the center IR as the initial reading - use the reading from the left IR (2 readings = 2 points = 1 line) find the slope of the readings between the left and center IR. I will average the slope it into the center IR reading - doing the same with the right IR for a more precise reading. This would allow me to scan angled objects more accurately.

I know it might take a more powerful-precise distance sensor - to get an accurate reading. But this is worth a try.

My question now is - will the mechanical arm be to "jittery?" If not, are there any good, accurate motors out there that can get this job done. Precise movement without a lot of torque. I know there are people out there that achieve the type of movement. Need an answer, in the meantime (this weekend) I will give my 3 IR theory a test on angled surfaces. Thanks everybody for bringing up some very good points!


If you use a stepping motor it should be good. At 200 steps per revolution it is probably going to be much finer resolution than you can get from the sensor. You can always go to a geared stepping motor or for micro stepping if it is not enough. One motor drive allows you to micro step at times 16, so that gives you 3200 steps per revolution. That's more than enough for an IR sensor.

You have to watch out using three sensors together with regards to one sensor interfering with the other so you will need to turn one on take a reading turn it off and then do the other two in turn.

I'll make sure to do that, that didn't occur to me. I have a couple more sensors on route to the house... when I get everything assembles, I'll do tests to measure accuracy. Thanks for the motor specs. Can anybody recommend a brand of motor? After I get these IR sensors working I need to get 5 degrees of freedom working. The heaviest amount of weight it needs to support at any given time is 0.5 lbs.

Thanks Mike, Justin

The heaviest amount of weight it needs to support at any given time is 0.5 lbs.

But as this will be in effect on the end of a stick it will be multiplied, leavers and all that. I think you will end up needing quite a powerful motor.
You don’t say where about in the world you are.
Try these people

You may want to look at:

I believe it has been posted before. It work BEAUTIFULLY!! I've tested it with a stationary statue using a contractors line level duct-taped to a tripod... It was not professional quality mind you, but with refining and more practice (and having an automated scanning system as opposed to hand scanning) will produce much much better results.

You can combine rotation of the object with multiple passes of the laser to get a full 360 degree model with damn nice accuracy (compared to 4 or 5 figure professional systems)

Here's an example of what you can get with a good rig: