Digital/Analog Cyclocomputer
BioNB 440 Final Project
Cornell University, Fall 2005

Instructor: Bruce Land

 
  Will Cukierski
wjc29(at)cornell.edu

Design

Hardware


Results


Changes


Appendix
 
     
 

The Competition

The ultimate goal for this project was the creation of a cyclocomputer from "simple" electronic parts (no microcontrollers) which would display the following:

  • Current Speed
  • Average Speed
  • Distance
  • Time

Since this is meant to be a "proof-of-concept" circuit, physical size, part count, and layout take a backseat to functionality and ease of design.

     
 
 
Design
 
  top

Kinematics tells us that If one knows distance and time, one can find the instantaneous and average speed. To measure distance, I use the standard trick of a magnet on the wheel and a Hall-effect sensor (DN6848) to output a pulse each time the magnet passes. To track time, I use an oscillator attached to a binary counter.

Average Speed
In order to find the average speed, one needs to take the total distance traveled and divide by the total time. This ruled out the possibility of using a fully analog circuit (an op amp in an integrating configuration, for instance) due to problems such as current leakage. Digitally dividing two binary numbers in hardware is difficult, so I opted to use a DAC to convert the two binary numbers into an analog voltage and divide with Analog Devices' AD633. I used a modified version of the following circuit (courtesy of datasheet):

Current Speed
Current speed gave me the chance to try my hands at analog, but also proved the most difficult to design and build. The logic goes as follows:

  1. Pass the Hall sensor through a monostable 555 (one-shot), which then outputs a pulse of fixed amplitude and duration.
  2. Send these pulses through an OpAmp integrator to keep an "analog count" of how many pulses have passed.
  3. Track the voltage with a sample-and-hold and, after a fixed time, use voltage-controlled switches to discharge the capacitor in the integrator as well as instruct the sample-and-hold to "hold."

Note that, by sampling at fixed periods of time, the division is done implicitly.

Distance
The distance is proportional to the analog voltage of the DAC on the wheel counter. I fed the DAC output through a voltage divider in order to obtain the proportionality constant between the actual distance (related to wheel size, scaled for the display) and the actual voltage.

Time
Like distance, the time is proportional to the analog voltage of the DAC on the oscillator. The circuit is equivalent to that for distance.

     

 
 
 
Hardware &
Specifics
 
  top

Careful Division
To achieve proper accuracy, I had to slightly modify the circuit for the AD633 divider. Since my signals were small (usually 10mV~1V) I inserted 10k pots into the feedback loops to correct offset caused by unmatched feedback resistors. I added a precision 10:1 voltage divider on the numerator to remove the 10V scaling factor inherent to the AD633, and added an inverting amplifier to the output to make the signal positive.

Current Speed
The design and construction of the many 555 timers required sensitive attention to detail. The pulse to sample the voltage had to come before the pulse to clear the integrating capacitor, the clearing pulse had to be long enough to allow full discharge, and the one-shot after the Hall sensor had to have appreciable length, but be shorter than the average separation of the wheel pulses in time. I inverted the input to the integrator to make the output, , positive.

DAC Output
The AD7531 DACs used in my circuit did not have an internal voltage reference or output amplifier. I supplied the former with a Zener diode and the latter with the LM358. I chose a reference voltage of -3V (negative so that the output voltage from the DAC is positive). The following table gives the analog voltage for a given binary input (N = 12 for the 7531).


(From AD7531 Datasheet)

Keeping Time
The timekeeper for my circuit is the classic 555 timer in its astable configuration, as shown below. I choose a frequency of 10Hz as a balance between accuracy (if the counter outputs only a few of its least sig. bits, the DAC output is of the order of noise in the circuit) and the memory size (circuit counts a maximum of 2^12 = 4096 clock pulses, corresponding to 409.6 seconds of operation).


The circuit schematic, separated into individual functions, is given below.

Time

Distance


Avg. Speed



Current Speed


To display the output of the circuit, I used a PM128 3-digit LCD, which takes an analog voltage in (0 < Vin < 200mV) and displays the millivolt equivalent of the voltage.


 
 
 
Results
 
  top

I was pleased to get all four parts of the cyclocomputer functioning and calibrated. The end product is reasonably flexible in the sense each function can be tuned with its corresponding potentiometer. One can change the wheel size as well as the speed (to switch between mi/hr, km/hr, or cycles/sec for instance). Whenever possible, I calibrated the circuit with a signal of known amplitude/frequency. I would estimate a 5% error on a good day, though it most likely operates in the 10-15% range. Possible sources of error include calibration errors (hand tuning potentiometers, etc.), impedance matching problems, as well as contributions from noise.

The final circuit, in all its majesty:

The (mostly) analog current speed portion of the circuit:

Waveform showing the output of the integrator. Pulse inputs ramp up the voltage until the CD4066 switch discharges the capacitor.



 
 
Changes
 
  top

As a physics major with a mathematical background in circuits, the most challenging aspect of this project was physically constructing the circuit. Here are some issues I would address if I were to do this project again:

  1. Ordering Parts: Thankfully most companies would send free samples of their ICs, as I ordered several parts which were not what I needed. For the inexperienced, navigating the datasheets can be confusing and slight differences on paper can lead to big differences in circuit performance.
  2. Power Planning: My original hope was for the circuit to run off a single 5V supply, yet I soon found that (a) my signals were too close to ground for the OpAmps to properly work off 5V and ground, and (b) that my analog divider required a much wider voltage range. The handy proto board could give me the extra negative power supply, but this would be infeasible for a battery-run bike computer.
  3. Tiny Signals: I wired the jumpers on my display to read 0-200mV, yet this forced my smaller signals into the mV realm where noise matters. Choosing a larger range, 0-2V for instance, would better minimize noisy fluctuations.
     

 
 
Appendix
 
  top

DN6848 (Hall-Effect Sensor)
AD7531 (12 Bit DAC)
CD4066 (Quad Bilateral Voltage-Controlled Switch)

SN74HC590 (8 Bit Binary Counter)
AD633 (Analog Multiplier/Divider)
LM358 (Dual OpAmp)
LMC7111 (High Input-Impedance OpAmp)
7555 (Timer)

PM128 (3 1/2 Digit LCD Display)