Step 4Arduino
First wire up all the sensors to the Arduino. See the attached schematic for a graphical representation of what I'm about to describe. You are free to change the wiring to your hearts content, but be warned! The cadence sensor must be attached to digital 2 or 3 as it is used to trigger an intterupt. Also, be sure to make any corresponding changes to the arduino sketch.
Attach one wire (it doesn't matter which one) from the cadence sensor cable to ground and attach the other to digital input 3.
Next wire up the joystick. Connect:
- Arduino-5V to VCC on the breakout board
- Arduino-GND to GND on the breakout board
- Arduino-Digital-2 to SEL
- Arduino-Analog-0 to VERT
- Arduino-Analog-1 to HORZ
Upload the googleBike.pde sketch to the Arduino. Briefly, the sketch...
- defines an interrupt routine with crappy debouncing that increments a rotation counter
- configures serial communication
- configures digital input 3 (the cadence sensor) as an interrupt
- sets sensor pin directions and pull-up resistors
- every 10 milliseconds, relays the joystick status and rotation count over the serial connection (which travels over the usb cable)
I've also attached a svg file that contains a mounting braket for the arduino that is similar to the one used for the joystick. Beware! The mount quickly broke because I didn't put in little cross-bars to reinforce the crappy glue joints. If you decide to cut this yourself I suggest either adding reinforcements or redesigning the mount.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|














































