Logging suspension events and rotary encoders

Hello all,

After years of pondering and tinkering, I'd like to commence a project which has been on the back burner for a while.

I'd like to log suspension data, and probably g sensor data, on my mountain bike.

Recently I picked up a rotary encoder (600 pulse) from ebay and got all that working. I've also mucked around with logging pots, writing to SD cards, using the G sensor, etc. while finding my way around the device. Now, it's time to make actual design decisions rather than just cut and paste tutorials :slight_smile:

I'd like to log front and rear suspension on my mountain bike. So far I have the rotary encoder and a nano to experiment with this. It works well, but my first concern is interrupts. Will using two rotary
encoders, one for each end cause problems if they're both triggering interrupts at the same time? My plan was to dump the data to SD card, will this also be problematic with the constant interrupting?

I was thinking that perhaps I'd use an arduino for each encoder, and maybe another to handle the actual writing of data to the SD card. I'm happy to capture very basic position data and then handle any processing afterwards on a PC, but is this feasible?

I was debating a logging rate of 50-100Hz, but I'm also quite open to suggestions there too.

I hope someone more experienced can chime in with some thoughts and more areas of research for me. It would be something I hope to migrate to an auto environment further down the track.

Thank you all in advance.

Concerning interrupts. You should disable any potential interrupt while servicing a current one. But an interrupt should be very short and sweet. If you have used one to indicate incoming data, just set a flag, and go read the data in the main loop. That way your interrupt takes minimal time, and the chances of having two overlapping is very low, but not necessarily 0.

Cheers. I'll have to do some testing by the looks of it.

You should disable any potential interrupt while servicing a current one.

That happens automatically, their is no need to do anything specifically to achieve this.

It is a very bad idea to use more than one Arduino, it is simply a waste and makes the project more complex by having to communicate between Arduinos.

Alright, thanks gents. I'll keep at it and see how it works out.