Thursday, November 12, 2009

Reverse engineering

So after the hassle I decided to reverse engineer the optical paper roller position sensor so that I can fake it digitally. I attached a set of wires to it to see what was happening:

After running oscilloscope I determine what each wire did. Only two of them had a changing signal when the wheel turned - we've got a 2 channel encoder. This is what the wires represent:

  • BLACK (pin 1) - ground, 0V
  • BROWN (pin 2) - channel 1
  • BLUE (pin 3) - +5V
  • RED (pin 4) - channel 2
  • ORANGE (pin 5) - +3.3V
  • YELLOW (pin 6) - the other side of the LED

The sensor has pretty much the same layout as Avago's AEDS-965X. Here's a picture off that item's PDF file:

So what was left was to desolder the sensor and attach proper wires I could fake my own signal on:

Now with wires there I could start generating a circuit. I spent a better part of the night trying to make it work. It tended to just crash the printer. Finally I realized it was an electrical problem - I was drawing way too much current from the +5V source - apparently there's a really weak current pump behind it.

I also realized that my motor-on sensor was not working 100%. After fixing that it started working like a charm. Here's the basic circuit I used:

So can I print stuff now? Not really. The printer has some really fancy mechanics inside of it. I think it runs the motor at several power levels and expects it to get stuck on some gear or lever. As that doesn't currently happen it eventually ends up in an error. I'm not really sure how to fix this properly as I didn't take any proper measurements or recordings on how the printer actually is supposed to behave. There are lots of gears and systems inside it and I didn't really investigate how they all work in unison.

So more to do. Perhaps I still do need a second version of that printer so that I could properly observe its workings in its prime to replicate them.

But all in all I believes this reverse engineering and sensor faking was a success.

No comments:

Post a Comment