Making vibrate the brake pedal would give more immersion feeling (ABS, traction loss). The first trials with an unbalanced motor were not good: the motor reacts too slowly as it takes time to gain speed and hence give vibration. It's too noticeable...
The use of a solenoid is perfect: it reacts in 50 to 70ms.
There is a simple program to test it :
// RacingMat 30 march 2014
// code for driving a solenoid with a relay
// and a pot can adjust the frequency
// Serial is only here for debugging purpose (reading pot value)
int relay=10; // pin which will control relay's state
int pot= A1; // pin which is reading the pot's value
int potValue;
void setup() {
pinMode(relay, OUTPUT); // set pin into output mode
digitalWrite(relay, LOW); // set relay's pin to OV
Serial.begin(9600); // serial initialization
}
void loop() {
//delay(100);
potValue=analogRead(pot); // Analog to Digital Converter converts Pot's position into a (0 - 1024) range
Serial.println(potValue);
delay(potValue/5);
digitalWrite(relay, HIGH); // set relay's pin to 5V
delay(70); // 70ms is the time needed for the solenoid to complete a full excursion
// giving more time would only lead to more heat dissipated into the solenoid which has to be avoided
digitalWrite(relay, LOW); // set relay's pin to OV
}
![](https://s2.save4k.ru/pic/hNrhxAGIHv4/mqdefault.jpg)