Interfacing pulses from bicycle with sound Profiles in electric bike

Hello all,

I have created small wheel with 6 spokes connected to DC motor and reed switch is connected on the frame. I am able to get pulses from wheel. I have 3 sound profiles with parameters such as index of samples, silence factor, mixing factor and volume of sound are in timer interrupt. Sound files are stored in SD card. My Timer Interrupt is set at 11025Hz and I am using Arduino Due.

Based on pulse difference between two spokes, I want to modify the parameters :

  • pulse diff = (0-500) : Set vol = 100, speed = 100, Silence factor = 100 and mix factor = 100
  • pulse diff = (500-1000) : Set vol = 50 ; speed =50 ; silence factor = 50 and mix factor = 50

Now I want to interface the pulses from wheel with sound using these parameters. For eg : Faster the pulses, faster the speed of wave. This is my idea of implementation. Is there any better way?

Guys can you give some short idea. Thanks for the help

My Timer Interrupt is set at 11025Hz and I am using Arduino Due.

You have to change that interrupt speed depending on your input speed. The actual mapping will depend on the effect you want to create.

Hii Grumpy,

Thanks for the reply input speed of what? can you elaborate it in more details so that it can be understandable for me because I am newbie. Sorry if my doubt is silly.

input speed of what?

The input speed of the pulses coming from your spokes.

because I am newbie.

That didn't come over on the first post. In which case what do you mean by:-

Based on pulse difference between two spokes, I want to modify the parameters :

pulse diff = (0-500) : Set vol = 100, speed = 100, Silence factor = 100 and mix factor = 100
pulse diff = (500-1000) : Set vol = 50 ; speed =50 ; silence factor = 50 and mix factor = 50

You must have written some code that sets these parameters?

Hii Grumpy,

Thanks a lot man, I will implement it and will let you know. I have not written the code but this was just an idea, and I will now implement it.