Introduction: Movable Light-up Bat Signal
This instructable was created in fulfillment of the project requirement of the MAKEcourse at the University of South Florida (makecourse.com).
Most of us should recognize the iconic signal (albeit slightly modified) as one of DC Comics' popular superhero and Justice League member - Batman. For those of you who are fans, like me, you'll get to create your very own bat signal so you can alert the Caped Crusader to imminent danger. This project can be fun for any comic book fan.
The project is powered using an Arduino Uno R3 and utilizes an RGB strip and 3D parts among other things.
Step 1: Components Used
3D printed parts:
- 1 Batman logo
- 1 Lamp
- 1 Enclosure (bottom and lid) (DC-47P Electronic Enclosure) (http://www.polycase.com/dc-47p)
- 1 Lamp Neck
- 1 Lamp Base
- 1 Bolt
Hardware:
1 Arduino Kit (Find it here) which includes parts for the project:
1 Arduino Uno R3
1 USB cable
multicolored jumper wires (need 17 for this project)
1 mini breadboard
1 IR remote (YK-001) (need a CR2025 battery that isn't included) (Order it here)
1 IR receiver
1 servo motor (9g)
Additional hardware:
1 AA 12V battery pack - (superbrightleds.com)
8 AA batteries
1 Plexiglas oval (or clear printed part, whichever you prefer)
3 Adafruit TIP120 Darlington Transistors (http://www.adafruit.com/product/976)
1 Adafruit RGB LED weatherproof flexistrip - 30 m (cut down to 6 LEDs) (http://www.adafruit.com/product/285)
1 Adafruit 4-pin JST SM Plug + Receptacle Cable Set (http://www.adafruit.com/product/578)
Other:
- Phillips head Screwdriver
- Acrylic Paint - Black
- Wire Stripper or Scissors
- Solder kit w/ solder and colored wires
- Laser cutter (optional)
- Dremel kit
- Black electrical tape
- Sand paper - coarse grit
- Arduino IDE - free to download
- AutoDesk Inventor (or whichever CAD software you prefer)
- 3D printer
Step 2: 3D Printed Parts
This project relies heavy on a 3D printer. I used printers available on campus for a small fee. For the MAKEcourse, I was given an enclosure, but also had it in .stl files so we could add modifications to it. This is what I did. I made a hole in the front so that the IR remote can communicate with the IR receiver. I also made a thin strip in the back so that the power supply and/or USB cable can be connected to the Arduino without too much hassle. I also made a hole in the top of the enclosure so that the wires from the RGB strip and servo motor can reach the breadboard and Arduino. Alternatively, you can use a drill to make the holes that you need.
The square hole in the Lamp Base where the servo motor sits can be modified by using a dremel with an attachable sander. Use sandpaper to smooth down any rough areas that you may see.
The Lamp of the Bat Signal can be made a little deeper and wider so that the RGBs can fit better, but otherwise is an ideal size.
The top of the Enclosure, Lamp Neck, and Lamp Base were printed separately and hot glued together. This was to prevent errors made from the 3D printers that tend to happen when making a large part.
The Batman logo is hot glued to the Plexiglas oval that fits snugly into the lamp and can be removed if access is needed. The oval part was made with a laser cutter on campus and was sanded down so that it would fit smoothly in place.
I used the paint to cover the hot glue and make it blend. The bolt was in a different color, so I painted to match the project.
The Plexiglas oval was cut with a laser cutter. The dimensions were created with the lamp dimensions in mind. I was able to create a slightly bigger oval that was able to snap into place when smoothed over with sand paper. To check the dimensions of the lamp, you can use a vernier caliper. I used Plexiglas that was available at the lab, but you can get a sheet at your local home depot or department store. (Also, as mentioned in step 1, you can print a clear 3D printed piece if a laser cutter is not readily available.)
The zip file all contain the .stl files for the 3D printer.
Attachments
Step 3: Electrical Components
The pictures can be hard to follow so I will explain. Top left is the wiring for the servo and to the right is the wiring of the RGB strip. For the project, you simply have to put them together onto one breadboard.
The IR receiver has a designated pin of 11 (orange wire). The blue and black wires are connected to the power (red) and ground (blue) of the breadboard, respectively. When looking at the receiver with the bubble facing you, the leftmost pin is for the orange pin, the middle is for the ground, and the right is for the power.
The servo motor can be connected by connecting the ends of three jumper wires into the end of the tri-colored wire attached to the servo. Tip: black is typically used to represent ground; the closest color to that is brown, so that is ground and is connected to the ground of the breadboard, the middle wire is red and is the power wire that connects to the red strip of the breadboard, the yellow wire is the wire that connects to the Arduino. In this case, that is pin 6.
From the breadboard, the ground and power are aligned by two additional wires, black and red, and are connected to the ground and 5V pins, respectively.
The transistors are used to regulate the power between the RGB strip so that it doesn't short. When looking at the transistors from the metal side, wiring is simple. The leftmost pin is designated for ground, the middle is power and these wires connect to the wires for the strip. The rightmost pins connect to the pins on the Arduino. In the picture, from right to left: red wire is to pin 2, green wire is to pin 3 and blue wire is to pin 5. (This is explained further in the Arduino code.)
When looking at the connector of the RGB strip with the metal slits facing you, from right to left: blue wire, red wire, green wire, orange wire goes to VIN pin on Arduino.
Lastly, the ground from the transistors align with a ground jumper wire (black) and connect to another ground pin on the Arduino.
Step 4: Arduino Code
For the remote to work, you need to insert the C2025 battery.
Fun Fact: Infrared light cannot be seen by the human eye and is located just below the visible light spectrum. To check if your remote is working, turn on the camera of your phone, hold the phone with the IR bulb facing the camera and push any button. You should see a flashing light coming from the bulb. This tells you that it's working and you can say that you have successfully seen infrared light and can show your friends!
//Code for Movable Bat Signal //Written by Rachel Porter Spring 2015
#include #include Servo myservo; int IR_PIN = 11; int SERV_PIN = 6; int P_RED = 2; int P_GREEN = 3; int P_BLUE = 5; unsigned long lastresult = 0;//the last code from remote - keeps last value so that the last thing you did can be repeated IRrecv irrecv(IR_PIN);//IR receiver is connected to pin 11 int pos = 0;//the initial position of the servo arm is at 0 degrees decode_results results;//decoder for the results. The 8 number sequences assigned to the buttons on the remote are defined and given certain actions.
struct color{//creating a new type of variable "byte" that is able to manipulate the three variables below into different colors by using the numbers 0 to 255 byte r; byte g; byte b; };
color c_blue = {255, 0, 0};//r,g, and b can be manipulated either individually or at the same time so they can make different colors color c_red = {0, 255, 0}; color c_green = {0, 0, 255}; color c_orange = {0, 255, 65}; color c_purple = {255, 255, 0}; color c_none = {0, 0, 0}; color c_white = {255, 255, 255}; color c_yellow = {0, 255, 80};
void changeColor(struct color rgb, float brightness){//changing the brightness of the rgb colors if(brightness >= 0.0 && brightness <= 1.0){ analogWrite(P_RED, rgb.r * brightness); analogWrite(P_GREEN, rgb.g * brightness); analogWrite(P_BLUE, rgb.b * brightness); } }
void changeColor(struct color rgb){//rgb strip is analog as opposed to digital analogWrite(P_RED, rgb.r); analogWrite(P_GREEN, rgb.g); analogWrite(P_BLUE, rgb.b); }
void setup() { Serial.begin(9600);//default for the Arduino. Initializes serial connection myservo.attach(SERV_PIN);//the servo is attached to the servo pin (pin 6) defined above irrecv.enableIRIn();// Start the receiver myservo.write(0);//start position at 0 degrees pinMode(2, OUTPUT);//pins 2, 3, 5 send out information instead of receiving information pinMode(3, OUTPUT); pinMode(5, OUTPUT); }
void loop() { if (irrecv.decode(&results)) {//decode the 8 digit sequence coming from the remote buttons to their corresponding commands if(results.value == 4294967295){//happens when holding down the positive button results.value = lastresult; } switch(results.value){ case 16754775: //the positive button moves lamp up if(pos < 90){ //postion goes no higher than 90 degrees pos += 5; //the servo arm moves in increments of 5 degrees } break; case 16769055://the negative button moves lamp down if(pos > 0){//position is greater than 0, but less than 90 pos -= 5; //servo arm moves in increments of 5 degrees } break; case 16756815://last channel button makes no color changeColor(c_none); break; case 16736925://mode button makes the color blue changeColor(c_blue); break; case 16753245://power button makes the color white changeColor(c_white); break; case 16761405://play/pause button makes the color green changeColor(c_green); break; case 16769565://mute button makes the color red changeColor(c_red); break; case 16750695://100+ button makes the color purple changeColor(c_purple); break; case 16720605://previous button makes the color orange changeColor(c_orange); break; case 16712445://next button makes the color yellow changeColor(c_yellow); break; case 16748655:// EQ button makes the rainbow changeColor(c_white); delay(1000); changeColor(c_red); delay(1000); changeColor(c_orange); delay(1000); changeColor(c_yellow); delay(1000); changeColor(c_green); delay(1000); changeColor(c_blue); delay(1000); changeColor(c_purple); delay(1000); changeColor(c_white); delay(1000); changeColor(c_none); break;
case 16738455://0 button uses white strobe light - flashes 6 times changeColor(c_white); delay(100); changeColor(c_none); delay(100); changeColor(c_white); delay(100); changeColor(c_none); delay(100); changeColor(c_white); delay(100); changeColor(c_none); delay(100); changeColor(c_white); delay(100); changeColor(c_none); delay(100); changeColor(c_white); delay(100); changeColor(c_none); delay(100); changeColor(c_white); delay(100); changeColor(c_none); delay(100); break; case 16724175://1 button does the red strobe light - flashes 6 times changeColor(c_red); delay(100); changeColor(c_none); delay(100); changeColor(c_red); delay(100); changeColor(c_none); delay(100); changeColor(c_red); delay(100); changeColor(c_none); delay(100); changeColor(c_red); delay(100); changeColor(c_none); delay(100); changeColor(c_red); delay(100); changeColor(c_none); delay(100); changeColor(c_red); delay(100); changeColor(c_none); delay(100); break; case 16718055://2 button uses orange strobe light - flashes 6 times changeColor(c_orange); delay(100); changeColor(c_none); delay(100); changeColor(c_orange); delay(100); changeColor(c_none); delay(100); changeColor(c_orange); delay(100); changeColor(c_none); delay(100); changeColor(c_orange); delay(100); changeColor(c_none); delay(100); changeColor(c_orange); delay(100); changeColor(c_none); delay(100); changeColor(c_orange); delay(100); changeColor(c_none); delay(100); break; case 16743045://3 button uses yellow strobe light - flashes 6 times changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); changeColor(c_yellow); delay(100); changeColor(c_none); delay(100); break; case 16716015://4 button uses green strobe light - flashes 6 times changeColor(c_green); delay(100); changeColor(c_none); delay(100); changeColor(c_green); delay(100); changeColor(c_none); delay(100); changeColor(c_green); delay(100); changeColor(c_none); delay(100); changeColor(c_green); delay(100); changeColor(c_none); delay(100); changeColor(c_green); delay(100); changeColor(c_none); delay(100); changeColor(c_green); delay(100); changeColor(c_none); delay(100); break; case 16726215://5 button uses blue strobe light - flashes 6 times changeColor(c_blue); delay(100); changeColor(c_none); delay(100); changeColor(c_blue); delay(100); changeColor(c_none); delay(100); changeColor(c_blue); delay(100); changeColor(c_none); delay(100); changeColor(c_blue); delay(100); changeColor(c_none); delay(100); changeColor(c_blue); delay(100); changeColor(c_none); delay(100); changeColor(c_blue); delay(100); changeColor(c_none); delay(100); break; case 16734885://6 button uses purple strobe light - flashes 6 times changeColor(c_purple); delay(100); changeColor(c_none); delay(100); changeColor(c_purple); delay(100); changeColor(c_none); delay(100); changeColor(c_purple); delay(100); changeColor(c_none); delay(100); changeColor(c_purple); delay(100); changeColor(c_none); delay(100); changeColor(c_purple); delay(100); changeColor(c_none); delay(100); changeColor(c_purple); delay(100); changeColor(c_none); delay(100); break;
}<br> myservo.write(pos);//writes the position of the servo. if(results.value != 4294967295){//This happens when holding down the negative button. Returns to initial position.
lastresult = results.value; } irrecv.resume(); // Receive the next value } }
Attachments
Step 5: RGB Strip
The RGB strip uses 12V of power, which is why the 12V battery pack is used. You can go for the AA version or the D version if you'd like, but keep in mind the D version is bigger as it also needs 8 batteries. Or you can use a 12V power supply that plugs into an outlet, but there isn't a guarantee you will be near an outlet, and the battery pack makes it portable.
A friend of mine was kind enough to let me borrow his soldering iron. Along with it, he had 4 spools of wires, which I used on the strip. Then, I stripped down the wires on the 4 pin JST SM Cable Set with scissors and twisted the wires to their respective RGB wire, then taped over them individually, as shown above. I then taped down the wire until the part that sticks out of the lamp (seen in next step) is a solid color and wires aren't sticking out everywhere.
Step 6: Assembly
1. Hot glued base of bat signal together
2. After it has dried, paint over the glue to make the part look more homogenous and blended better.
3. Hot glue the logo to the Plexiglas oval
4. Set up the RGB strip in the lamp and then placed the Plexiglas into it (Note: if needs to be removed, use a pen or small screwdriver to push it out by sticking it through the hole in the back.)
5. Set up the servo in the square without its arm.
6. Attach the lamp to its base by using the bolt and attaching the servo arm so that it can turn the lamp. (Make sure the way you have oriented the servo with its arm that when its turned on, and the arm sets to 0 degrees, its in the correct position.)
7. Place the breadboard and Arduino into the box. Remove the backing from the breadboard and make sure the IR sensor is aligned with the hole in the front of the box. Secure the breadboard in place so there isn't so much moving.
8. Connect everything together using jumper wires.
9. Plug in the 12V power supply
10. Test out the bat signal to see if everything is working properly.
11. If just testing it out, you don't need to screw the box together, but if using it in the long term, it would be ideal.
12. You're done!!!!!!!! Enjoy your very own bat signal that you made yourself!!!!!!!!
Step 7: Final Project and Video Demonstration
I would like to thank the following people:
Francarlos Fernandez for helping me with the code and explaining it to me and for letting me borrow his soldering iron.
The AVC team for being patient with me when I requested parts. Also for printing my parts in such a timely manner.
Mr. Schlaf for being an A for Awesome instructor.
And the A for Awesome TAs, Patrick Curran, Rebecca Ellis, Laurel Smith, and Scott Enzinna, along with co - instructor Eric Tridas for answering all of my questions.
Thanks again,
I had a really amazing year and I learned so much.