Very simple "racing" simulator

Hey guys, im making a school project.
I want to make a simple racing simulator using the Arduino Leonardo. I have included a small sketch in the attachments.
The idea is that when the pedals are moving it will run a dynamo or something and the arduino will catch that and it will simulate the press of "W" on the keyboard as this is the common button for accelerate in racing games. Then whenever a pushbutton(attachment) it pressed it will simulate the press of "S" instead of "W" when moving the pedals.
The round sticks on the sides will simulate "A" and "D". I don't know for sure how yet, but maybe by attaching them to a volume switch or something and then when it goes above a certain level it will press the button.

Will this work?

pushbutton.jpg


01917cc18521640d54bf64306725e4e75e43c840.jpg

Yes that could work. Is this a design-only project or will you build it?

The easiest way to measure the pedal speed might be to have a tiny "bump" on the wheel that activates a microswitch once per revolution. Microswitches that have a tiny roller wheel on the end of a short arm would be ideal. Alternatively, attach a small magnet to the wheel and use a reed switch or a Hall effect sensor to pick up the magnetic field as it passes.

What about using a dynamo as a switch?

PaulRB:
Yes that could work. Is this a design-only project or will you build it?

The easiest way to measure the pedal speed might be to have a tiny "bump" on the wheel that activates a microswitch once per revolution. Microswitches that have a tiny roller wheel on the end of a short arm would be ideal. Alternatively, attach a small magnet to the wheel and use a reed switch or a Hall effect sensor to pick up the magnetic field as it passes.

Thanks for answering!

I am going to build this.
Awesome idea you've got regarding the microswitch, i just don't know how i would build it. However if i stick with the dynamo idea, will i be able to use a transistor to read whenever its generating power?

No, that's not what transistors do. Do you really mean dynamo, or do you mean alternator? What will you do with the power generated by the dynamo? You will need to dissipate that power somehow. I think the microswitch idea would be much simpler.

PaulRB:
No, that's not what transistors do. Do you really mean dynamo, or do you mean alternator? What will you do with the power generated by the dynamo? You will need to dissipate that power somehow. I think the microswitch idea would be much simpler.

Oh yeah, i see. I hoped that i would be able to use the transistor as a kind of switch, but that may not be the way it works. I think i will improvise and use the microswitch somehow :slight_smile:

Thank you so much!

Yes, a transistor can work as a kind of switch. But I don't see how a switch helps you measure the output of a dynamo.

A reed switch like this may be an easier/better idea than a microswitch.s-l225.jpg

PaulRB:
Yes, a transistor can work as a kind of switch. But I don't see how a switch helps you measure the output of a dynamo.

The idea is just to measure whenever power is coming through and that would trigger the press of "W".

Awesome, i will look into the reed switch

Jensvejmand:
The idea is just to measure whenever power is coming through and that would trigger the press of "W".

I understand what you're trying to do, but how can switching the power from the dynamo help you measure the power from the dynamo? It can't.

You can use small magnets like these to activate the reed switch.s-l300 (3).jpg

All right, thank you very much!