Do I need a motor encoder to control speed or can I just use a DMCC?
A motor controller on its own can control speed and direction of a motor. An encoder is used to either read the counts of the motor which can give distance traveled or speed. Note that even though you might have two identical motors, one might rotate slightly faster than the other; using encoders (with a microcontroller) takes care of that.
Thanks that clears it up for me.
How do you connect an encoder to the pins on a Pi?
The output from an encoder tends to be 0V or 5V, so you need to check if the Pi’s pins can accept 5V. If you find it’s 3.3V, you can check to see if they are 5V tolerant and if not, you’ll need a logic level shifter.
Thank you!
Could not find any documentation on the encoder included in this product: RB-ESM-03
Any idea what each of the colors in the ribbon mean?
Red and black are likely the motor pins (apply 6V to see if the motor turns).
The other four would be associated with the two sensors - we do apologize for a bit of a lack of documentation about this.
We’ll contact the manufacturer to see if they can provide some info and get back to you here as soon as we receive a reply.
RB-Spa-879 should be fine, but the other one changes the signal to I2C, which you don’t need.