Accelerometer as User Input Signal: Disco Bike Light Part 3

dbl_all_layers

Welcome to another edition of “Disco Bike Light: adventures in electronic design”.  In last week’s blog I talked a little about the printed-circuit-board (PCB) design and the Lithium battery charging circuit.  This week I’ll touch more on the circuit board, and a little bit on the user interface.

First, the circuit board design went together pretty well.  I covered the concept of using end-caps to isolate my bike light circuit from the Schwinn bike light enclosure I’m using.  Last week’s blog has some Sketchup diagrams of the mechanical design.  In the image above you can see my high power RGB LED on the end-cap (circle) in the upper right of the PCB design.  On the lower right I have two high-power white LEDs.  Once the PCB is fabricated the end-caps will be cut off and mounted on each end of the PCB (see last blog for images).  I’ll build a few of these boards and try out both the colored (disco) version and the super bright white version.  The circle on the upper left is the rear end-cap, that makes sure a spring in the Schwinn bike light enclosure doesn’t short against the positive terminal of the Lithium battery I’ll be using.

DBL_bot_LAYER

In this image I’ve turned off the top layer of the PCB.  You can see my circuitry on the bottom of the PCB.  On the left-hand side I’ve got my charge circuit, then the USB connector and USB to serial converter.  On the right hand side of the board is a 3-axis accelerometer, a microcontroller, and MOSFETs for pulse-width-modulating the LEDs.  The white outline is both a top silk-screen layer and the board outline.  You can see I have a cutout to the allow the USB cable to mount flush with the USB connector.  I think I’ll have to Dremel tool away part of the battery carrier (it covers the entire top of the PCB) to ensure a good fit.

If you’ve read my earlier posts you might recall that I placed a restriction on myself to NOT destroy the bike light enclosure I was re-purposing for this project (you can see the enclosure in my first Disco Bike Light blog).  Initially I was going to try to use the bike light’s on-off button for my circuit.  The bike light uses an interesting mechanical design to provide continuity between its battery pack positive terminal, LED, and ground.  Unfortunately, I can’t replicate the mechanics without destroying some of the existing bike light.  So I need to come up with a way to turn the bike light on and off without touching it.

To do this, I’m going to try to use the analog outputs of a 3-axis accelerometer (Analog Devices ADXL335) to detect “taps”.  The circuit below is what I’ve got on the PCB.  I haven’t done this before, so I don’t have a clear plan on how to implement it.  Generally speaking a hard tap on the accelerometer should cause an abrupt change in acceleration, which in turn causes an abrupt change in the analog output of the axis associated with the acceleration.  By monitoring the analog outputs and timing I’m hoping to differentiate between distinct patterns of taps.  For example, three quick taps might be used for an on or off signal.  Four taps might change the mode of operation.  The trick will be to distinguish between these taps and normal “tap” patterns caused by riding my bike down the road.

dbl_accelerometer_schematic
Before I send of the PCB to be created I’ve decided to test the accelerometer user interface concept using some of the products we sell.  I can use our BM010 USB to serial converter as my serial interface.  And I can use the BM006 3-axis analog output accelerometer.  It has a different accelerometer IC than the ADXL335, but otherwise is very similar.  Since I’m using the PIC16F1829 microcontroller for this design I can use our PIC16F1829 based BM013 hardware and just re-design the firmware.

From a block diagram standpoint here is what I’ll be working on.  For the next week I’ll get this bread-boarded and write some test code.  If everything goes well I’ll get proof that the accelerometer can be used as a user interface, if not I’ll have to revisit the concept.
dbl_block_for_taps

Trackbacks

  1. […] last week’s blog I talked about looking into using an accelerometer output as a user interface for the Disco Bike […]

Speak Your Mind

*