Post Presentation
Post the Presentation works¶
Fluf BOT captured my claps and moved but it took and processed noises other than my claps as well. I’d like to make more clear that it moves with the sound given by me. I did some additional works on my Fluf BOT. I summarized the works in PostPresentation page. It focused to show sound and move in the development.
The remaining issues are,
-
Fluf BOT itself is making “Sounds(noises)” such as sounds of motors and sound of skull & boxes when it moves and the sound sensors react to the “Sounds” in addition to my claps.
-
It is not clear when Microcontroller takes signals from the sound sensors. It seems that Microcontroller takes signals once completed the loop formulae and it is not easy to know when it happen.
LM393¶
I used two LM393 sound sensors for Fluf BOT in the presentation. Each of them has a potentiometer to adjust its sensitivity manually.
In order to avoid reacting the sounds other than that given by me,
- Need to lower Sensitivity
- Goes too low makes nothing happen
- Need equal sensitivity about Right and Left sensors
- Goes a bit high sensitivity, both sensors send signals as “High” and always Move forward.
Conclusion :
Worked on adjustments a couple of days. But still could not find good tunings. It is having limits to control Fluf BOT’s by adjusting sensitivity of sound sensors alone.
Max 4466¶
Max4466 is an adjustable gain electret sound sensor. Since it can measure voltage of signals, it might give me additional way to control signals processing in microcontroller.
With changing sensors to Max4466, I updated the program as well.
- Changes from digitalRead to analogRead.
- Set threshold to control signals
- Add breaks(moveStop) to wait Claps(Sounds from outside).
- move short distance to catch next sounds soon
# include <Servo_megaTinyCore.h>
//#include <Servo.h>
Servo myservo; // create servo object to control a servo
int rightDC1 = 8;
int rightDC2 = 9;
int leftDC1 = 0;
int leftDC2 = 1;
int pos = 90; // variable to store the servo position
const int rightSensorPin = 15;
const int leftSensorPin = 16;
float right_sound = 0; // added
float left_sound = 0; // added
float rightVal = 0; // changed bool to float
float leftVal = 0; // changed boot to float
float threshold = 0.75;
void movetail() {
for (pos = 90; pos <= 180; pos += 1) { // goes from 90 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 0; pos <= 90; pos += 1) { // goes from 0 degrees to 90 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
void moveForward() {
digitalWrite(rightDC1, HIGH);
digitalWrite(rightDC2, LOW);
digitalWrite(leftDC1, HIGH);
digitalWrite(leftDC2, LOW);
}
void moveStop() {
digitalWrite(rightDC1, LOW);
digitalWrite(rightDC2, LOW);
digitalWrite(leftDC1, LOW);
digitalWrite(leftDC2, LOW);
}
void turnLeft() {
digitalWrite(rightDC1, HIGH);
digitalWrite(rightDC2, LOW);
digitalWrite(leftDC1, LOW);
digitalWrite(leftDC2, HIGH);
}
void turnRight() {
digitalWrite(rightDC1, LOW);
digitalWrite(rightDC2, HIGH);
digitalWrite(leftDC1, HIGH);
digitalWrite(leftDC2, LOW);
}
void setup() {
myservo.attach(10); //attaches the servo on pin 10 to the servo object
pinMode(leftSensorPin, INPUT); //pin 16 an input pin.
pinMode(rightSensorPin, INPUT); //pin 15 an input pin.
Serial.begin(9600);// initialize the serial port:
}
void loop() {
// analog sound input
right_sound = analogRead(rightSensorPin); //changed digital to analog
left_sound = analogRead(leftSensorPin); //value is between 0 and 1023
// mic level ajustment in serial plotter
rightVal = (right_sound ) / 1024; // added
leftVal = (left_sound ) / 1024; // value is between 0.5 and 1
// when the sensor detects a signal above the threshold value set on sensor, turn finder to the direction of sound
Serial.println("rightVal=" + String(rightVal) + " ,leftVal=" + String(leftVal));
if (leftVal > threshold && rightVal > threshold) {
Serial.println("move forward");
moveForward();
delay(500);
}
if (leftVal < threshold && rightVal > threshold) {
Serial.println("turn right");
turnRight();
delay(500);
}
if (leftVal > threshold && rightVal < threshold) {
Serial.println("turn left");
turnLeft();
delay(500);
}
moveStop();
}
About Fluf BOT’s physical sounds, - I made sure if Max4466 well placed at ear hole.
- Since Max4466 capture even finger touch to it as signals, I put a piece of plastic bags in ear hole too. It might amplify a sound physically.
- Fix Skull and box to reduce rattling sounds
Slide & Video using Max4466¶
- Changed sound sensors to max4466
- Updated programs for Max4466
- Others, no changes
- Making sounds by touching body and voice since Clap sounds couldn’t captured well by Max4466.
Bill of Materials¶
Item | Qty | Unit Price(JPY) | From | Site |
---|---|---|---|---|
Servo | 1 piece | 850 | Amazon | link |
Burlap | 0.5M | 300 | Amazon | link |
Polyester Resin Base | 1 box | 1990 | Monotaro | link |
Catalyst | 1 bottle | 999 | Monotaro | link |
Mobile battery | 2 pack | 2500 | Amazon | link |
Stepper Motor | 2 piece | 300 | Amazon | link |
Sound sensor | 2 piece | 333 | Amazon | link |
M3 Screw / Nuts | 1 set | 765 | Amazon | link |
Fake fur(Boa) | 0.5M | 765 | Yuzawaya | |
Thread | 1 | 100 | Daiso | |
ATtiny3216 | 1pc | 133 ea. | DigiKey | link |
DRV8835 | 1pc | 300 | Akizuki Denshi | link |
Heat sink | 1pc of 1 pack(Large and small) | 180/pack | Akizuki Denshi | link |
AA battery | 7pc of 1 pack(10pc) | 319/pack | Monotaro | link |
Battery case | 2 set | 299 ea. | Monotaro | link |
Small Hook | 2pc of 1 pack(6pc) | 100/pack | Daiso | |
ball | 1pc of 1 pack(10pc) | 149/pack | Monotaro | link |
Cable tie(30cm) | 1 of 1 pack(20pc) | 298/pack | Super Viva home |