Sound activated baby mobile by TheLoupen 3d model
Warning. This content is not moderated and could be offensive.
m4
3dmdb logo
Thingiverse
Sound activated baby mobile by TheLoupen

Sound activated baby mobile by TheLoupen

by Thingiverse
Last crawled date: 3 years, 5 months ago
Simple baby mobile motor that activates when baby makes noise.
Only the axle needs supports (touching buildplate, 45 degrees)
Print the axle and hanger at 100% infill. Print the rest at 30% infill.
Other supplies:
Arduino Nano
28BYJ-48 Stepper motor
Stepper Controller (ULN2003)
608RS Bearing 8x22x7mm (or equivalent)
Sound Sensor
M3 screws
Wires
M4 nuts and bolts
Thanks to https://www.thingiverse.com/thing:3051036 for the stepper motor mount.
Here is the code I used:
include
define A 2
define B 3
define C 4
define D 5
const int stepsPerRevolution = 200;
int soundSensor = 7;
int FirstTime = 1;
Stepper myStepper(stepsPerRevolution, 2, 3, 4, 5);
void setup(){
myStepper.setSpeed(45);
pinMode(A,OUTPUT);
pinMode(B,OUTPUT);
pinMode(C,OUTPUT);
pinMode(D,OUTPUT);
pinMode (soundSensor, INPUT);
}
void write(int a,int b,int c,int d){
digitalWrite(A,a);
digitalWrite(B,b);
digitalWrite(C,c);
digitalWrite(D,d);
}
void spins(int times) {
myStepper.step(times);
write(0,0,0,0);
}
void loop()
{
int statusSensor = digitalRead (soundSensor);
if (FirstTime == 1) {
spins(50000);
FirstTime = 0;
}
else {
if (statusSensor == 1) {
spins(50000);
}
else {
write(0,0,0,0);
}
}
}

Tags