Peep Behind the Curtain Robot
by FluffyMichael03 in Circuits > Arduino
141 Views, 1 Favorites, 0 Comments
Peep Behind the Curtain Robot
![StartingPic.png](/proxy/?url=https://content.instructables.com/FVG/ZDPN/LIAAH75J/FVGZDPNLIAAH75J.png&filename=StartingPic.png)
Everyone has player Peep Behind the Curtain at least once in their lives. But for that, you need a referee. With this, you can play it completely solo! (or with one other friend) Simply press the button on the front of the robot to start the game.
Supplies
Electric components:
- 1 Arduino UNO
- 1 USB-B cable
- 1 External Powerbank
- 3 Micro Servo’s
- 1 Red LED
- 1 Push button switch (4 pin)
- 1 URM37 V5.0 ultrasonic sensor
- 1 220Ω Resistor
- 1 10kΩ Resistor
- 13 Female-X Jumper wires
- Hot glue gun or strong tape
If you plan on soldering:
- 1 4cm*6cm PCB
- 9 Male-X Jumper wires
- X Wires
- Soldering Iron
- Soldering tin
- Cable stripper
If you don't plan on soldering:
- 1 breadboard
- X Male-Male Jumper wires
Prototype Movement
![TestingStep](/proxy/?url=https://content.instructables.com/F7J/24M3/LHW0382T/F7J24M3LHW0382T.jpg&filename=TestingStep)
There was a lot of fiddling around for the movement. Especially for the arm itself. You must make sure that the servo can move 180 degrees freely without bumping into the casing. But you also don’t want to expose the components themselves too much.
Making the Case
![Onderdelen.png](/proxy/?url=https://content.instructables.com/FCT/11J9/LHW038LQ/FCT11J9LHW038LQ.png&filename=Onderdelen.png)
You can make your robot/creature however you like. But this is how I made mine and where all of the components are placed. You can base the minumum size of the robot of of the size of your distance sensor and arduino board.
Assembling the Robot
![BodyFull.png](/proxy/?url=https://content.instructables.com/FRQ/E057/LHW038BG/FRQE057LHW038BG.png&filename=BodyFull.png)
Once you have every separate part, you can begin to assemble the robot together. Start by hot gluing the three servos and their connector parts in place. Then you can put in the distance sensor, LED, and button. These don’t necessarily need to be glued in place, but you can do it for extra support.
Don’t glue or tape down any of the boards yet. This will come later.
Code
The code for this project is provided below, but here’s another overview of how the code works.
- Push the button to activate the robot.
- The red LED turns on and the robot begins to look for movement.
- The robot first scans the left half, registering and saving all the values.
- Then it goes back to the middle, comparing the saved values with the values that it just scanned.
- It repeats this for the right side.
- If any of the value’s difference is higher than the set parameter, it points towards the angle where it detected the movement. Then it will wait for a bit, before returning to its neutral position and turning off.
- If all the values fall between the parameters, the robot will ‘close its eyes’. The robot won’t scan for movement and the red LED will turn off. It will stay off for a couple of seconds. Afterwards, it goes back to scanning.
- This process will repeat itself until movement has been detected, or if the button is pressed. If the button is pressed, that player wins the game.
Downloads
Soldering
![SoldeerhulpOhms.png](/proxy/?url=https://content.instructables.com/FEA/6Z00/LHW03D9C/FEA6Z00LHW03D9C.png&filename=SoldeerhulpOhms.png)
For this project, I soldered everything, but you can also get away with using a breadboard. Because everything has to be assembled beforehand, make sure everything works before soldering everything together.
!!Keep your wires longer than you think you’re going to need!! I made the grave mistake of making the wires exactly as long as needed, which resulted in them ripping out a couple of times because of the jerky head movement. You can mitigate the jerkiness of the head by adding some weight into it.
*Side note* In this project, I have three micro servos attached to the Arduino itself. The maximum for an Arduino to handle is two servos. Otherwise, it could fry your board. In this case it’s mostly fine, because the three servos never fire at the same time. But if you value your board, I advise you to link the servos to a separate power source. *
Ending
![Peep Done](/proxy/?url=https://content.instructables.com/FET/KMA6/LIAAH75D/FETKMA6LIAAH75D.jpg&filename=Peep Done)