Printer optical encoder for steering wheel

Hello,
I am trying to build a FFB gaming wheel using an optical encoder from hp printer as a sensor, but the sensor is directly on the printer's main board. I've cut off the sensor part from the board, but the problem is that I can not find the Rx and Tx pins on the board (I know where they are directly on the sensor).

So can I desolder the sensor from the printer's main board and connect it directly to my arduino?


(the part is already cut off in the picture)

You need to figure out what sort of optical sensor you have. It may be a simple beam break one, in which case there's likely 4 pins - 2 for the LED and 2 for the photosensor. What does the part look like that passed through the slot in the sensor?

I don't know if you can desolder it or not. Does the sensor LED have a resistor in series with the LED? If so, you will need a similar resistor for your project. What voltage was the original sensor using for the LED?
IF you can find the specifications for the sensor, you may be able to just connect it, but it will be a big unknown if you can't find out more about it.
I doubt if connecting it directly to an Arduino will hurt the Arduino, but may kill the sensor.
Paul


this is the part

I can't find any more information about it, I think the sensor LED has a resistor in series, but I have no idea how to measure it's resistance

It's not clear in the photo so I looked around and by searching for C9016 80039, I got a better picture:


Hopefully you can just make out that around the edge of the clear disc is a set of very fine graduations. I'm guessing that the sensor is therefore a beam interrupter type. If that's the case, then there may well be 4 (or 5 pins) for the sensor. Two will power the LED through one of those surface mount resistors. If there's some processing electronics inside the sensor, then there may well be 3 pins (power, gnd and signal), but if it's a dumb sensor then there may only be 2 pins.

I'm not sure I understand this. Can you not wire directly to the sensor, or do you want to keep the hacked off bit of board to help mount the sensor.

You mention Rx & Tx. If your terminology is the same as mine, then Rx (receive) & Tx (transmit) imply some sort of bi-directional communication with the sensor. I would have thought that unlikely, and it's more likely that you will get a stream of pulses coming from the sensor that correspond to the beam being interrupted by the dark strips on the edge of the clear wheel.

That then begs the question, how do you determine direction?

How many pins are there on the black blob slot sensor in your first photo?

Most all SMD have the value printed on them. Use a magnifying glass.
Paul

That is a good question. The HP printer control would already know the direction because it was controlling the direction.
Paul

5e8e0cb332b0cbe21c8100457bb85febc392d8d2_2_500x499
as you can see on the picture middle two pins (which I can't find on the sensor's board) are connected to the arduino's Rx and Tx pins, I could desolder the sensor from board and connect directly to arduino with jumper cables, but i don't know if it is safe. or will it even work like that?

Maybe i'm missing something here, but the sensor board in your initial post is visually completely different to the one you've just posted.

If the sensor in your latest post is wired up as you've shown it, then that may suggest a level of intelligence within the sensor module that can handle serial communication (hence your reference to Rx & Tx). That assumes, of course, that pins 0 & 1 are being used for serial comms and not just discrete logic levels for pulses and a direction.

the one in my initial post is the sensor i got, the other one is from internet, just to show you how I want to wire my sensor to arduino.

there is only a square on it

Can you post a photo of the bottom of the board. I don't think you are going to be able to interface with the ex-printer sensor in the same way as the one in your latest diagram.

6 pins. At a guess i'd say that the square pad (bottom one of the column of 4 pins on the left) is GND. I'd also hazard a guess that the 2 pins on the right are for the emitter LED and that R336 may be the current limiting resistor for that LED. That leaves 3 pins. One will be some sort of supply - probably 3V3 or 5V. You could see where capacitor C213 connects to in case it's a decoupling capacitor. That may indicate the power pins.

That leaves R333 and R337. Are they the same value I wonder (i.e. same number printed on the top)? Could they be pull-up resistors for an I2C device?

I should have asked this earlier, but is there any writing on any side of the sensor itself that may hint at a part number or manufacturer?

R333 has three lines on it, R337 has a square.

R333 = 111, which may be 110R.
R337 may be a 0 as in zero ohm resistor.

Any identifying marks on the actual sensor?

80003 963 on side

when I wire + and GND like in picture, the sensor's LED lights up.
there are three pins left, now I need to know which two of them are going to arduino's 0 and 1 pins.

OK, let's be clear here.

Wherever you found that picture on the Internet, it is total nonsense!

You do not wire simple sensors to the Tx and Rx pins on an Arduino.

The sensor output - we have yet to determine in the current to-and-fro conclusively whether it is one or two "phases" but as Paul_KD7HB points out, the printer itself has determined the direction, so there is actually no need for a second channel to determine that.

You will then have one output to connect to an I/O pin - not Tx or Rx on the Arduino. Even on a Leonardo where Tx and Rx are not connected to the USB interface and are actually available for other serial communications.

1 Like