Using Cycle computer with picaxe as counter.

Rickharris

Senior Member
Manuka put forward an idea to use a cycle computer as an output device for a picaxe as a simple counter/digital display.

I have been playing with this for a few days now and have some thoughts that may be useful to others - forgive me if these are obvious but I had some difficulty in getting the results I expected from the beast!

The cycle computer normally is connected to a reed switch that is triggered by a magnet on the wheel. It has to be calibrated for the correct wheel diameter as this affects the calculations of speed/distance etc of course.
if you had not realised it the number you enter is the circumference of the wheel in mm so you don't need to just stick to those in the table they give you.

I am using a Halfords low end 4 function computer and considering the speed display.

I calculated the pulse rate for a typical wheel diameter 912.5 inches in my case) but got quite erratic results from the display up to and including the whole display going loopy:

a) It matters which way you connect the computer so get it the right way round. I connected between pin 2 and ground driving pin 2 high to trigger the cycle computer.

b) The system (or at least mine) expects to get a short pulse followed by a pause of up to 2231ms for my small wheel i.e. 1 MPH- The display blanks at about 600 mms delay or around 4 MPH - Ok I expected that as I have programmed a small wheel circ.

c) As you increase speed the time between pulses shortens and the pulse period also gets smaller although this isn't critical as long as you keep it reasonably short. - using Stan's programme where the on time was the same as the off time gave very erratic results.

d) The cycle computer maxes out at about 40 MPH or when the pulse period gets to about 60 ms. Between the top and bottom it seems fairly linear and most importantly consistent as long as you observe (C) above.

Code:
'Simple test loop to see if the calibration works
'Cycle computer set to 12.5 inch wheel or 1050mm
'5MPH=440
'10MPH=223
'20 MPH=111
'30MPH=75

start:
high 2
pause 10
low 2
pause 223 '10 MPH
goto start
The only problem is that inserting other code in this upsets the timing although the cycle computer will hold the display for a short while it soon resets back to zero with no input.
 

manuka

Senior Member
Rick- thanks for a heads up on this! My 2006 trials used a bargain Cateye Velo1 (costing just NZ$15 or ~£5) & although it ran "OK" ,considerable initial tweaking was indeed needed. Given the nature of likely applications, high accuracy seemed secondary to the applied Physics nature of the hack. Aside from the speed & distance equivalence to Amps & Amp.hours the Ohms Law based voltage measurement served to give lots of "Aha's !" (note pun!) to students struggling over applications of crazy Physics formula. Given my well known open ended educational slant (!), I rather viewed the article as a stimulator for further bright spark enhancement of course. Have any of your students run with this in fact?

Most of my testing used a 12V 1W PV & a 6Ah SLA (or 10 NiCds) & the final "SiChip" form ran well,as indicated by such reader feedback as => http://www.picaxe.orcon.net.nz/bikepcfb.jpg . An Australian off grid crowd => www.thebackshed.com have enhanced things with a PC based display => http://www.thebackshed.com/Windmill/PicLog.asp. Anyone else?
Stan
 
Last edited:
Top