As this week’s prompt is to use a motor to make a human action/emotion, I decided that I wanted to develop on my plant pot project that I had for the midterm.
Because my project then was already essentially anthromorphosising the plant pot into having human characteristics – the raising of the brows and/or the frowning of them – I wanted to develop something that would make it even more human.
Human/Robotic Legs – DISASTER STRIKES
I initially stuck two servos together to build a leg (so I had 4 servos) and angled and programmed them so that they could essentially have some sort of movement that allows them to move forward (the code for it I found online and just made some minor adjustments). The legs worked at first and I thought that I had finished with the assignment but then I realised that two of the servos were burning up. I thought that perhaps it was because I didn’t have a resistor for my servos, but I was questioning this fact because for the previous times that I have used servos, I didn’t use resistors and they worked fine. I decided to scratch this idea and work on something else that perhaps could be more fun and less disastrous.
Spinning “Talk to Me” Sign – not humanistic but used a form of motor
I wanted to stick to my project from last time and develop it, but the only other human characteristics I could think of was something physical/more action-based. Last time’s project was humanistic in the sense that it was an emotion. However, I could only think of either legs, arms, mouths or ears and because the legs didn’t work out, and I thought that the arms would basically resemble Yoon Hee’s project, and the ears and mouths would basically be the same thing as the eyebrows I made. I, therefore, decided to move away from making something that resembled some sort of human characteristic (essentially what I made last week) to making something really stupid (perhaps an addition to my stupid pet-trick).
I wanted to make a sign that would say “Talk to Me” when the sound detector doesn’t detect any sound and would not say anything when the sound detector detects sound.
I didn’t know how to do the above and so I settled on just having a sign that would rotate with the servo and would spin when there wasn’t a sound detected and would stop the spinning if a sound was detected.
The code for this project was developed from my project from last time where I added another servo:
#define PIN_GATE_IN 2
#define IRQ_GATE_IN 0
#define PIN_LED_OUT 13
#define PIN_ANALOG_IN A1
void soundISR()
{
int pin_val;
pin_val = digitalRead(2);
}
#include <Servo.h>
int servoPin = 10;
int servoPin2 = 9;
int servoPin3 = 6;
Servo Servo1;
Servo Servo2;
Servo Servo3;
int angle = 0;
void setup()
{
Servo1.attach(servoPin);
Servo2.attach(servoPin2);
Servo3.attach(servoPin3);
Serial.begin(9600);
// configure input to interrupt
pinMode(2, INPUT);
// attachInterrupt(IRQ_GATE_IN, soundISR, CHANGE);
// Display status
Serial.println(“Initialized”);
}
void loop()
{
int value;
// Check the envelope input
value = analogRead(A5);
// Convert envelope value into a message
Serial.print(“Status: “);
if(value <=10)
{
Serial.println(“Quiet.”);
Serial.println(“In Quiet”);
Servo1.write(45);
Servo2.write(125);
Servo3.write(100);
Servo3.write(angle++);
delay(250);
}
else if(value >= 11)
{
Serial.println(“Loud.”);
Serial.println(“In Loud”);
Servo1.write(10);
Servo2.write(160);
delay(250);
//Servo1.write(90);
delay(100);
}
// pause for 1 second
delay(750);
}
The video of my project is shown here:
I wanted the sign to spin faster but I didn’t know how to programme and write the code so that it would do so. I changed the angles, tried to use the for() function but nothing would work out so I kept it as Servo3.write(angle++) which just essentially made it spin very slowly.