No Touch Lid
![IMG_6121.jpeg](/proxy/?url=https://content.instructables.com/FJC/XS7H/LUB8W3KY/FJCXS7HLUB8W3KY.jpg&filename=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](/proxy/?url=https://content.instructables.com/FBO/EKFV/LUB8W3LJ/FBOEKFVLUB8W3LJ.jpg&filename=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](/proxy/?url=https://content.instructables.com/FBK/0A18/LUCOBCZT/FBK0A18LUCOBCZT.jpg&filename=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](/proxy/?url=https://content.instructables.com/FB5/UTHX/LUCOBD0A/FB5UTHXLUCOBD0A.jpg&filename=IMG_6142.jpeg)
![IMG_6140.jpeg](/proxy/?url=https://content.instructables.com/FV3/8K15/LUCOBD0M/FV38K15LUCOBD0M.jpg&filename=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](/proxy/?url=https://content.instructables.com/FM8/XLFT/LUB8W3U9/FM8XLFTLUB8W3U9.jpg&filename=IMG_6128.jpeg)
![IMG_6127.jpeg](/proxy/?url=https://content.instructables.com/FX3/YFUJ/LUB8W3VH/FX3YFUJLUB8W3VH.jpg&filename=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](/proxy/?url=https://content.instructables.com/FOJ/B2BP/LUCOBD0Z/FOJB2BPLUCOBD0Z.jpg&filename=IMG_6148.jpeg)
![IMG_6146.jpeg](/proxy/?url=https://content.instructables.com/FT0/83XF/LUCOBD1D/FT083XFLUCOBD1D.jpg&filename=IMG_6146.jpeg)
![IMG_6138.jpeg](/proxy/?url=https://content.instructables.com/F7G/DPB2/LUCOBD1R/F7GDPB2LUCOBD1R.jpg&filename=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](/proxy/?url=https://content.instructables.com/FFK/412J/LUCOBD28/FFK412JLUCOBD28.jpg&filename=IMG_6135.jpeg)
![IMG_6131.jpeg](/proxy/?url=https://content.instructables.com/FS6/QMGO/LUCOBD2P/FS6QMGOLUCOBD2P.jpg&filename=IMG_6131.jpeg)
![IMG_6129.jpeg](/proxy/?url=https://content.instructables.com/FM7/4L9V/LUCOBD52/FM74L9VLUCOBD52.jpg&filename=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](/proxy/?url=https://content.instructables.com/F45/JIUC/LUB8W43V/F45JIUCLUB8W43V.jpg&filename=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](/proxy/?url=https://content.instructables.com/FAI/4EHJ/LUB8W457/FAI4EHJLUB8W457.png&filename=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](/proxy/?url=https://content.instructables.com/FTL/Y54V/LUB8W45J/FTLY54VLUB8W45J.jpg&filename=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.