Alright, so I've spent the last two hours scouring the internet for a wiring diagram for my Yumo E6A2-CS3E incremental encoder bought from SparkFun... but no luck. This is for a gravity vehicle project for Science Olympiad... trouble is, I write software. I got stuck into the electronics side of the competition because I'm the only one who has a chance of making it happen and my knowledge is extremely limited. All I learned from my searches is that I need a pull-up resistor on each output and the blue wire should be grounded? So, the details:
Resolution: 200P/R
Brown: 5-12VDC
Blue: 0V Common
Shield (White?): GND
Black: Out A
I have an Arduino Uno R3 and a small breadboard, along with a good handful of wires, resistors (which I can't figure out how to read) and the parts for the braking system (which I can control, luckily).
gerbilOFdoom:
Alright, so what do I need to do with the 0V wire? Ground it?
Yes, to any of the arduino ground pins.
Would the A and B outputs go in ports 2 and 3, on the Uno R3?
Pins 2 and 3, not ports which means something else. Also you can satify the need for pull-up resistors by enabling the internal pull-ups for those two pins.
Software Interrupt 0 function is triggered by arduino digital input pin 2, wired to one of the two encoder channels. Software Interrupt 1 function is triggered by arduino digital input pin 3 which should be wired to the other encoder channel.
Oh yeah! I have two Arduino's, one for each of my electronic events. I'm using an arduino to control the servos on our robotic arm and accept joystick inputs, and I'm using the other one for a gravity vehicle that has to stop itself at a certain distance. Competition coming up Saturday and I'm just finishing both
My solution to converting pulses to rotations:
Ticks/200
But I need to be able to figure out distance traveled, so
Ticks/200 = a
diameter = .12m = d
circumference = pid = c
ac= x (distance)