Encoder to ramps connection

Hello list,
I cannot connect the encoders to the ramps.

I have four 42STH38-1684B (1.8º, 2.8V, 1.68A) Nema 17 stepper motors (3324-0-42sth38-nema-17-bipolar-gearless-stepper) with the HKT2204-702C1-300B-5E encoder (3531-0-optical-rotary-encoder-hkt22).

I think I have the ramps connected to the encoder according to the encoder’s datasheet (datasheet), and the indication in the github code (github), but the motor moves brusquely during half a second and then it stops.

Does anybody have any experience on how to connect this encoder to the ramps? Any tip or guidance will be very welcome (a wiring diagram of a functioning setup will be ideal). I know where the 5V wire goes, but I don’t know where the rest of the connections go. By the way, do I have to configure Arduino’s firmware in any special way? I have it configured as indicated in FarmBot’s github link.

Thanks you very much for this exciting project and your support,

I have a similar question. Im putting together my Farmbot straight out of the box for now. What wires represent the A and B wires (5V and Ground) that connect the rotary encoder to the RAMPS? Your response would be very much appreciated. Until then, I have a very nice sculpture in my yard.

A wiring diagram showing the motor and encoder wiring connections for the RAMPS board can be found on the Electronics - Plug Everything In page in the documentation.

Thank you! I wired everything in according to the diagram and the Farmbot wont calibrate. Is there something I’m missing?

A post was split to a new topic: Using hkt22 encoders

Hi Urtaki,
how do you connect the 5mm shaft of the motor with the 4 mm bore of the encoder?

@Gabriel Hope you don’t mind a question (or a few) from a diy builder? I have been collecting parts for a while and have at last started the build. I bought as5600 magnetic encoders with appropriate magnets but I am struggling to marry them up with the RAMPS. Do you happen to know if these can work or if I have bought the wrong things?

Also on the wiring diagram it only references an encoder for x1. Does this mean that the system is designed simply to trust that the x2 motor is at the same position?



I’m not familiar with the encoders you mentioned, but currently the software used across all device models does only track the X axis position as a single value.

Hi @Gabriel

Thanks for getting back to me so quickly. So the encoders you use, are they quadrature units that use a pair of staggered square waves with direction determined by which one leads the other?

And just for clarity, only one of the x motors is encoded?



Hi @urtaki

I know it’s been a few years since this post but…did you have success with your farmbot and if so can you give me any information at all about your encoders and wiring? Did you get them to work?



Yes. By default, FarmBot Genesis v1.2 (which uses RAMPS) only uses one A and one B signal per axis.

Hi @Gabriel , thanks again for your reply. The wiring diagram specifies four connections from the encoders to the RAMPS A,B,AQ and BQ. Can you tell me what the other two are for and where they come from?

Sorry to keep taking your time, I know you are probably very busy, I have been trying to get in for from other users but to no avail as yet



@Itanc1, I’ve addressed this in this reply to another of your posts :slight_smile: