2

I am trying to make a laser scanner consisting of a webcam and a line laser scanner. I have tried to use a manual scanning (by hand) and has worked, but would now like to consider automating the laser rotation (upwards and downwards) as a higher accuracy entails a slow and smooth rotation.

I came across arduino a few weeks back and realised it could possibly help to make this a reality. From my limited readings so far, I have obtained an Arduino Uno and a motor shield that seems to be the essentials for my purpose.

I have a few queries that hopefully someone can help:

  1. Do I need a stepper motor for slow rotations, instead of a normal brushed motor?

  2. Do I need to connect the Arduino to computer to make it run? Can I run it off battery, if so, does it have an 'ON' button?

  3. How long will a standard 9V battery last?

  4. For the code, I thought of using the simple one here: Arduino Motor Shield Tutorial. Would it be able to allow me to control the amount of rotation, speed and the ability to reverse its rotation?

1
  • Look at the rotating muktisided mirror and LASER unit from many LASER printers - avaialable at little cosr of free from junked machines. These do more or less exactly what you want. You may need to exchange their LASER with your but they have dome the mechanical work for you. Jul 24 '15 at 9:26
2
  1. A servo motor would have a lot more control than a normal motor. You usually command them to go to one of the predefined steps (stops) by using a function call in the servo motor library.
  2. You can run independently of the computer. Many people do this. Certainly you can run off a battery. It doesn't have an ON button, you normally would have this between your battery and the Uno (eg. built into the battery pack). Like this:

Battery pack

  1. A 9 V battery? I wouldn't use one, especially to drive a motor. It won't last long. Get something like 3 x AA batteries in a battery holder.

Servo motor

To show you the idea, I have this servo motor (SG-5010) I got from Adafruit.

I measured it using about 200 mA of power when operating. Now, I looked up a typical Alkaline 9 V battery, and found that, consuming 200 mA, it lasts for around 400 mAh. Thus, you could say it would be good for two hours at that rate. Plus, the Arduino will take around 50 mA, so maybe less than two hours.

  1. A smallish servo motor won't need a motor shield. The pictures on the linked page show ordinary brushed motors. A servo motor has 3 leads:
    • Power (eg. 5 V)
    • Gnd
    • Data

Make sure you connect the grounds together, but the power could go to a separate power pack. A bit depends on how much power your motor will use. The data goes to the Arduino for the information about which rotation point to step to.

You should be able, in code, to change the rotation position, forwards and backwards.

2
  • Are you confusing stepper motor with something else? Stepper motors typically have 4 leads, two for each coil. Perhaps you are thinking of a servo? Or perhaps a stepper with a built in controller?
    – Jake C
    Jul 24 '15 at 5:33
  • Quite right. I had a brain fade then. A servo motor has 3 wires as I described. I've amended the post to correct that. Thanks. :)
    – Nick Gammon
    Jul 24 '15 at 5:37
2

Nick gives some great advice, I am trying to answer your questions more directly.

  1. Do I need a stepper motor for slow rotations, instead of a normal brushed motor?

Many kinds of motors can be made to work. I advise starting with the same type as in the Instructables you mention below. You can change the speed with gears if the motor speed range is not good enough.

  1. Do I need to connect the arduino to computer to make it run? Can I run it off battery, if so, does it have an 'ON' button?

You only need to connect the Arduino to a computer to load or change the program. The motor is probably your biggest battery user, I would connect it to a separate battery from the Arduino. One advantage of the servo motors Nick mentions is that they are used by model car and airplane enthusiasts and there are lots of motors, batteries and battery chargers available.

  1. How long will a standard 9V battery last?

Not long!

  1. For the code, I thought of using the simple one here: Arduino Motor Shield Tutorial. Would it be able to allow me to control the amount of rotation, speed and the ability to reverse its rotation?

I looked through this code and it should work well as long as you use the same type of motor. You may have to modify things if you need the stop and start points to be very precise, but this will get you started and is a big step beyond scanning by hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.