Excited Wombat! (wk5)

ian's picture

Description

I wanted to do something that had an output slightly less annoying than a piezo buzzer. My lab had some offset weight motors they were experimenting with for another project, so I put one inside a borrowed stuffed animal with the FSR taped to it, and programmed the Arduino to take the input from the FSR and PWM the offset weight motor to cause the wombat to vibrate. The motor takes more power than the Arduino can output, so I used the Darlington Transistor to convert the PWM output and amplify the output from two AA batteries, which powers the motor. The code was thankfully very simple, as the offset motor originally just came with a battery pack and pot as control. As implemented, squeezing the wombat tighter will cause it to vibrate more rigorously.

Components

  • offset weight motor
  • darlington transistor
  • battery pack & 2x AA batteries
  • FSR
  • 10kΩ resistor

Arduino Code



#define inpin 0

#define motorPin 6
 
int val;
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  val = analogRead(inpin);
  Serial.println(val);
  if (val < 100)
    analogWrite(motorPin,0);
  else 
    analogWrite(motorPin,val/4);
 delay(10);
}
 
wombat internals with offset weight motor & FSR taped to it
full setup
arduino wiring
0
Your rating: None