Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Algebra anyone?

Status
Not open for further replies.

Electric Rain

New Member
Okay, this IS electronic related. I'm creating a digital speedometer for a bicycle. I plan to use a PIC to do the math, a four digit LED display to show the MPH in XX.XX format (E.G. 12.39 MPH), two buttons to select the tire diameter to make it universal and some kind of reed switch with a magnet on the tire or something like that to detect the tire rotation.

My problem is, the math part of it. Now, I don't mean to talk myself up, but I'm pretty good with algebra, and I'm still having a lot of trouble with this. I need to figure out the formula for this so I can put it into the PIC.

I need to calculate the MPH of the bike tire based on the diameter, and the seconds per rotation of it. I've come up with many formulas, tested them, and found out they were wrong. I know I have to multiply the diameter of the tire, to get the circumference. In my case, the circumference of the tire is the amount of distance the bike will travel in a full tire rotation.

I know it's possible to figure it out. The MPH of the bike based on the circumference and the seconds per full tire rotation. I just don't know the formula. I know the formula for it based on circumfrence and rotations per second however. But, that doesn't do me any good because it would be extremly inaccurate as the sensor can only detect ONE rotation and not 1.5 or even 1.99. It would only actually read once per second. So can someone please help me figure out this formula? Thank you very much.

Rain
 
to make it more accurate, you could have 2 sensors mounted on the tire and divide your circumference by 2.

lets just assume 1 sensor for now, with a RADIUS of 10 inches. your circumference is 2 * pi * r (lets call this C). and say it takes 1.5 seconds to make a revolution. you divide C by time which gives you inches per second. Then you just have to convert to mi/hr divide C by 12 then divide again by 5280 (12 in in one foot, 5280 ft in a mile). Now you multiply is by 3600 (60 seconds in a minute, 60 minutes in an hour)
I double checked the values above with the units converter on my calc. and I get an answer of 2.38 MPH.
or combining all that junk gives you a multiplication factor of .05681818181818181818181818181 (it repeats)
Is that what you were looking for?


Glad to see another Bush supporter. :D
 
T= Time (Seconds) To make a revolution
D= Diameter (Inches)
Pi= Pi 3.14159....
C=Circumference(miles)
MPH=Miles Per Hour
S=D/T
----Formulas
C=((pi*D)/63360) //This is the miles you travel in one rotation.

MPH=((C/T)*3600)

Ok Here it is in easy to understand terms.
EXample:
T=.5 seconds
Diameter of Tire= D=26inches

C=((pi*26)/63360)
C=0.00128

MPH=((0.00128/.5)*3600)
MPH=9.21

and 1.5 seconds would be
MPH=3.07

This is basically what the person above said but in more easy terms to understand and shows the forumulas to use. As you see it uses the basic science forumla Speed=Distance Divided By Time.
 
Thank you very much guys. I've got the formula all set now. Now I just have to learn how to actually program the PIC, and I'll be on my way. :) Does anyone have any good suggestions on a PIC that would do well for this? Thanks.

Rain

Also, jrz126, what would consist of adding two sensors and about how much more accurate would it be?
 
Electric Rain said:
Thank you very much guys. I've got the formula all set now. Now I just have to learn how to actually program the PIC, and I'll be on my way. :) Does anyone have any good suggestions on a PIC that would do well for this? Thanks.

Look on the EPE website, they did a project for a speedometer for any wheeled vehicle, it was in 1997 and called PIC-Agoras. It was adjustable in software to any wheel size, and used a 16C84 - the requirements on the PIC are quite low.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top