Nicolas Villar sent me a sample of the PepperMill, a new sensor board he and Steve Hodges designed at Microsoft Research in Cambridge, UK. It’s a nifty little board. You attach a DC motor and the board can an output voltage when the motor is turned, and analog signals telling you the direction and speed of the motor. It turns a DC motor into a rotary encoder, of sorts.
Wiring is very simple. The motor connects to the two spring connectors at the top of the board. Direction and Speed pins connect to two analog inputs on your microcontroller. Ground connects to your microcontroller’s ground. The motor generates voltage when you spin it.
The direction pin outputs close to 2V when the motor’s going one direction, and 0V when it’s going the other direction. To read this, use an analog input and look for a value. If its 0, it’s going one direction, and if it’s above 0,it’s going in the other direction.
For more info or to get a board, contact Nic and Steve in Cambridge.
Here’s the circuit:
And here’s the code:
[include file="../../code/Arduino/PepperMill/PepperMill.pde" clean="true"]