3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Google Bike

Step 4Arduino

Arduino
«
  • IMG_0868.jpg
  • googlebike_schem.png
Google bike uses an Arduino to relay sensor data to the computer.

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 StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
5
Followers
2
Author:braingram