Searching \ for '[PIC] Exercise Bike Computer' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Exercise Bike Computer'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Exercise Bike Computer'
2005\04\06@035114 by liam .

picon face
All,

I'm trying to workout how to approach the design of a Bike Computer.
This is not a computer for a bicycle but rather for an exercise bike
that will interface with a real computer.

The exercise bike already is fitted with a reed switch and so a sense
of wheel rotation is known. I'm of split opinions at the moment
however at the moment on whether to use a PIC onboard to work out
stats like speed, distance, RPM etc and then send this to the computer
or to only send the wheel telemetry to the computer and use software
on the computer for processing. How would others do it ?

The concept has been suggested that multiple bikes are connected to
the same computer for telemetry recording which also would influence
the decission of where to process and how to connect.

The obvious solution for connection was RS232 however most laptops
dont have serial anymore so then its a case of embedded USB support or
use USB dongles. Which would be better ??

This is a very low budget project and I wanted to be able to get this
working with a minimal of components in a short time.

I tried searching google for someone else's attempts at a similar
project however I didnt find any. If anyone knows of any, please let
me know.

Thanks


Liam

2005\04\06@044950 by Jose Da Silva

flavicon
face
On April 6, 2005 12:51 am, liam . wrote:
> All,
>
> I'm trying to workout how to approach the design of a Bike Computer.
> This is not a computer for a bicycle but rather for an exercise bike
> that will interface with a real computer.
>
> The exercise bike already is fitted with a reed switch and so a sense
> of wheel rotation is known. I'm of split opinions at the moment
> however at the moment on whether to use a PIC onboard to work out
> stats like speed, distance, RPM etc and then send this to the
> computer or to only send the wheel telemetry to the computer and use
> software on the computer for processing. How would others do it ?

Unless you are going to display stuff at the bike, you are probably best
to send raw data to the computer, which can then graph/plot or do
whatever with the raw data. If you compute values at the PIC, you may
have to uncompute values at the computer to interpret some missing
values that get lost in computation (and didn't seem necessary to send
then).
You also mentioned a time factor, so keeping it simple also gets the PIC
part out of the way quick.

> The concept has been suggested that multiple bikes are connected to
> the same computer for telemetry recording which also would influence
> the decission of where to process and how to connect.

You can bundle telemetry for burst transmission, such as multiple PICS
talking to one link, or IR transmission with repeat-due-to-error.  This
gets cables out of the way.

> The obvious solution for connection was RS232 however most laptops
> dont have serial anymore so then its a case of embedded USB support
> or use USB dongles. Which would be better ??

Some laptops have IR, otherwise RS232-to-USB converters are cheap so you
can stay with RS232.
You can still put several of your PICs in parallel on an RS232 line.
Use something like a resistor pull-up on your Computer RX line and let
each individual PIC pull-down the RX line to make zero bits.
You would have to figure out when each PIC TXes data because each one
would have to send during it's allotted time-slot.
Just keep your TX speeds low, like 300bps because you are using pull-up
resistor type 1bits versus actual RS232-type drivers which would drive
the bits high or low.

> This is a very low budget project and I wanted to be able to get this
> working with a minimal of components in a short time.

You could probably use the RS232 line at the computer to power all the
pics for the multiple bike readers. The activity required by the PICS
to compute raw data would be very low, so the PICs are mostly idle.

2005\04\06@050406 by Andrew Warren

face
flavicon
face
liam . <spam_OUTpiclistTakeThisOuTspammit.edu> wrote:

> I'm trying to workout how to approach the design of a Bike Computer.
> This is not a computer for a bicycle but rather for an exercise bike
> that will interface with a real computer.
>
> The exercise bike already is fitted with a reed switch and so a sense
> of wheel rotation is known. I'm of split opinions at the moment however
> at the moment on whether to use a PIC onboard to work out stats like
> speed, distance, RPM etc and then send this to the computer or to only
> send the wheel telemetry to the computer and use software on the
> computer for processing. How would others do it ?

   Liam:

   Do as much processing as possible on the computer; have the PIC do
   as little as possible.

> The concept has been suggested that multiple bikes are connected to the
> same computer for telemetry recording which also would influence the
> decission of where to process and how to connect.

   I'd do it the same way regardless of the number of bikes connected.

> The obvious solution for connection was RS232 however most laptops dont
> have serial anymore so then its a case of embedded USB support or use
> USB dongles. Which would be better ??

   Your application -- an indeterminate (possibly quite large) number of
   devices that need to be individually identified and accessed, and
   possibly hot-attached and -detached -- is perfect for USB.  RS-232
   is terrible for that sort of thing; if you used RS-232, you'd have to
   invent your own protocol for doing all the things that USB does
   automatically.

   Personally, I'd use USB microcontrollers instead of USB-to-serial
   dongles... But if you're already comfortable writing PC apps for
   RS-232 communications and have no experience writing USB apps (and
   no desire/time to learn), then I guess serial-to-USB dongles would be
   ok.  They'll be more expensive, though, and more cumbersome than
   straight USB devices, and your customer may have to install a driver
   on his PC.

> This is a very low budget project and I wanted to be able to get this
> working with a minimal of components in a short time.

   No big surprise there...

> I tried searching google for someone else's attempts at a similar
> project however I didnt find any. If anyone knows of any, please let
> me know.

   You may want to look at Jan Axelson's book, "USB Complete".  She
   doesn't discuss applications exactly like yours, but she does show
   how to transfer data back and forth over USB using low-cost
   microcontrollers and the HID driver that's built into every modern
   operating system.

   Information on the book (and source code, and lots of other USB
   info) is available on Jan's web site, at http://www.lvr.com .

   Good luck...

   -Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com

2005\04\06@054845 by Alan B. Pearce

face picon face
>The exercise bike already is fitted with a reed switch and so a sense
>of wheel rotation is known. I'm of split opinions at the moment
>however at the moment on whether to use a PIC onboard to work out
>stats like speed, distance, RPM etc and then send this to the computer
>or to only send the wheel telemetry to the computer and use software
>on the computer for processing. How would others do it ?
...
>This is a very low budget project and I wanted to be able to get this
>working with a minimal of components in a short time.

As you will already have a PC in the picture, then I would recommend doing
minimal calculation in the PIC, and sending the raw data, doing the
calculations in the PC, where you can get at the calculating program easier
if it needs altering.

>The obvious solution for connection was RS232 however most laptops
>dont have serial anymore so then its a case of embedded USB support or
>use USB dongles. Which would be better ??

These days USB would be the way to go - especially if you use the USB
version of an 18F. Include some form of identifier in the data from the PIC,
so the program in the PC can keep the data from a single source together in
the calculation portion (although the USB connection port may be enough of
an identifier), or else have another copy of the program for each bike.

2005\04\06@065602 by Russell McMahon

face
flavicon
face
>> The exercise bike already is fitted with a reed switch and so a
>> sense
>> of wheel rotation is known. I'm of split opinions at the moment
>> however
>> at the moment on whether to use a PIC onboard to work out stats
>> like
>> speed, distance, RPM etc and then send this to the computer or to
>> only
>> send the wheel telemetry to the computer and use software on the
>> computer for processing. How would others do it ?

If I was doing it one off at lowest cost I'd consider using a USB
connected mouse. The crank speed rate is well within the button
clicking rate of the mouse. Differentiating this mouse from the "real"
mouse may then be your greatest challenge. Cheaper than this would be
hard to achieve.

An off the shelf USB to serial converter and just using one of the
control lines would also seem like a very simple approach.

Using the PC for most of the work will minimise the cost as you have
to have the PC anyway. The largest potential problem is the inexact
measurement of the pulse rate but this can be averaged over several
cycles and is liable to be as accurate as you require.



       RM

2005\04\06@065648 by liam .
picon face
All,

I was tending toward the PC based processing because my background is
more in the computer programming area already so this is good news. As
far as I know so far there is no need for any local infomation display
at the bike and why cant the rider just look at the computer screen.

Its interesting the mention of multiple PIC's on a single RS232 port.
I was actually thinking along the lines of a serial to usb dongle per
bike and a USB hub, then the bikes could also be plugged into a
computer on an individual basis.

I would like to go down the path of USB but am concerned about the
costs involved in a programmer and software, what do other people use?
My current PIC compiler would not cope with 18F as far as i know but I
will check. What programmers would be recommended if I need to buy
another?

I'll try and get myself a copy of USB Complete

Would adding an FTDI Style Serial to USB converter chip into the
hardware be a better approach than terminating to serial and leaving
the Seial to USB open ended which would enable use on computers which
actually do have serial? (Keeping costs low except when no serial is
avaliable and then an add on expansion)


Thanks,


Liam

2005\04\06@081410 by Alan B. Pearce

face picon face
>I would like to go down the path of USB but am concerned about the
>costs involved in a programmer and software, what do other people use?

I am sure that Olin or Wouter would be able to provide info about what 18
family devices they can program.

>My current PIC compiler would not cope with 18F as far as i know
>but I will check. What programmers would be recommended if I need
>to buy another?

Check out the Microchip C18 demonstration C complier (c18). Haven't checked
to see what it does in the way of a library for the USB portion, but worth a
check. and when the demonstration time runs out you can reload it, your only
problem is that it doesn't do the great optimisations of the purchased
version, but that is probably not a problem for you as the code will be
relatively simple.

2005\04\06@084314 by Jan-Erik Soderholm

face picon face
Alan B. Pearce wrote :

> Check out the Microchip C18 demonstration C complier (c18).
> Haven't checked to see what it does in the way of a library
> for the USB portion, but worth a check...

There is a complete "COM/Serial port emulation" for those
devices. Both firmware (C code) and Windows code.
Your Windows application still opens and use a "COMx" port,
so either no change, or an easy development. I think that
there are links to the kit on the device specific web pages.

B.t.w, regarding "Exercise Bike Computer", I bought one of those
bikes some time ago. It came with an attached "computer" where you
get all sorts of data. Speed, distance, current road "profile" (up, down,
flat and so on). What I'd like to do was to build something that could
"soak" this information out from the device and transfer it to a PC.
There is no (documented) interface. The PCB has some
unconnected connectors, but I've not been able to find any
info on them, so far...

What I thought was to have a filmed sequence of some real
road, then code the up/down/flat parts, and have the PC to
dynamicaly change the brake on the bike. So you'd get the
impression of actualy riding on the real road. Well, maybe
not the project with the highest priority... :-)

Regards,
Jan-Erik.



2005\04\06@090435 by Wouter van Ooijen

face picon face
> >I would like to go down the path of USB but am concerned about the
> >costs involved in a programmer and software, what do other
> people use?

Don't be too afraid of USB. All *intelligent* serial port programmers I
know work with any off-the-shelve USB-to-serial converter. And there are
some with a build-in FT232 so they connect to USB directly. I guess it
won't be long before the first USB-PIC (18F2550 or 18F4550) based
programmers will appear.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


2005\04\06@091530 by liam .

picon face
Im trying to get a Biomechanics lab setup with bikes which is slightly
different to a just for entertainment setup but in my searchs I have
found a product that interfaces with a playstation if anyone is
interested.
http://www.cateye.com/en/products/viewProduct.php?modelId=38&catId=8&subCatId=0

I suppose one solution to my needs would be to write a playstation
game that could interface but I like my chance better with PIC's and
exercise bikes etc...


Liam

2005\04\06@103153 by Danny Decell

picon face
>
> The obvious solution for connection was RS232 however most laptops
> dont have serial anymore so then its a case of embedded USB support or
> use USB dongles. Which would be better ??
>
> This is a very low budget project and I wanted to be able to get this
> working with a minimal of components in a short time.

Pick up one of those USB=>Serial cables (got mine at Radio Shack) you can
start talking to your PIC via usb immediately. I was in a hurry to get
something tested for a friend and picked one up one night, grabbed my little
16F628 module and my Max232 converter and was talking to my PIC via USB
using an XP Pro based Windows C++ program over a VirtCom port in minutes.

The other options of course are the many FTDI based modules available that
do the same thing :) They have VirtCom support drivers as well.

- :)

2005\04\06@104227 by Alan B. Pearce

face picon face
>What I thought was to have a filmed sequence of some real
>road, then code the up/down/flat parts, and have the PC to
>dynamicaly change the brake on the bike. So you'd get the
>impression of actualy riding on the real road. Well, maybe
>not the project with the highest priority... :-)

Jan-Erik does the "Tour de France" ...

2005\04\13@163840 by Robert Rolf

picon face
K.I.S.S.

If you want dead simple/cheap, you can connect 12 reed switches to
ECP/EPP parallel port input pins (D0-7, ack, bsy, PE, SLCT) and
poll the heck out of them with the PC.

You could also use an SPP with cascaded data multiplexer
(74HC4051's) to get out to 256 sensors
and read back the reed switches using the 4 inputs available
on the standard parallel port, 4 at a time, as long as the
closure time is longer than your poll time (or throw caps
across the switches with high value pullups to create a R/C pulse
stretcher). Just remember to add series Rs & clamp diodes to the 4051
inputs to protect them from static.

Cheapest PIC solution: low end PIC bit banging serial I/O on
open collector RS232 line. Get power off RTS & DTR
since the spec says they can supply UP TO 30 mA (but a
lot of laptops cannot). Have a separate USB dongle for
those computers that do not have a serial port, and just
add a 9V battery/wall wart to power the PICs from the cable.

You can get away with higher baud rates by using a lower
pulldown value. I am using 3.3k and get 19.2k baud off an
emitter follower opto over 10 meters of cable. (opto
pulls against DTR).

Use pulldown instead of pullup since you want the line to
IDLE between characters sent by the various PICS.
RS232 idle is -12V, Mark is +12V, but anything outside
the +/- 3V band is considered 'valid' so pulling to ground
is OK. Use a common transmit line to all PICS, to poll
them, and each one responds in turn after it is addressed.

I wouldn't even bother with RS232 tranceivers on the PIC side.
2-3 74HC14 gates in parallel, with a diode and series 100R
for protection is good enough to
drive hundreds of feet of cable (as I have). One gate of the
74HC14 is used as a receiver with a series 1K resistor, 100k
pulldown and clamp diodes to rails.

You poll the devices by simply sending a byte from 0 to $FF
and they respond with a few bytes containing the number of
revs seen in the previous timing interval(s). You CANNOT trust
windows to pass you serial data in a timely manner so the
timing window MUST be done by the PIC and the returned packet
must include a PIC ID.

Lots of ways to skin this cat.
Given the likely environment, shielded microphone cable out
to the reed switches and PC with ECP port would do.

Robert

liam . wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...