The Haunted Portrait
The Haunted Portrait is an interactive Arduino-programmed animatronic that uses a sensor to measure the distance between the user and the portrait to change its color and therefore, its image. This was achieved by printing two superposed images in either only red or only blue tones, and by playing with a color changing Led string.
Supplies
FOR THE ARDUINO SETUP
- HC-SR04 sensor
- Arduino board
- Protoboard
- 6m LED string lights
- 2 1kΩ resistances
- 2 TIP 12 transistors
- 12 connecting cables (male to male)
FOR THE FINAL PRODUCT
- Wooden frame (A3)
- A3 Canvas frame
- Glue
- A3 printed portrait (in 3D effect)
- An A4 foam board/ A4 wood board+
- 4 angle bracket
Schematic of the Electrical Connections
This is how the final setup should look like. The setup includes the connections for the distance sensor, with all of its connections to the 5V power port, the trigger and echo outputs connected to the pins 12 and 13, and the ground output connected to the ground. It also includes the connections for the LED string, for which only the RED and BLUE outputs have been used, since the color GREEN wasn't needed. The 12V output has also been connected to the V IN input. In order for the LED to work, the RED output was connected to the protoboard, using the assistance of a TIP12 transistor. Additionally a 1kΩ resistance, a connection to the ground and a connection to its corresponding pin were connected. The same was done for the color BLUE.
Program Your Arduino
Use this code to program your Arduino
Downloads
Build Your Haunted Portrait
The building process for this project is relatively simple. In the first place, you need to get your portrait photo ready. You can find one that already includes BLUE-RED superposition or you can make it yourself like we did. To make it, we used photoshop and for one of the layers we turned off all colours except for red, and the same for the other photo but leaving only blue on. Once you have this you can start putting everything together. Use the canvas frame to secure the printed portrait onto. We used super glue to secure it down. Once that is done, flip the canvas over and start attaching the LED lights all around the canvas' border, and make sure they are secured correctly by using glue or tape if you want to reuse them. After the LEDs are positioned, secure the Arduino and protoboard onto the foam or wood board, by using super glue if it's a permanent project, or double sided tape if you want to reuse the components. Once this is done, you can attach it onto the back of the canvas frame. We used hardware tips and a hammer to correctly attach it. Make sure the Arduino is reachable to connect the power jack that will turn the lights on. Now you only need to secure the canvas frame onto the actual frame. To do this use the 4 angle brackets and attach one leg onto the wooden canvas frame and the other onto the frame back, using screws and a screwdriver. Now connect the power jack and watch the magic happen!
TIP: You can superglue the glass onto the frame so it doesn't move or fall.
Final Thoughts
In this project we have learned to combine different Arduino elements and adapt their functions to contextualize it with Halloween. It has been a fun way to learn how to write basic computer code and learn the basic functions of the arduino.