Searching \ for 'Speedometer Project' 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/index.htm?key=speedometer+project
Search entire site for: 'Speedometer Project'.

Truncated match.
PICList Thread
'Speedometer Project'
1998\10\21@001644 by Robert Rowlands

picon face
I have been trying to do a speedometer for a Tech project.  The teacher
wanted us to use a PIC, however he doesn't know much about them himself
ie(Learning with us.)
I'm going to use the pic16c84, and was wondering if anyone knows where I
can get any examples of using TMR0 (Input Capture).

Also  any circuit diagrams for interfacing to TMR0 and to a Serial LCD.

PIC beginner



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

1998\10\21@004201 by James Cameron

flavicon
face
Robert Rowlands wrote:
> I'm going to use the pic16c84, and was wondering if anyone knows
> where I can get any examples of using TMR0 (Input Capture).

G'day Robert,

I want to do this as well, let's work together.  By mail or telephone is
fine ... to avoid annoying the others on the PIClist.  ;-)

With a 16C84 you would need to use TMR0 as the time base and use RB0/INT
as the speed sense.  You can't calculate speed without knowing time.

I've been thinking about this for a couple of days, so your request is
quite timely.  Let's talk.

--
James Cameron                                    (spam_OUTcameronTakeThisOuTspamstl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\21@082153 by Geoff Wootton

flavicon
picon face
James Cameron wrote:

>G'day Robert,
>I want to do this as well, let's work together.  By mail or telephone is
>fine ... to avoid annoying the others on the PIClist.  ;-)

Is this true?  Would this discussion cause annoyance to others?

My vote is it would not. Any other views on this?

Geoff.

1998\10\21@090131 by James Cameron

flavicon
face
Geoff Wootton wrote:
> Is this true?  Would this discussion cause annoyance to others?
> My vote is it would not. Any other views on this?

We're an anarchy, not a democracy!  Votes don't count.  ;-)

(To be honest, I was saying to the Robert Rowlands, "Hey, if you don't
_really_ want to talk to all and sundry, I don't mind if we go off into
a quiet corner somewhere and nut it out, and only come back to the group
when we strike a problem.")

--
James Cameron                                    (.....cameronKILLspamspam@spam@stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\21@101555 by chuck

flavicon
face
I'd like to be included in the discussion as well.
I'm working on a modification to my serial display module product to
allow it to be programmable from any pic programmer with In-Circuit
Programming capability. One of the projects I planned on creating as
sample code was a speedometer but have just started working on it. I
plan to offer a list of free code as a means of selling serial displays.

---Geoff Wootton <woottongspamKILLspamISDUX1.BHAM.AC.UK> wrote:
>
> James Cameron wrote:
>
> >G'day Robert,
> >I want to do this as well, let's work together.  By mail or
telephone is
> >fine ... to avoid annoying the others on the PIClist.  ;-)
>
> Is this true?  Would this discussion cause annoyance to others?
>
> My vote is it would not. Any other views on this?
>
> Geoff.
>

==
Chuck Hellebuyck
Electronic Products
Check out our Large Character Serial LCD Modules!
See our new Serial Keypad Modules!
http://elproducts.com
.....chuckKILLspamspam.....elproducts.com

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

1998\10\21@113929 by Rob Wentworth

flavicon
face
At 10:48 AM 10/21/98 +0100, you wrote:
>James Cameron wrote:
>
>>G'day Robert,
>>I want to do this as well, let's work together.  By mail or telephone is
>>fine ... to avoid annoying the others on the PIClist.  ;-)
>
>Is this true?  Would this discussion cause annoyance to others?
>
>My vote is it would not. Any other views on this?
>
>Geoff.

I would like to read this discussion also. Thanks.
 ----------------------------------
 Rob Wentworth,  Software Developer
 612/757-5829      fax 612/757-4792
 What we attend to becomes reality.

1998\10\21@115355 by kfisk

flavicon
face
Chalk up a vote for keeping the discussion here.

> James Cameron wrote:
>
> >G'day Robert,
> >I want to do this as well, let's work together.  By mail or
> telephone is
> >fine ... to avoid annoying the others on the PIClist.  ;-)
>
> Is this true?  Would this discussion cause annoyance to others?
>
> My vote is it would not. Any other views on this?
>
> Geoff.
>

1998\10\21@122305 by Adam Bryant

flavicon
face
I also am interested in this as I have been working on a similar project
lately.
It uses a 16C84 and displays the measured RPM on a 10 segment LED in steps
of 500 RPM.
The enclosed "C" program is my implementation (I haven't actually tried it
yet so
there may still be minor errors in the code).

The comments in the "C" code should be fairly self explanatory.

/* RPM PIC guage.
* In this project, a PIC will measure the RPM of a 4 cylinder, 4 cycle
motor
* and display the RPM on a 10 segment LED with each LED representing 500
* RPM for a usable range of 1000-5500 RPM.  The display will be updated
* every half a second.
*
* TMR0 will be used as a counter and will use as input the RA4/TOCK1 pin.
*
* The PIC used will be a 16C(F)84 with pin assignments as follows:
*
* RB0-RB7  -> pins 1 through 8 of the LED
* RA0-RA1  -> pins 9 and 10 of the LED
* RA2-RA3  -- currently not used
* RA4      <- RPM pulse input from the engine
*/

char make_bits( char num )
{
   char ret = 0, i;

   for ( i=0; i < num; i++)
   {
       set_bit( STATUS, C );
       asm RLF     _ret_make_bits,F     //ret_make_bits refers to the
"ret" variable in this function
   }
   return(ret);
}

void main( void )
{
   char count;

   // Setup section, no interrupts, prescaler to TMR0, TMR0 assigned to
RA4
   INTCON = 0;                         // no interrupts of any kind

   set_bit( STATUS, RP0);              // set up OPTION and TRIS registers
   OPTION_REG = 0xA1;                  // no portb pullups, TMR0 to RA4,
prescaler assigned to TMR0,
                                       // prescaler set to 4.

   TRISA = 0x10;                       // RA4 input, all others output
   TRISB = 0x00;                       // PortB, all output
   clear_bit( STATUS, RP0 );

   for(;;)
   {
       // Measure RPM for 1/2 second
       TMR0 = 0;
       delay500();                     // delay 500ms

       // Convert reading and display
       count = TMR0;                   // get reading/4 (/4 is effect of
prescaler set to 4).
       count--;                        // subtract 1 to get number of
LED's to light.

       PORTB = 0;                      // Clear currently displayed LED's
       PORTB = make_bits( count );
       PORTA = PORTA & 0xFC;           // Clear currently displayed LED's
       PORTA = PORTA | make_bits( count - 8 );
   }
}


Please feel free to provide any feedback (critical or otherwise).  I am
also interested in seeing
schematics of circuits that would provide the RPM pulse from the engine.  I
have one I found on
the web somewhere, but it seems overly complicated.

Also, for powering the PIC and the LED's in this circuit, can I just use a
7805 regulator connected
to a convenient 12v line (probably coming out of the fuse box)?  Or do I
need additional
circuitry to protect from spikes and brownouts?

Thanks,
Adam

1998\10\21@123920 by Dave VanHorn

flavicon
face
> Please feel free to provide any feedback (critical or otherwise).  I am
> also interested in seeing
> schematics of circuits that would provide the RPM pulse from the engine.

This can get a bit tricky. Modern cars have systems like coil per
cylinder that make the old technique of tapping off the ignition points
rather difficult to implement. Basically, find a signal somewhere that's
at least  periodic with the RPMs. You'll need to protect the pic from
nasty transients here, but much depends on where you take the signal
from.

> Also, for powering the PIC and the LED's in this circuit, can I just use a
> 7805 regulator connected
> to a convenient 12v line (probably coming out of the fuse box)?  Or do I
> need additional
> circuitry to protect from spikes and brownouts?

Most certainly you do.  The max input of those regs is 35V, and you can
get transients in BOTH polarities approaching 400V, so a fuse in series
with the supply, followed by a 30V zener would be a very good idea.
During cranking you can typically see 9V or less, so be sure your
power-on-reset will handle a non-monotonic rise in VDD.

1998\10\21@145231 by Ken Kaarvik

flavicon
face
>Chalk up a vote for keeping the discussion here.


Me too.

I've thought of doing this also. How would you pick up the input pulse?
Perhaps a couple of magnets glued on a drive axle and use a hall effect
sensor. Or maybe an infered LED and a shiny sticker. Are there any other
practical ways.

I've seen pictures of cars (in car magazines under going performance
testing) with a sensor that points down at the ground. I'm assuming it is
measuring speed. Anybody know how it works ?

Ken Kaarvik
EraseMEkkaarvikspam_OUTspamTakeThisOuTaxion.net

1998\10\21@151112 by Dave VanHorn

flavicon
face
> I've seen pictures of cars (in car magazines under going performance
> testing) with a sensor that points down at the ground. I'm assuming it is
> measuring speed. Anybody know how it works ?


Doppler microwave I suspect. That would work fairly well, although you'd
have to compensate for the mounting angle. (cosine error)  Pointing
directly down will give no apparent speed.

The magnets on the driveshaft approach was used by Zemco, in all their
aftermarket cruise controls. It works well, as long as you use a strong
magnet and large pickup coil to allow for variations in positioning
during operation.

1998\10\21@164119 by Russell McMahon

picon face
-----Original Message-----
From: Adam Bryant <adam_bryantspamspam_OUTEMAIL.MOORE.COM>
> * In this project, a PIC will measure the RPM of a 4 cylinder, 4
cycle
>motor
> * and display the RPM on a 10 segment LED with each LED
representing 500
> * RPM for a usable range of 1000-5500 RPM.  The display will be
updated
> * every half a second.


For RPM half a second can be a long time - I suggest faster would be
better if possible (it should be).

>Also, for powering the PIC and the LED's in this circuit, can I just
use a
>7805 regulator connected
>to a convenient 12v line (probably coming out of the fuse box)?  Or
do I
>need additional
>circuitry to protect from spikes and brownouts?


Automotive loads and power sources create all sorts of nasty spikes.
There are a number of regulators created primarliy for these
applications - the LM293X series are one such.



regards
           Russell McMahon

1998\10\21@164127 by Russell McMahon

picon face
One common form of speed sensors use a magnet on the speedometer
cable. This is detected either by a hall effect device or reed
switch. Pulses per kilometer are from about 500 to 5000 depending on
design. Devices which screw onto the gearbox in series with the
speedometer cable are readily available. (Cost is about $NZ40 up
(about $US20)).

From: Ken Kaarvik <@spam@kkaarvikKILLspamspamAXIONET.COM>
To: KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
>I've thought of doing this also. How would you pick up the input
pulse?
>Perhaps a couple of magnets glued on a drive axle and use a hall
effect
>sensor. Or maybe an infered LED and a shiny sticker. Are there any
other
>practical ways.


Possibly radar.
A while ago I repaired anumber of Radar units off Massey Fergusson
tractors.
These were mounted at an angle of 45 degrees to the ground and told
the ploughing computer how fast the tractor was REALLY going (as
opposed to how fast the wheels were turning).

>I've seen pictures of cars (in car magazines under going performance
>testing) with a sensor that points down at the ground. I'm assuming
it is
>measuring speed. Anybody know how it works ?
spamBeGonekkaarvikspamBeGonespamaxion.net
>

1998\10\21@164733 by Steve Smith

picon face
Sensing the rotations of an prop shaft is reasonably simple using a magnetic
reluctance sensor positioned close to the fixing bolts connecting the
propshaft to the back axle. This gives four pulses (4 bolts) for each rotation
of the shaft this can be calculated into road speed when you know the
circurmfurence of the tyre and the raito of the axle of by counting the number
of pulses for a known number of rotations of the wheels (you need to rotate
them both at the same time). It also has the added benifit of registering the
speed when driving backwards.....

Disadvantages of optical sensors in this enviroment is Grime ect but magnetism
cuts through the grime and the pulse is simpler to count as it is not as bad
to debounce as a reed switch. Try an ignition sender off a large jap bike they
are basicly a coil of wire on a magnet. the pulse will go positive as the
leading edge of the bolt pases and negitive by the trailing edge this gives a
nice pulse with a few parts.

Cheers Steve..............

1998\10\21@190317 by kfisk

flavicon
face
Know of any suppliers?

{Quote hidden}

1998\10\21@191559 by Tony Nixon

flavicon
picon face
Adam Bryant wrote:

> I am also interested in seeing
> schematics of circuits that would provide the RPM pulse from the engine.

Have a look at the web site below. There are some links to a
programmable ignition system, PIC coil drivers, using a PIC to monitor
ignition pulses from a coil. There are thousands of these that have been
on the road for over 2 years now, so they work ok.

If I can help in any way, let me know.


Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
**New Improved PicNPost**

http://www.picnpoke.com
Email RemoveMEpicnpokeEraseMEspamEraseMEcdi.com.au

1998\10\22@051347 by Nuno Pedrosa

flavicon
face
Hi! I also would like to be in this discussion. I also want to build a
Speedometer, but with a distance measurement in 10 meters resolution.
It's the same hardware anyway.

Bye,
Nuno.

Rob Wentworth wrote:
{Quote hidden}

--
   .^.                                              _,^,_         /\
___( | )_____ Nuno Filipe Freitas Pedrosa __________ o(`} | , __/\/ /__
/*\\|//*\    SIEMENS S.A. Portugal                  (]|  /'    \ \/\
\(\\V//)/    RemoveMENuno.Pedrosaspam_OUTspamKILLspamoen.siemens.de     (]|`%   (") \/\ \
 ` -=- '     Tel.  :00351-1-4242454         (")      /`/        / /\/
__B//|\\P___________________________________________\' / `/______\/____
   `-' "Try and leave this world a little better than you found it..."

1998\10\22@094648 by cesar

flavicon
face
Hi all,

Please join me in this matter, Im working on that too :), and the Im
new in PIC's things

Thanks

Cesar E. H. White
New Tech

Date sent:              Tue, 20 Oct 1998 20:57:46 PDT
Send reply to:          pic microcontroller discussion list <RemoveMEPICLISTTakeThisOuTspamspamMITVMA.MIT.
EDU>
From:                   Robert Rowlands <EraseMErobrowlandsspamspamspamBeGoneHOTMAIL.COM>
Subject:                Speedometer Project
To:                     RemoveMEPICLISTKILLspamspamMITVMA.MIT.EDU

{Quote hidden}

1998\10\22@094655 by Ryan David Pogge

picon face
I was also thinking of doing something similar, except a also wanted to
add an accelerometer that will measure g's and also be able to do 0-60
time, and 0-100 time ad such.


On Thu, 22 Oct 1998, Russell McMahon wrote:

> {Original Message removed}

1998\10\22@095941 by WIL REEDER

flavicon
face
Hi James and all

I am interested in this project as well.  This would be a great little
piece to have on the boat. Pulse type senders are readily available so this
could be very similar to your project.

I would like to see a trip odometer that clears with a pbutton and a

total odometer/w no clear- ee should store the numbers

I saw a thermometer project that had input to ee for a calibration value;
perhaps this would make the project more versatile.

What type of display? My vote is for led, I think.
LCD is so hard to see under varying light & temperature

BTW James, what are you doing tinkering with cars? I thought you were
moving to the bush and renewable energy!!!! Leave the car behind.

Regards

Wil Reeder
Vancouver, Canada
teachtechSTOPspamspamspam_OUTbc.sympatico.ca

----------
> Subject: Re: Speedometer Project
> Date: Thursday, October 22, 1998 3:12 AM
>
> Hi! I also would like to be in this discussion. I also want to build a
snip

1998\10\22@112435 by Joe Little

flavicon
face
I have this project on simmer too.  Mine has a data logger to record min/max

speeds of each minute. Useful information for when my 16 yr old wants to
borrow
the car. I'll just download her last trip, and plot it with Excel.  I'll let
the
peaks in speed help decide when she can borrow it again.

It might make more sense to capture acceleration when my son gets his
license.... If I remember right, I didn't speed much, but I had a pretty fun

time getting up to cruising altitude.  Might be nice to capture GPS
coordinates,
centrifigual force, wheel spin, and the position of the volume knob on the
stereo.

Just roll it all into one product... Call it " Daddy's watchin' ".  I'll put
a
little blinking light on it, and sick it to the dashboard.

______________________________ Reply Separator
_________________________________

Hi James and all

I am interested in this project as well.  This would be a great little
piece to have on the boat. Pulse type senders are readily available so this
could be very similar to your project.

I would like to see a trip odometer that clears with a pbutton and a

total odometer/w no clear- ee should store the numbers

1998\10\22@145445 by chuck

flavicon
face
---WIL REEDER <spamBeGoneteachtechSTOPspamspamEraseMEBC.SYMPATICO.CA> wrote:

>
> What type of display? My vote is for led, I think.
> LCD is so hard to see under varying light & temperature

Actually LCD is preferred. Negative mode LCD like a watch is very easy
to see in direct sunlight.LED's wash out in sunlight. A backlit LCD is
visible in the dark. It draws less current than LED's as well.
A 12v Vacuum flourecent display may be best but it draws more current
than an LED. Many vehicles have these.

==
Chuck Hellebuyck
Electronic Products
Check out our Large Character Serial LCD Modules!
See our new Serial Keypad Modules!
http://elproducts.com
KILLspamchuckspamBeGonespamelproducts.com

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

1998\10\22@185312 by Tony Nixon

flavicon
picon face
Ryan David Pogge wrote:
>
> I was also thinking of doing something similar, except a also wanted to
> add an accelerometer

I recently did this on a Toyota Camry. I managed to get about a 1/4 g
under full acceleration, and hard braking at nearly 1 g. Scary stuff ;-)

--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
**New Improved PicNPost**

http://www.picnpoke.com
Email EraseMEpicnpokespamEraseMEcdi.com.au

1998\10\22@202655 by James Cameron

flavicon
face
WIL REEDER wrote:
> BTW James, what are you doing tinkering with cars? I thought you were
> moving to the bush and renewable energy!!!! Leave the car behind.

Yes, I am, but in the next year I'll be driving for 12 hours every month
or less to get to the farm and back.  I gotta have something to play
with over that time!

Maybe take the laptop running Linux so I can reprogram the 16F84, on the
fly ... or rather on the stretch of road where my wonderful wife drives
so I can have a rest ... um, play.  ;-)

I'll be using PICs all over my renewable energy control system to save
ergs here and there.  I can see great applications in rural areas for
low powered intelligent devices, and I hope to generate some local
interest.

--
James Cameron                                    (@spam@cameron@spam@spamspam_OUTstl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\22@202901 by James Cameron

flavicon
face
Joe Little wrote:
> Just roll it all into one product... Call it " Daddy's watchin' ".
> I'll put a little blinking light on it, and sick it to the dashboard.

Yes, I agree.  However, I can see an optimisation or two ...

1) use UHF to download the data when the car comes home,

2) display the data on the 'fridge,

3) compare fuel consumption, charge to the pocket money account by the
millilitre,

4) once the technology is proven and the kids have seen the graphs a few
times, pull out the guts of the thing for re-use somewhere else, and
stick in a 12C509 with a random LED flasher.  The kids don't have to
know you have stopped taking the data, and you get to use the 16F84 some
place else.  ;-)

--
James Cameron                                    (spamBeGonecameronspamKILLspamstl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\22@203317 by James Cameron

flavicon
face
Robert Rowlands wrote:
> Seems like a few people are interested in this project.

Yes, and they are quite willing to see us cross-post to the PIClist.
Your choice.  If you do post there, I will probably answer.  Post direct
for more direct response.

[this message copied to PIClist for others to enjoy]

> I have to come up with some kind of board design soon, or I will not be
> able to get my project completed in time.

Strange.  You have to design a board?  I would always use wire-wrap or
veroboard, but then, if part of the project is to design a board, I
suppose you have to.  ;-}

> I come up with using timer0 as a counter, whilst looking at the
> frequency counter application notes at http://www.microchip.com.  However that
> was looking at much higher frequencies.

Yes, I agree.  For me, counting the pulses as they arrive is very simple
in software, because they arrive so slowly.  By comparison, getting a
one second delay in software to work precisely is not trivial.  Hence I
decided to use TMR0 as the time base instead.  It will increment at the
processor clock speed (or some division thereof) without software having
to be involved.

> I take it that if you enable tmr0 which will then increment with each
> pulse from the sensor.  Once tmr0 is enable, then you implement a
> software delay of let us say 1 sec, once that finishes then disable
> tmr0 move it into some memory location for calculations then clear
> tmr0.

Problem is the number of counts you get in one second can be small, like
at 60km/h, and so the accuracy suffers.  Think of the relative error of
each measurement you are taking; pulses and seconds.  At, say, 20 pulses
per second, you have an error of 0.5 pulse, so you get either 19.5 or
20.5, and that is a significant error.  The error in the time base is
trivial.

Increasing the pulse frequency helps ... but remember you are doing that
by adding to the number of magnets on a wheel or something, and each one
has to be positioned just right, whereas with one magnet it can't help
being right.

So I reverse the measurement ... by handling an arriving pulse the error
in the pulse data stream is much reduced ... I'm measuring the time
between n pulses rather than the number of pulses in n seconds.  My time
granularity can be in microseconds if I like, because I'm using a
crystal as the time base.

So, if I get pulses at, say, 100Hz, then I'm counting about 10,000
microseconds between pulses.  A small change in frequency is still
caught.  Unfortunately it means I have to invert the output data, but
hey, that shouldn't be too hard.

> Don't have much of an idea about displaying to an LCD screen, I did
> want a large display for the speedometer.

One can obtain large LCD screens for this.  I think
http://www.rocom.com.au/ have a large two line display on special right
now for $25.  Not sure.

The interfacing is fairly trivial, in my opinion.  You saw the picture I
sent you?  [A draft design for LCD panel, 12 key keypad, and RB0/INT
connected to the sensor.]  You need three control lines and four data
lines to operate an LCD in four bit mode.  In eight bit mode you'd need
another four data lines.

The R/W line is read or write enable.  It is set to 1 for reading.  The
RS line is a register select; there's a control register and data
register.  The E line is an enable, which clocks the data from the data
bus into the LCD's register.  Or out of the LCD to the data bus.

So from the perspective of the microcontroller, you just set up the data
bus, set up the RS and R/W lines, then pulse E up and down once.

In four bit mode, you then push out the other four bits onto the data
bus and throw another E pulse.

You can tell the LCD to position to a cursor address before telling it
to accept characters.  Luckily you just have to send the ASCII codes for
the characters, you don't have to draw the characters yourself.  ;-)

--
James Cameron                                    (.....cameronspam_OUTspamstl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\23@005051 by Sean Breheny

face picon face
Those are good tires. I believe that the usual coefficient of static
friction between rubber and dry smooth asphalt is .9 max, meaning that you
can at maximum achieve .9g due to the force between the tires and road,
without aerodynamic help.

Sean

At 08:51 AM 10/23/98 +1000, you wrote:
{Quote hidden}

+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
TakeThisOuTshb7KILLspamspamspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\23@011250 by Michael Hagberg

flavicon
face
maybe it was that brick wall that put him over the 1g force.
michael

You may leave the list at any time by writing "SIGNOFF PICLIST" in the
   body of a message to .....LISTSERVspamRemoveMEMITVMA.MIT.EDU.

{Original Message removed}

1998\10\23@031313 by russellh

picon face
I thought of something. In modern cars, with their steep windshield
rake, it's very annoying to put anything on the dashboard. It shows
reflected in the windshiled.

So I was thinking, that if you mirror reversed the digits in a large
LED display (Digi-Key has 7 segment digits almost three inches tall),
and placed the display on the dashboard, then you would see the digits
in the windshieled!

A poor man's heads up display.

I have four of those digits. Hmmmmmmmmmmmm.

I was planning on using a reflective opto senser to read the
revolutions off the back of the magnets in the speedometer. Just paint
a black line or two on the back, and point the sensor at it. But after
all, if there are a couple of magnets in the speedometer already, why
not use a Hall effect switch to read their rotation? I shall have to
look into that.

Thanks!

Russell Hedges

1998\10\23@035511 by Brian Watson

flavicon
face
Please keep it public.
As a relative beginner, I also would be interested in the strategy for
developing this code.
I have been struggling to use TMR0/RA4 on a 16F84 to initiate a controlled
end of a cyclic process.

Regards

Brian

{Original Message removed}

1998\10\23@052123 by James Cameron

flavicon
face
Brian Watson wrote:
> Please keep it public.  As a relative beginner, I also would be
> interested in the strategy for developing this code.

Well, alright then, public it is.  Calm down everybody; and I expect no
complaints that we're being too verbose about such a "simple" project.
;-)  Watch out for my ego though.

Since you ask about the strategy for developing ... here's how I worked
on this one ...

       1.  got annoyed that I couldn't trust my speedometer,
       2.  got bored while driving back from the farm,
       3.  allowed my mind to wander,
       4.  literally dreamed up a design in my sleep,
       5.  couldn't continue sleeping the next day, so transcribed it.

However, to be a bit more serious ...

The task breaks down to counting the number of revolutions of the car
wheels over a time period, and mathematically converting the result into
the local speed convention, be it miles or kilometres per hour.

So, we want to count car wheel revolutions and time.

Do we count the number of revolutions per time period, or measure the
time period for a number of revolutions?  I've answered that in my
previous mail; the latter solution is better because it reduces error.

Counting time ... we could do it a number of ways;

       a)  have an external time source that we could query,

       b)  maintain an internal time source linked direct to crystal,
           such as the timer/counter in the 16F84,

       c)  maintain a software delay loop linked to crystal.


Counting the pulses from a wheel sensor could also be done a number of
ways;

       a)  tie it to an input on the chip and watch it like a hungry
           domestic feline using a software loop,

       b)  tie it to the counter, and watch the result,

       c)  tie it to an interrupt input, and count the interrupts.


Now, which of the combinations do you choose?

We have these counting resources;
       1)  the internal timer,
       2)  simple input pins,
       3)  interrupt input pins,
       4)  software timing,

Which ones I chose depended on the frequency of the incoming pulses.
For the time, we have a 1MHz pulse rate.  We could use a software loop,
but it would be difficult to code.  The internal timer therefore seems
best for that, as I have already written about.

For the wheels, we have a fairly low frequency pulse sequence, so we
could use either of the other options, but not the timer/counter,
because we have decided to use it for the time base.  The simplest to
implement seems to be the interrupt input pin, RB0/INT, which has the
advantage of a well known response time over watching a pin.

--

Consider an even simpler most less "accurate" solution ... smooth the
pulses from the sensor, apply to an averaging op-amp configuration, take
the resultant analog voltage, then apply it to an A/D converter and a
display driver.

Then you'd have this nice trim-pot in the design that would let you
"tune" the whole thing, provided you had a reliable calibration
speedometer handy.  ;-(

But we can't talk about that solution here, unless it involves a PIC.
Chuckle.

I'll admit to a bit of prior experience on this one ... I programmed an
80C85 in a Tandy 102 (1985) laptop to watch pulses and to estimate
speed.  On that machine I had only a 256Hz interrupt clock.  There's an
article I wrote on that a few years ago somewhere on the web.  Perhaps
Club 100.  It was mostly in BASIC, with a small bit of interrupt
handling code just to perform the timing.  But it was big and bulky and
so was rapidly submerged and re-used.

--
James Cameron                                    (RemoveMEcameronspamspamBeGonestl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\23@052725 by Nuno Pedrosa

flavicon
face
How do you use "Negative Mode"? I remember some calculators where I
reversed the polarizing mask, but I don't think this is possible with a
standard LCD display... Or is it?

Nuno Pedrosa.

Chuck Hellebuyck wrote:
{Quote hidden}

--
   .^.                                              _,^,_         /\
___( | )_____ Nuno Filipe Freitas Pedrosa __________ o(`} | , __/\/ /__
/*\\|//*\    SIEMENS S.A. Portugal                  (]|  /'    \ \/\
\(\\V//)/    Nuno.PedrosaEraseMEspamoen.siemens.de     (]|`%   (") \/\ \
 ` -=- '     Tel.  :00351-1-4242454         (")      /`/        / /\/
__B//|\\P___________________________________________\' / `/______\/____
   `-' "Try and leave this world a little better than you found it..."

1998\10\23@062648 by Russell McMahon

picon face
You don't really need an accelerometer if you have speed pulses
available - you can tell acceleration from that. Alternatively you
COULD use an accelerometer to work out speed but the cumulative
errors would be too great for long periods - probably ideal for a 1/4
mile dragster :-) - overcomes affect of wheelspin !!!

From: Ryan David Pogge <RemoveMEpoggeEraseMEspamspam_OUTUDEL.EDU>

>I was also thinking of doing something similar, except a also wanted
to
>add an accelerometer that will measure g's and also be able to do
0-60
>time, and 0-100 time ad such.
>
>

1998\10\23@065006 by Russell McMahon

picon face
I believe that top sports cars (Porche type things) can corner at
over 1g - no doubt wings play a part here.



{Original Message removed}

1998\10\23@143225 by Stig Brautaset

flavicon
face
>I believe that top sports cars (Porche type things) can corner at
>over 1g - no doubt wings play a part here.
>


I think I have read somewhere that because of their effective wing flaps (is
that the right term? My dictionary didn't contain a translation of the
norwegian word) Formula 1 cars can drive upside down (i.e in a tunnel) at
speeds above 140 km/h.

How the formula racer would handle the vertical curving?
That I don't know! :-)

Stig

==================================================
Stig Brautaset - @spam@sbrautasRemoveMEspamEraseMEc2i.net - ICQ: 11052183
student of electronics, homepage at http://home.c2i.net/sbrautas
==================================================
Drive carefully; 90% of the worlds population are due to accidents.

1998\10\23@145324 by Peter L. Peres

picon face
On Fri, 23 Oct 1998, Stig Brautaset wrote:

> >I believe that top sports cars (Porche type things) can corner at
> >over 1g - no doubt wings play a part here.

That would be news. Anyway don't try that.

> I think I have read somewhere that because of their effective wing flaps (is
> that the right term? My dictionary didn't contain a translation of the
> norwegian word) Formula 1 cars can drive upside down (i.e in a tunnel) at
> speeds above 140 km/h.

This is based on top figures applied to an extreme case. You must not
forget that many systems in a sports car don't work upside down at all.
Getting fuel to the engine in turns is hard enough, and non-injected
carbs have all sorts of interesting arrangements in them to keep the fuel
supply independent of vibration and lateral forces. Also, they all use
only sealed batteries for the same reason. There is much more, and I am
not an expert. Anyway that McLaren hydraulic brake distributor coupled to
the steering wheel was a killer imho ;) How come no-one thought of it so
far ?

> How the formula racer would handle the vertical curving?
> That I don't know! :-)

Well, normal race cars that race on a closed concrete track DO attain 90
degree angles in raised curbs quite commonly. It's a bad idea to hit the
brake even so slightly in that position imho ;) So do bobsleighs since
we're at Norwegian. It's all in the centrifugal force ;)

Peter

1998\10\23@234950 by Mark Willis

flavicon
face
James Cameron wrote:
>
> Brian Watson wrote:
> > Please keep it public.  As a relative beginner, I also would be
> > interested in the strategy for developing this code.
>
> Well, alright then, public it is.  Calm down everybody; and I expect no
> complaints that we're being too verbose about such a "simple" project.
> ;-)  Watch out for my ego though.

 Request: Have capability to switch between MPH and KPH on the display
head (dash or under the dash or somewhere reachable.)  I occasionally
visit Canada, and as the US is non-metric (mostly) and Canada purely
Metric (mostly), it'd be really handy to flip a toggle switch at the
border or something <G>

 It'd be fine with me if this switch was only checked when velocity=0,
so a pin could be shared if needed <G>

 Mark, EraseMEmwillisspam@spam@nwlink.com

1998\10\24@011804 by Russell McMahon

picon face
Even some aircraft have problems maintaining inverted attitudes -
ever seen/heard a Harvard doing and inverted pass (how many know what
a Harvard is ? :-)) - they can do it for a bout 14 seconds AFAICR -
after that they start top splutter and currently living Harvard
pilots re-invert at that stage - they have a top tank which feeds the
engine in inverted flight and this is how big they have made it.

>> I think I have read somewhere that because of their effective wing
flaps (is
>> that the right term? My dictionary didn't contain a translation of
the
>> norwegian word) Formula 1 cars can drive upside down (i.e in a
tunnel) at
>> speeds above 140 km/h.
>
>This is based on top figures applied to an extreme case. You must
not
>forget that many systems in a sports car don't work upside down at
all.
>Getting fuel to the engine in turns is hard enough, and non-injected
>carbs have all sorts of interesting arrangements in them to keep the
fuel
>supply independent of vibration and lateral forces.

1998\10\24@042251 by James Cameron

flavicon
face
Mark Willis wrote:
> Request: Have capability to switch between MPH and KPH on the display
> head (dash or under the dash or somewhere reachable.)

Actually, if we integrate it with a GPS, and use a polygon coordinate
match, we can work out how to display it depending on where we are.  of
course, you'd need it to show MPH in the US embassy, right?  ;-)

--
James Cameron                                    (@spam@cameronspam_OUTspam.....stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

1998\10\25@130354 by Mark Willis

flavicon
face
James Cameron wrote:
>
> Mark Willis wrote:
> > Request: Have capability to switch between MPH and KPH on the display
> > head (dash or under the dash or somewhere reachable.)
>
> Actually, if we integrate it with a GPS, and use a polygon coordinate
> match, we can work out how to display it depending on where we are.  of
> course, you'd need it to show MPH in the US embassy, right?  ;-)
>
> --
> James Cameron                                    (spamBeGonecameronEraseMEspamstl.dec.com)
> Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800

 I figured I'd want Parsecs/Second or AU/Second, really, James!  (It
makes sense to use a scale that'll not use too many digits - for
convenience's sake in reading the display - we all know that anyone who
drives indoors, always drives FAST!, right?  <G>)

 If that's just too hard on a PIC project, I'll settle for Mach
numbers.  (You may assume 1000 MSL altitude, for convenience, though
with a GPS you could throw in actual altitude figures & get it exactly
right.)

 Your Mileage May Vary!  (Just HAD to throw that one in <VBG>)

 Mark, mwillisspamBeGonespamnwlink.com

1998\10\25@133959 by Sean Breheny

face picon face
At 10:01 AM 10/25/98 -0800, you wrote:
>  If that's just too hard on a PIC project, I'll settle for Mach
>numbers.  (You may assume 1000 MSL altitude, for convenience, though
>with a GPS you could throw in actual altitude figures & get it exactly
>right.)

Are you going to want pressure and humidity sensors then? <G>

>
>  Your Mileage May Vary!  (Just HAD to throw that one in <VBG>)
>
>  Mark, RemoveMEmwillis@spam@spamspamBeGonenwlink.com
>
+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
.....shb7@spam@spamEraseMEcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\25@151939 by Mark Willis

flavicon
face
Sean Breheny wrote:
>
> At 10:01 AM 10/25/98 -0800, you wrote:
> >  If that's just too hard on a PIC project, I'll settle for Mach
> >numbers.  (You may assume 1000 MSL altitude, for convenience, though
> >with a GPS you could throw in actual altitude figures & get it exactly
> >right.)
>
> Are you going to want pressure and humidity sensors then? <G>

 Good point.  We wouldn't want to be inaccurate or anything <VBEG>

 Mark (Silly today, nu?)

1998\10\25@153359 by Sean Breheny

face picon face
At 12:17 PM 10/25/98 -0800, you wrote:
>> Are you going to want pressure and humidity sensors then? <G>
>
>  Good point.  We wouldn't want to be inaccurate or anything <VBEG>

Hey, actually, I don't know what kind of car you have, or if you like to
drive in hurricane's eyes on high mountain sides <VBG>, but you could
probably get up to Mach .3 or so!


>
>  Mark (Silly today, nu?)
>

Sean

+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
.....shb7RemoveMEspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\25@163118 by Mark Willis

flavicon
face
Sean Breheny wrote:
{Quote hidden}

 We were talking about changing scales when inside US embassies, Sean.
Not on mountaintops or in inclement weather, we were talking indoors.

 Besides, we should really be driving just outside the eye, and we
REALLY need a pitot tube if we're trying to measure AIR speed instead of
ground speed, folks;  the eye of a hurricane has fairly calm air...

 Mark

1998\10\25@170418 by Dave VanHorn

flavicon
face
>   Your Mileage May Vary!  (Just HAD to throw that one in <VBG>)


Of course there's a correction factor, since the dashboard travels
farther than the wheels, (it being further out in radius on a spherical
movement)

1998\10\26@125753 by Peter L. Peres

picon face
On Sun, 25 Oct 1998, Mark Willis wrote:

{Quote hidden}

Bzzt ! You have to correct for the actual speed read by a police radar
being outside the car, by using the forumla of relativity knowing the real
speed when you take into account the slowing down of the quartz
crystal used to measure speed and dimensional variations in the pickup
system etc.

Peter

1998\10\26@234708 by tjaart

flavicon
face
> Bzzt ! You have to correct for the actual speed read by a police radar
> being outside the car, by using the forumla of relativity knowing the real
> speed when you take into account the slowing down of the quartz
> crystal used to measure speed and dimensional variations in the pickup
> system etc.

Does anyone have more details on the operation of these radars?
They are used in some areas of our country, and I wouldn't mind
some, errm, advance warning <wink, wink>. In most areas they
still use piezo electrical cables strung across the road (as you
can see from the nice picture of my car on my web page) :(

--
Friendly Regards

Tjaart van der Walt
RemoveMEtjaartspamspamBeGonewasp.co.za

|--------------------------------------------------|
|                WASP International                |
|R&D Engineer : GSM peripheral services development|
|--------------------------------------------------|
|SMS spamBeGonetjaartKILLspamspam@spam@sms.wasp.co.za  (160 chars max)|
|     http://www.wasp.co.za/~tjaart/index.html     |
|Voice: +27-(0)11-622-8686  Fax: +27-(0)11-622-8973|
|          WGS-84 : 26¡10.52'S 28¡06.19'E          |
|--------------------------------------------------|

1998\10\27@064250 by Geoff Wootton

flavicon
picon face
>From the blurring on the wheel trims, I estimate 70 mph in a 30
limit.

> (as you
> can see from the nice picture of my car on my web page) :(

1998\10\27@065256 by Jeff Johnson

flavicon
face
> Date:         Sun, 25 Oct 1998 17:02:04 -0500

> >   Your Mileage May Vary!  (Just HAD to throw that one in <VBG>)
>
>
> Of course there's a correction factor, since the dashboard travels
> farther than the wheels, (it being further out in radius on a spherical
> movement)

But the amount is surprisingly small. Like .00001% :-).

JJ


'Speedometer Project'
1998\11\09@005413 by Robert Rowlands
picon face
part 0 898 bytes
Questions -
When using the timer as the timebase

Wheel = 2.05m circumference
1 pulse per revolution
5km/ph minimum

5 / 3.6 = 1.389 meters per second
2.05 / 1.389 = 1.476 delay between pulses at 5kmph

4Mhz timer = 0.00000025sec per instruction
tmptime counter value after 1.476 sec delay = 5904000 dec =  5A1680 hex
(32 bits wide)

So I would need a 32 bit counter to increment up that high.  How would I
create a 32 bit counter, is the code for incrementing the counter
correct ??.

Then for working out the speed I would require

circumference = 2.05

time = tmptime + tmr0  (this is done on every external interrupt)

Calculation routine
delay = time * 0.00000025
mps = circumference / delay
speed = delay * 3.6


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



Attachment converted: wonderland:SPEED.ASM (????/----) (0001CDEF)

1998\11\09@011715 by Dave VanHorn

flavicon
face
> So I would need a 32 bit counter to increment up that high.  How would I
> create a 32 bit counter, is the code for incrementing the counter
> correct ??.


Use a slower clock! I don't think you need 250nS resolution.
32 Khz may be enough.

1998\11\09@183610 by James Cameron

flavicon
face
Robert Rowlands wrote:
>
> I've attached my interrupt routines. to this email message

The comments say it is a frequency meter?

> 4Mhz timer = 0.00000025sec per instruction

No, not .25 microseconds, but one microsecond.
Four clock cycles per instruction, four clock cycles per TMR0 increment.

> tmptime counter value after 1.476 sec delay = 5904000 dec =  5A1680 hex
> (32 bits wide)

Looks like 24 bits to me.  Where did you get 32 bits?

> So I would need a 32 bit counter to increment up that high.  How would
> I create a 32 bit counter,

Increment a byte.  If it overflows, increment the next byte, and so on,
until you run out of bytes.

> is the code for incrementing the counter correct ??.

What code?

> circumference = 2.05
> time = tmptime + tmr0  (this is done on every external interrupt)
> delay = time * 0.00000025
> mps = circumference / delay
> speed = delay * 3.6

Apply algebraic reduction to your formulae and you may find it easier to
program.  Express the formulae as a single formula in terms of the
result, and reduce any superfluous constants.

Dave VanHorn suggested a slower clock.  I think that may have
advantages.

Also, you sent your message twice.  I guess you received a rejection
message and assumed that hitting it harder would fix it.

--
James Cameron                                      (cameronspam_OUTspam@spam@stl.dec.com)

OpenVMS, Linux, Firewalls, Software Engineering, CGI, HTTP, X, C, FORTH,
COBOL, BASIC, DCL, csh, bash, ksh, sh, Electronics, Microcontrollers,
Disability Engineering, Netrek, Bicycles, Pedant, Farming, Home Control,
Remote Area Power, Greek Scholar, Tenor Vocalist, Church Sound, Husband.

"Specialisation is for insects." -- Robert Heinlein.

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