External Counting Chip

Hi All,
Firstly, I apologise as I have used the search and there are other threads of a similar topic on here, I just cant find exactly what I am looking for.

This is my first Arduino build, I am attempting to build a data logging system for my racebike.
Some of the things I am trying to log are:

  • Front Wheel Speed
  • Rear Wheel Speed
  • Engine RPM
  • Lean Angle
  • Acceleration
  • GPS location

The first three of these are going to be done by counting pulses. I am using a Mega, but I would prefer to have these individual counting functions separate, counting away to themselves, with the arduino polling them on the timer interrupt.

Of the counting chips I have seen they have a set of output pins that you use to build the current value. This is no good to me as to get the number range I require I am going to have to have 32 pins per counter, I will quickly run out of space.

So, is there a chip that takes a pulse input, and can return a value down a serial port?
This is vastly reduce space taken on my arduino.

any help very much appreciated as I am quite new to all this!

thanks

Ian

Something like this?

Then pair the 8 bit output with a PISO shift register.

A 32 bit counter does seem overkill to me though. You might consider smaller registers and then polling and clearing once in awhile.

thanks for that. I will order myself a couple of these and have a play about.

I will report back on this thread.

sounds like a fun project - why cant you count direct on the arduino pins using an interrupt ?

this might be just what you need :wink:

You don't need to use any external counters. The Mega (assuming it's a mega2560 mcu) has 4 16-bit Timer/Counters. You can use three of these as Counters with an external trigger (rising/falling edge) clock. Then use the 4th as a Timer interrupt at regular intervals.

Using them as Counters is a hardware function so they don't require code except to read them.

Some resources:

I am using a Mega yes - would it be powerful enough to cope with 2 wheel speed sensors and all the other stuff its going to do in a timely fashion?

I cant have any lag or delays in the wheel speed values.

You need to understand that a motorcycle is very slow in computer terms. At 6000 RPM, that is 100 cycles per second. The MCU can execute up to 160,000 instruction steps, or perhaps 10,000 lines of "C" in between each of these events.

You only need to sense once per revolution - or perhaps twice or three times.

You should not need interrupts.

Hi, thanks for the reply. The wheel speed sensors will have at least 6 pickup points per revolution. I need that resolution for it to react quick enough in a slip situation.

6 pickups seems to be the standard for aftermarket traction control systems.

Do you still think a mega will be capable of handling that on its own?

Ian

How many RPM do the wheels do? I'll bet it is not 6000!

ok so:

The circumference of the wheel with the tyre (obviously) is 71.2 inches. That means in 1 mile the wheel will rotate 890 times.

so at 1mph the wheel will be rotating 890 times per hour (again obviously)

at 170mph the wheel is rotating 890 x 170 = 151281 rph

We want to know 1 second, which 151281/3600 = ~42 rps

Now add 6 pickups on the wheel thats 252 pulses per second.

2 wheels, so the mega has to handle that same value through 2 interupts.

are these figures within the scope of a mega to handle? bearing in mind I want it to checking other stuff on a timer too?

Thanks

Ian