Encoder and Arduino Uno

Sorry to post here like this, but I could not find the option for posting a new thread, maybe cause I’m just a junior member, anyways, here it is!

[size=2]Title:
DC 5-28 volt Encoder with Arduino Uno (Sweep) (Not a Servo)[/size]

Description:
Hello Everyone, this is my first posting!

I’m a newbie trying to attach a 5-28 volt dc encoder with armature (If that is what its called in this case)
beisensors.com/pdfs/H25-optical-incremental_encoder.pdf

I just purchased the Arduino Uno in the hopes that I could make the armature sweep 360 degrees right then 360 degrees left with little to no pause.

I understand that for what I’m using it for that i would at least require 12volts dc and 100mA of current.

  1. Is this task possible with the components mentioned above?
  2. Can the voltage be applied to the UNO or is it connected directly onto the encoder pin out itself?
  3. If the required motor voltage gets applied to the UNO then do I use the usb cable for UNO power too?
  4. Is there any open source code available to command the UNO for such a task mentioned above?
  5. What would the pinout allocations be from the UNO to the Encoder? (Encoder Pin options below)

Single Channel A
Dual Quad B
Dual w/index Z
Supply Voltage
Common ground
Case Ground
-A
-B
-Z
(Maybe not all the pin options are used, but I’m not sure)

summary:
So I would like to just have the armature of the encoded “sensor” to move in the direction(s) I mentioned above.

I have applied small voltage to the proper pins of the encoder/sensor and the armature moved just like a regular motor armature would, now I just need to control its movement(s)

I’m not moving anything else with it. If what I have is not made for what I need it to do, well, I am asking for help anyways. (even if the encoder/sensor/motor is not made for the task at hand)

I’m hoping someone will help me use the UNO to perform the task regardless.

Is it possible? If it is then I am all ears!

Well, Hope there is a brave UNO specialist out there willing to break this all down for a guy just starting out.
Cheers

Hi and welcome to our forum!

I didn’t quite understand your setup: do you have an external motor to move the shaft of the encoder? I don’t think that the encoder includes a motor, so I’m not sure how it would move…

If your motor runs on 12 VDC, then we would recommend using a motor shield such as the following to control the speed and direction of your motor:

The UNO can only accept voltages of 5 volts, but you can plug your 12 VDC source into the VIN pin of the Arduino in order to use the regulator to provide the right voltage; you can do this if you don’t want to use the USB cable.

If you power your optical encoder to a 5 volt power source (such as the 5V pin of the Arduino), then the encoder will also output 5V signals and can therefore be plugged directly into the Arduino’s input pins.

We would recommend the following setup:

]Single Channel A -> Arduino pin 2/:m]
]Dual Quad B -> Arduino pin 3/:m]
]Dual w/index Z -> No connection/:m]
]Supply Voltage -> Arduino 5V pin/:m]
]Common ground -> Arduino GND pin/:m]
]Case Ground -> Arduino GND pin/:m]
]-A -> No connection/:m]
]-B -> No connection/:m]
]-Z -> No connection/:m]

There isn’t any code available out-of-the-box for your situation, but large portions can be found on the Arduino website. For example, you can find good examples of reading quadrature encoders (such as yours) on this page: playground.arduino.cc/Main/RotaryEncoders

Once you have the encoder working, you will have to add a loop to your main program that moves the motor in the right direction based on the position read by the encoder. This code will be largely based on the motor and motor controller you use in your setup.

We hope this helps and thanks for choosing RobotShop,