MagicRaven

by marcfiguerasf in Circuits > Arduino

268 Views, 1 Favorites, 0 Comments

MagicRaven

IMG_8145.JPG

This is our Halloween project, the MagicRaven, an automated raven that scares anyone who comes close enough… 

Constructed with recycled cardboard for the full body parts (including the head), methacrylate combined with nuts and bolts for the internal structure, black spray paint and feathers, combined with the dry leaves on his floor leaves us with a project with real scary environment.

For the electronic parts, we used two servomotors for the head and wings respectively, as well as two red leds for the eyes, all this system comes to life when anyone comes by near enough to activate the ultrasonic sensor which is also connected to the arduino and is the ‘starter’ for our system.

Supplies

Captura de pantalla 2021-11-04 a las 19.17.19.png
Captura de pantalla 2021-11-04 a las 19.16.30.png

Here you can see some of the tools and materials we used in this project;

-Materials list:

  1. Recycled cardboard and egg-cups
  2. methacrylate
  3. Nuts and bolts
  4. Metallic ball joint
  5. Metallic sergeants
  6. Servo motors
  7. Wires
  8. Arduino board
  9. Ultrasonic sensor and red leds
  10. Feathers
  11. Black spray

-Tools list:

  1. Cutter
  2. Super Glue
  3. Regular white glue
  4. Pen
  5. Laser cutter
  6. Scisors
  7. Screwdrivers
  8. File
  9. Tape

TinkeraCad Schematic

PHOTO-2021-11-04-02-50-44.jpg

Our electronics schematic for the arduino connections with the different sensors used in our project resumed and rendered on the page TinkerCad

Code

#include <HCSR04.h>

#include <Servo.h>

//We include the sensor and the servomotors from the library

const byte triggerPin = 6;                       

const byte echoPin = 5;

//We put 6 and 5 as input and output constants to the sensor

//triggerpin sends an ultrasound pulse (input) and the Echo (output) takes care of receiving it.


UltraSonicDistanceSensor distanceSensor(triggerPin, echoPin);

Servo myservo; // create servo object to control a servo

Servo myservo1; // create second servo object to control a servo


int pos = 0;  // variable to store the servo position

int led1=8;  //variable for my leds

int led2=7;

void setup() {

 pinMode (led1, OUTPUT); pinMode (led2, OUTPUT);//we said that led one has and output in the position 7 

 myservo1.attach(10);// attaches the servo on pin 10 to the servo object

 myservo.attach(11);// attaches the servo on pin 11 to the servo object

}


void loop() {

 float distance = distanceSensor.measureDistanceCm();

 if(distance<20){//if the distance is less of 20 cm

 digitalWrite(led1, HIGH);//the leds turn on

 digitalWrite(led2, HIGH);

 delay(1000);// waits 1000 ms for the sensor for the sensor to tell you if the condition

 //of being closer than 20 cm is still met and the light continues to turn on

 for (pos = 0; pos <=180 ; pos += 1) { // goes from 0 degrees to 180 degrees

  // in steps of 1 degree

  myservo.write(pos);       // tell servo to go to position in variable 'pos'

  delay(5);           // waits 5 ms for the servo to reach the position

  myservo1.write(pos);       // tell servo to go to position in variable 'pos'

  delay(5);

 }

 for (pos = 30; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees

  myservo.write(pos);       // tell servo to go to position in variable 'pos'

  delay(5);  // waits 15 ms for the servo to reach the position

  myservo1.write(pos);       // tell servo to go to position in variable 'pos'

  delay(5);

 }

 }

 else if(distance>20)//if the distance is bigger than 20 cm

 digitalWrite(led1, LOW);//the leds turn off

 digitalWrite(led2, LOW);

  for (pos = 90; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees =don't move

  myservo.write(pos);

   delay(5);// waits 5 ms for new orders

  myservo1.write(pos); // goes from 180 degrees to 0 degrees =don't move     

  delay(5); // waits 5 ms for new orders

   

}

 }

  

Guide: How to Build It

122bfd5d-7290-462e-abac-e70f450806d3.JPG
33ab0ac4-90af-485a-b417-2dbdf6ce722d.JPG
2941e7a1-1b19-43cf-93b7-ef03ecdabae3.JPG
3cb247e6-310c-4151-9515-dc6734d5e95e.JPG
a2c70935-d36c-427e-8f8b-e4dd483baf36.JPG
b816e839-42c5-4ed3-b80a-af4d34eb55a1.JPG
2B168F8C-A4EF-4688-8E3E-B891A214D664.JPG
IMG_8075.JPG
6119f821-bae0-4ba4-b82c-66bc8854323d.JPG
9d5d9e70-d15f-4c8c-ac24-b784a6867c73.JPG
b39af64a-c032-4298-a095-65fdd19de0eb.JPG
  1. Cut the cardboard with the structural requirements we fitted (different forms and patterns of the raven)
  2. Put all the different parts together to form a 'case' for the mechanical parts
  3. Laser-cut with our dwg document the structural parts
  4. Put the laser-cut methacrylate parts together with bolts and nuts
  5. Insert the servo motors on the built in holes
  6. Connect the wings and head with metal bendable bars to the servos
  7. Create a 'base support' box with recycled wood to hide all the electronic components
  8. Connect the different sensors to the arduino board and try the code with what you have built
  9. Once the code is fine and all parts move and shine correctly, apply the cardboard case to the structure
  10. Paint everything visible in black
  11. Apply black feathers
  12. Apply the dryed leaves to the box (base support) floor
  13. Attach every sensor to its destination: Leds on the head (eyes)
  14. Try everything out, and enjoy your super scary automated Raven!

Conclusion

This project has been scary since the first day, but through hard work we made it. Starting with the arduino knowledge we had, he thought on what can be done for this project. Ultrasonic sensor, servo motors and leds, lead us to this raven idea which we made real.