Introduction: CD-ROM Agitator
These are step by step instructions on how to hack an old CD-ROM drive and turn it into a agitator for PCBs, biohacking projects and anything else you might need to shake continuously. All you need is a CD-ROM drive, breadboard, H-Bridge, a 10Kohm resistors Arduino, plastic container and power source for the Arduino (a toggle switch is optional).
Step 1: Get a Old CD-ROM Drive
Step 2: How to Set Up the Arduino and Breadboard
Step 3: The H-Bridge Connected to the Arduino (No Toggle Switch)
// Arduino Code:
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
void setup() {
// set the switch as an input:
pinMode(switchPin, INPUT);
// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
// pinMode(ledPin, OUTPUT);
// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
}
void loop() {
// if the switch is high, motor will turn on one direction:
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
delay(500); // waits for a second
// if the switch is low, motor will turn in the other direction:
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
delay(500); // waits for a second
}
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
void setup() {
// set the switch as an input:
pinMode(switchPin, INPUT);
// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(enablePin, OUTPUT);
// pinMode(ledPin, OUTPUT);
// set enablePin high so that motor can turn on:
digitalWrite(enablePin, HIGH);
}
void loop() {
// if the switch is high, motor will turn on one direction:
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
delay(500); // waits for a second
// if the switch is low, motor will turn in the other direction:
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
delay(500); // waits for a second
}