A key part of the JamSentry is the encoder. This is a wheel that rides against the filament. As the filament moves, the wheel spins. Slits in the wheel spin and variations in light intensity tells the JamSentry that the filament is moving.
We’ll start off by making the wheel. For this you will need:
- 3D printed encoder wheel
- 2x 2x6x3 microbearings
- a short piece of 3/4″ heat shrink tubing
- a 10mm piece of 3mm filament for the wheel axle (or you can print it, but that is kind of a pain)
Start by making sure that the slits in the wheel are open. The encoder works by passing light through the wheel slits, so if any are blocked, it will cause false readings. Sand out any imperfections in the groove.
The next step is to give the wheel a rubber surface. This is optional, but I think the extra grip for the wheel prevents false alarms.
Place the wheel inside of the 3/4 tubing.
Then use a heat gun (a hair dryer will also work) to shrink the tubing around the wheel.
Using a razor blade or sharp knife, trim away the extra rubber from the sides. Trim the sides so they are flush with the edges of the wheel. Make sure there are no nubs or protrusions that would cause the wheel to hang and not spin.
Next go ahead and snap a bearing into each side of the wheel.
Place the wheel inside of the encoder body slot and line up the wheel axle to the round hole. Insert the 10mm piece of filament as the axle. Actually anything can be used as the axle, but it should be non-conductive since it is sandwiched between two boards.
When completed, the wheel should spin freely. If you look through the square hole in the encoder body, you should be able to see the slits move past the window. You can put the encoder body away for now.
Next we need to solder the parts together. First we should prepare the backplane. First you need to solder a 1×4 male header to the back of the board as shown.
If you don’t intend to use this as a hardwired runout sensor then you are done with preparing the backplane. Otherwise, you will need to solder the 2N3904 transistor, the 66K resistor, and the 2 pin right angle header to the board. Since most printers use 5V control signal, those components translate between the ESP8266’s 3.3v electronics and the 5V control signals. Solder the transistor and resistor as close to the board as possible as they must fit in the corresponding holes in the encoder body.
We are now ready to assemble the unit. The unit will have the ESP8266 board on one side and the luminosity sensor board on the other side. Besides monitoring the sensors and hosting the website, the red LED on the ESP8266 forms one half on the optical encoder circuit. The backplane goes on the back and connects everything.
The parts snap into place on the encoder body with the circuitry facing inward. They only go one way.
Insert a 1×6 right angle header into the tsl2561 board (the Vin pin has no header since we use the v3.3 header). The plastic parts should face outward. Don’t solder anything yet. Snap the board and header onto the encoder board.
Insert a 1×8 right angle header into the esp8266 board. The Rx and Tx pins aren’t attached to. In this case the plastic part of the header faces the esp8266 board. Don’t solder anything yet. Snap the board onto the encoder body.
Finally slide the backplane board down over the headers, Once all connected, then solder everything together.
Trim off the long leads (don’t cut the 1×4 header). The encoder is assembled.
Finally go ahead and insert it into the cowling. The 4 pin header emerges from the slot in the back. Attach with 2x 8mm M2 screws or similar. Make sure the screws are not so long that they penetrate the encoder wheel cavity.
If you plug it into power and check the website (in this case 192.168.1.250), then you can see that the filament sensor is working. The stepper sensor still isn’t connected, but we will get to that next. Note: turning the wheel won’t register anything at this point. It won’t poll the sensors if they are not both present.
The next step is to build the magnetometer sensor.