Bubbly Blower Hat Inspired by Spongebob Squarepants

by HDuzenli in Circuits > Arduino

52 Views, 0 Favorites, 0 Comments

Bubbly Blower Hat Inspired by Spongebob Squarepants

bubbly blower hat

This arduino projects was made at the University Of Stuttgart at the Institute for Computational Design (ICD). The task was to create a 'useless machine' using at least one sensor and one motor. This project is a hat that blows bubbles the more light the hat senses. It was inspired by the episode One Krabs Trash of the show Spongebob Squarepants.

Supplies

Screenshot 2024-06-09 180025.png
bauhelm-rot-en397-baustellenhelm~2.jpg
kabelbinder-schwarz-4-8x200-1011008_3a.jpg
s-l1600.png
  • arduino uno
  • mosfet
  • jumper wires
  • light sensor from the arduino kit
  • water bubble gun toys (https://www.amazon.de/dp/B087JT6WQ3?psc=1&ref=ppx_yo2ov_dt_b_product_details)
  • breadbord
  • cable ties
  • diodes
  • 9v power supply
  • inside of construction helmet
  • trucker hat with mesh surface in the back (https://www.ebay.de/itm/354925992092?mkcid=16&mkevt=1&mkrid=707-127634-2357-0&ssspo=-ftucajbq2o&sssrc=2047675&ssuid=XL83Y1xeQrC&var=624219770284&widget_ver=artemis&media=COPY)

Adjust Toy and Assembly Cap

Screenshot 2024-06-09 180136.png
Screenshot 2024-06-09 180343.png
Screenshot 2024-06-09 180418.png
Screenshot 2024-06-09 180435.png
IMG_1859.jpg
  1. The bubble blowing mechanism of the toy is removed.
  2. the inside of the construction helmet is removed
  3. the #1 is drawn on the trucker hat
  4. the inside of the construction helmet is fittet into the trucker cap
  5. the bubble blowing mechanisms are mounted with help of the cable ties to both sides of the cap
  6. the arduino and the breadbord is mounted with help of the cable ties to the back of the cap
  7. the light sensor is mounted on top of the cap and connected to the arduino via breadbord
  8. two 9v batteries are mounted at the back, one powering the arduino and the other one powering the bubble throwers

Coding and Calibrating

Screenshot 2024-06-09 180236.png
Screenshot 2024-06-09 180255.png
Screenshot 2024-06-09 180510.png
Screenshot 2024-06-09 180535.png

After the assembly of the hat, the code was written. Which is explained as follows:

Initialization:

  • Define the pins for the phototransistor and the output, along with a threshold value. In the setup() function, initialize the serial communication for debugging and configure the output pin as an output, ensuring it starts in the LOW state.

Reading the Sensor Value:

  • In the loop() function, read the brightness value from the phototransistor connected to the analog pin.

Debugging Output:

  • Print the sensor value to the Serial Monitor to monitor the brightness level detected by the phototransistor.

Threshold Check:

  • Compare the sensor value to the predefined threshold. If the sensor value exceeds the threshold, proceed to regulate the power output. If the sensor value is below the threshold, set the output pin to LOW.

Power Regulation:

  • If the sensor value exceeds the threshold, map the brightness value to a PWM range (0-255) using the regulatePower() function. This function sets the output pin to the regulated power value using PWM and prints the regulated power value to the Serial Monitor for debugging.

Delay:

  • Add a small delay in the loop() function to avoid overwhelming the Serial Monitor with too many messages in quick succession.