Anglerfish Motion Detector Lamp

by Giniago in Circuits > Arduino

137 Views, 0 Favorites, 0 Comments

Anglerfish Motion Detector Lamp

13F02EC6-79EC-4EFA-8C43-A43FB1608DE3.jpeg
Anglerfish

Welcome to my Instructables project, where I will guide you through the process of creating a fascinating deep-sea anglerfish replica with a unique twist. This project involves incorporating two PIR (Passive Infrared) motion sensors as the fish's eyes, allowing it to detect movement in its surroundings. Based on the detected movement, the fish's lamp will change color, creating an enchanting visual effect.

The deep-sea anglerfish is a fascinating creature known for its bioluminescent lure that attracts prey in the darkness of the ocean depths. Drawing inspiration from this captivating natural adaptation, I have designed a replica that replicates the anglerfish's distinctive feature using modern technology.

By utilizing PIR motion sensors, we can simulate the anglerfish's ability to sense movement in its environment. When one sensor detects motion, the fish's lamp will emit a mesmerizing turquoise glow. If the other sensor detects movement, the lamp will illuminate in a vibrant pink hue. And when both sensors register movement simultaneously, the lamp will radiate a captivating shade of purple.

Throughout this Instructables guide, I will walk you through the step-by-step process of assembling the anglerfish replica, wiring the motion sensors, and programming the color-changing LED lamp. Whether you are an electronics enthusiast or simply curious about creating unique decorative pieces, this project is sure to provide an exciting and educational experience.

So, let's dive into the depths of this project together and create our very own deep-sea anglerfish with motion-detecting eyes. Get ready to bring a touch of the underwater world into your own space and marvel at the magical glow of this mesmerizing creature!

Supplies

Electronic components:

  • Arduino uno
  • 2 x PIR Motion Sensor
  • WS2812 RGB LED (Adafruit NeoPixel)
  • cable (4 x black, 4 x red, 3 x blue)
  • circuit board
  • battery Clip (with 5.5mm jack)
  • 9V D battery

Housing material:

  • Balloon
  • wood glue
  • paper
  • wire (I used plant wire, 2mm and jewelry wire, 0,3mm)
  • Beads
  • acrylic paint (black, blue, red, glossy topcoat)
  • hotglue refill sticks
  • painters tape (paper based)
  • black fabric

Tools:

  • paintbrush
  • hot glue gun
  • Wire stripper
  • Tongs
  • Soldering Iron
  • Soldering tin
  • scissors

Testing

4BF4C27B-CAB3-4929-87A3-4FEE042E33DB.jpeg
1491B6B7-2091-4099-9F76-6B0008D984D0.jpeg
EB0933FF-BDE5-47DC-AB4C-6AD31B74A630.jpeg
Testing

During the testing phase of this project, I employed a breadboard and buttons to simulate the functionality of the motion sensors before integrating them into the final design. This approach allowed me to ensure that the basic circuitry and logic were functioning correctly before introducing the actual PIR (Passive Infrared) sensors.

Using the breadboard, I connected the buttons to the microcontroller, mimicking the input signals that would be received from the motion sensors. This setup enabled me to test and refine the code logic responsible for changing the color of the fish's lamp based on the detected movement. By pressing the buttons, I could simulate the presence of movement on either side of the fish.

Once I was satisfied with the functionality of the code and the responsiveness of the lamp to button presses, I proceeded to switch out the buttons with the actual PIR sensors. This transition allowed me to replace the manual input simulation with real-time motion detection.

During this transition, I also had to make adjustments to the sensor settings using the two sensitive "screws." Fine-tuning the sensitivity of the PIR sensors was a challenging task. These adjustments were necessary to ensure accurate motion detection and prevent false triggers. Careful calibration was required to strike the right balance and optimize the performance of the anglerfish replica.

By thoroughly testing the circuitry and code logic with the breadboard and buttons initially and then switching to the PIR sensors, I ensured the seamless integration of the motion-detecting functionality into the anglerfish replica. This iterative approach, along with the delicate sensor adjustments, allowed me to fine-tune the project and deliver an engaging and captivating experience to anyone interacting with the final product.

Building the Fish

2EB18E92-0820-4587-8C82-E04F894C04BD.jpeg
4A994A72-01AE-40FB-AB4A-8D8CEFC79D0E.jpeg
6E0C54A0-9CC5-4EAC-ADC2-96762AB97E42.jpeg
6CC866AA-59D9-449F-A54F-698547F876E7.jpeg
4D58ABB5-16B6-4E98-8EA5-9EC5BAF22C57.jpeg
C3D315C9-E801-4FAC-AC45-77C1F770391D.jpeg
0D224535-BAC3-484E-A497-40023F52614C.jpeg
D647B83E-974C-4433-84C1-9C96B132B072.jpeg
24F70EE5-E1A2-4CED-9F57-DB1EA467896C.jpeg
C6F95000-D6D0-4758-B6D4-1C47DAA6141C.jpeg
DDC0D82C-02E2-4137-BF37-D551DDCC6CF1.jpeg
  1. Inflate the balloon to a suitable size.
  2. Coat the entire balloon with a thick layer of wood glue and paper, ensuring it dries thoroughly.
  3. Cut a hole at the bottom of the fish for stability and space for the Arduino later. Strengthen this opening with wire.
  4. Attach a cone shape at the back of the fish to enhance its fish-like form.
  5. Cut an opening for the mouth and attach lips using tape and paper.
  6. Shape wire into fins and secure them in place with tape. Fill any gaps with tape.
  7. Cut holes for the eyes, ensuring they are the same size as the PIR sensors. Attach a paper ring around them with tape.
  8. Cut a hole at the top for the fishing rod. Wrap wire around a marker to form a tube. Bend it slightly and seal with tape. Create a small ball at the front using thin wire and decorate with beads.
  9. Coat the entire fish with wood glue and let it dry.
  10. Use acrylic paint to color the fish according to your preference (e.g., leaving the fish black and adding blue accents to the fins, and red accents to the lips). Apply a gloss finish to the lips and fins.
  11. Shape teeth using wire and glue them inside the mouth.
  12. Create eyelashes by forming hot glue on a plastic surface, peeling them off, and then attaching them around the eyes.
  13. Attach black fabric inside the mouth using hot glue.
  14. Use hot glue to add texture to the fins.
  15. Additionally, I included a wooden underplate to securely attach the Arduino, battery, and cables, keeping everything neatly in place. This underplate provides stability and ensures that the components remain fixed and organized within the fish structure. By securely fastening these elements, the overall integrity and longevity of the project are enhanced, allowing for a more reliable and durable setup.

Please note that when working with hot glue or any tools, take appropriate safety precautions and ensure proper ventilation.

The Wiring

879C16A6-1946-46FF-9212-AE94EF4B8607.png
36A30172-3166-4F58-A34F-447DF44FAA8E.jpeg
DFDA01D5-A04B-4124-B56C-F0FE26F27585.jpeg
2706A75F-8319-4B50-8173-F790856103E4.jpeg
0F148C7B-4338-461D-A52A-ECC9A8F8DD2C.jpeg
A45E504A-2E61-44E1-BA11-00EB7E3B5FDE.jpeg

To wire the components, connect the red wires to each other and the black wires to each other on the soldering board, ensuring a proper connection. Locate the pins on the components and solder the wires accordingly. Use black wires for the ground connection, red wires for the 5V power supply, and blue wires for the output connection.

It is important to ensure that the wires are long enough to reach all the necessary points within the fish. This will allow for proper placement of the components inside the fish and ensure they are securely connected.

An additional note when soldering the LED is that it may not fit through the tunnel of the fishing rod after soldering. In this case, it is advisable to thread the cable through the tunnel first and then solder the LED lamp onto it. This allows for easier assembly and ensures that the LED can be securely placed inside the fishing rod.

Using a breadboard for testing before soldering everything together can be helpful to verify the circuit's functionality and make any necessary adjustments before finalizing the wiring. This testing phase allows you to ensure that all the components are functioning as expected and that the connections are accurate before permanently securing them in the fish.

Additionally, for power supply, simply plug in the battery to provide the necessary voltage. The battery connection can be easily integrated into the circuit, ensuring a convenient and portable power source for the fish.

The Code

#include <Adafruit_NeoPixel.h>
//pin led
#define PIN 2
#define NUM_LEDS 1

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

//declare sensor pin
int sensor1 = 4;
int sensor2 = 6;


//Value for sensors
int val1 = 0;
int val2 = 0;

void setup() {
  
 pinMode(sensor1, INPUT);  // initialize sensor as an input
 pinMode(sensor2,INPUT);
 Serial.begin(9600);    

 strip.begin();
 strip.show(); // Initialize all pixels to 'off'
}

void loop() {

 val1 = digitalRead(sensor1);
 val2 = digitalRead(sensor2);
 // read the state of the sensor value:
  
  

 // check if the sensor is activated. If it is, the val is HIGH:
  if (val1 == HIGH && val2 == HIGH) {
  // turn LED off:
  strip.setPixelColor(0, 100, 0, 255);
  strip.show();
  }
 else if (val1 == HIGH) {
  // turn LED on:
  strip.setPixelColor(0, 255, 0, 100);
  strip.show();
 } else if (val2 == HIGH) {
  // turn LED off:
  strip.setPixelColor(0, 0, 255, 150);
  strip.show(); 
 }
 else{
  strip.setPixelColor(0, 0, 0, 0);
  strip.show();
 }
}

Upload to Your Arduino

  1. Connect your Arduino board to your laptop or computer using a USB cable.
  2. Launch the Arduino programming software (Arduino IDE).
  3. In the Arduino IDE, go to "Sketch" and select "Include Library," then click on "Manage Libraries."
  4. In the Library Manager, search for "FastLED" and click on the "FastLED" library by NeoPixel. Click the "Install" button to download and install the library.
  5. Once the library is installed, go to "File" and select "Examples," then navigate to the FastLED library and Upload the code.
  6. You can customize the code to match specific requirements of your deep-sea anglerfish project, including the pin assignments and the color sequence based on the motion sensor inputs.
  7. After modifying the code, go to "Tools" and select the appropriate board type and port under the "Board" and "Port" menu options.
  8. Click on the "Upload" button (right arrow icon) to compile the code and upload it to the Arduino board.
  9. The Arduino IDE will show the uploading progress, and once the process is complete, the code will be running on your Arduino board, ready to control the deep-sea anglerfish's color-changing lamp based on the motion sensor inputs.

Make sure to verify the pin assignments and any other necessary configurations in the code to match your specific hardware setup

Conclusion

In conclusion, the creation of the deep-sea anglerfish with motion-detecting eyes was a fulfilling project. The construction of the fish itself required a significant amount of time and attention to detail, but it offered ample opportunities for creativity and customization. This project is particularly suitable for decoration, especially in children's spaces, as it captures their imagination and adds a touch of magic to the environment.

It's important to note that the fish's motion detection and light effects work best in low-light or nighttime conditions. The sensitivity of the PIR sensors ensures accurate movement detection, creating an impressive and immersive light display. Consider placing the fish in a dimly lit area to maximize its visual impact.

For those seeking an extra thrill, there's the option to make the fish more frightening to amuse or scare others. By altering the design and incorporating more eerie elements, the anglerfish can become a spooky addition to Halloween decorations or haunted house setups.

Overall, this project combines various skills, such as crafting, electronics, programming, and creativity. It provides a rewarding experience and the opportunity to showcase your innovation and artistic flair. Whether you choose to delight children or create a thrilling ambiance, the deep-sea anglerfish with motion-detecting eyes is sure to capture attention and spark conversations.