No Touch Lid

by eblazick in Circuits > Arduino

66 Views, 0 Favorites, 0 Comments

No Touch Lid

IMG_6121.jpeg

I designed and crafted a hands-free lid box that automatically opens when an object approaches within 5 inches and closes when the hand is removed. This innovative creation was part of a project for my design, making, and building class.

Supplies

IMG_6133.jpeg

The tools and materials include styrofoam, duct tape, Chat GPT, an UNO R3 Controller Board, a Servo Motor SG90, an Ultrasonic Sensor, an 830 Tie-Points Breadboard, Female-to-Male Dupont Wires, Breadboard Jumper Wires, and a USB Cable.

Form Box

IMG_6132.jpeg

Cut six squares of styrofoam and assemble them to form a box. Then, attach a piece of duct tape along the back and top parts of the box to fashion a lid.

Space for Servo Motor

IMG_6142.jpeg
IMG_6140.jpeg

Next, cut out a section on the right side of the box. This space will accommodate the Servo Motor.

Attach Servo Motor

IMG_6128.jpeg
IMG_6127.jpeg

Now, secure the Servo Motor in place using duct tape within the space you cut on the right side of the box.

Using Breadboard Jumper Wires

IMG_6148.jpeg
IMG_6146.jpeg
IMG_6138.jpeg

Next, using breadboard jumper wires to connect the Servo Motor's orange wire to pin 11 (or use PIN number in your code) on the UNO R3 Controller Board, insert the red wire into the red line on the Breadboard, and attach the brown wire to the GND slot on the UNO R3 Controller Board.

Using Femal-to-male Wires

IMG_6135.jpeg
IMG_6131.jpeg
IMG_6129.jpeg

Now, grab your Ultrasonic Sensor and attach your female-to-male Dupont wires. Start by connecting a brown wire from the Vcc on your sensor to the red line on your breadboard. Next, use an orange wire from the Trig pin on the sensor and connect it to pin 9 (or use PIN number in your code) on your UNO R3 Controller Board. Then, use a red wire from the Echo pin on the sensor and attach it to pin 10 (or use PIN number in your code) on the UNO R3 Controller Board. Lastly, use a black wire from the Gnd pin on the sensor and connect it to the GND slot on the UNO R3 Controller Board.

Securing the Ultrasonic Sensor

IMG_6121.jpeg

Now, using duct tape to attach the sensor to the box. Cut two thin strips of duct tape, one to run vertically along the middle of the sensor and the other horizontally along the bottom. Ensure the sensor is angled upward by securing the duct tape firmly at the top and allowing it to loosen slightly at the bottom.

Prompt Chat GPT

Screenshot 2024-03-28 at 4.36.18 PM.png

Next, prompt ChatGPT to generate a code for the Arduino IDE with the following request: "Please write a code for the Arduino IDE using an SR04 ultrasonic sensor, a UNO microcontroller, and an SG90 servo motor. I would like the servo motor to rotate 90 degrees when an object is detected within a range of less than 5 inches. Additionally, when the object is no longer detected, the servo motor should rotate back to its initial position (0 degrees)."

Connect USB Cable

IMG_6123.jpeg

Finally, connect your USB cable from the UNO R3 Controller Board to your device running the Arduino IDE, where you'll upload the code generated by ChatGPT.