Arduino Bubble machine
For this week's assignment, I am yet again inspired by my adorable niece. She is turning 4 years old soon and she loves blowing bubbles.
I saw a very cool device that can make bubbles in big amounts, ideal for birthday parties. I will try to make a colorful bubble blower using arduino, a fan and a servo motor. So my niece can have bubbles with a click on a button.
Tinkercad for testing the circuits.
Arduino software to write the code and upload the code to the Arduino Uno board
I used the servo motor, fan, led, resistor, ultrasonic sensor, arduino uno, starter cables, crocodile wires, 5 volt adaptor
Tinkercad drawing
In Tinkercad I assembled the inputs and outputs using a breadboard. I connected the servo motor to the positive and negative row on the breadboard. The signal of the servo is connected to pin 13.
After making the physical circuit I struggles with the motor driver so I changed back to a fan. I also struggled with the potentiometer so I chose the ultrasonic sensor to be activated automatically upon approaching the bubble machine.
Making the circuit on Tinkercad was helpful to visualize initially, but I changed a lot throughout the week by trying to connect each input and output one by one.
I started by including the servo motor from the library and announcing the different integers, and naming the pins.
The ultrasonic sensor also will be tested to measure the distance we can then use in the code to activate a positive or negative output depending on the distance.
In the setup we declare which pins are input and output.
In the loop I used if - then - else.
If the button is on, I want the led on pin 2 and fan on pin 9 to be on high.
If the button is off, I want to the led and fan off.
I used _pullup for the button code.
For the ultrasonic sensor if someone is closer then 30 cm, the servo motor will start moving. The servo will only go down 90 degrees to touch the soup mixture and go back vertical to be infrong of the fan.
1) Inspiration videos: DIY Bubble blow machine - Arduino bubble machine - Arduino bubble maker
2) Inspiration project on printables: arduino bubbles
3) Inspiration project on instructables: automatic bubble blower
For the physical circuit, I chose to activate the led and fan by the button. These will provide the air for the bubbles and atmospheric light.
The servo motor which will hold the bubble handle will be activated automatically and turn back and forth 90 degrees upon approaching the machine. To have bubbles only when someone is playing around the machine.
I attached the trigger and echo to pin 13 and 12. VCC to positive row breadboard and GND to ground breadboard.
Servo motor is connected to ground and power on breadboard, input is connected to pin 11.
The led has a resistor. Anode to negative row breadboard, input to pin 2.
The fan is connected to external adaptor and 5 volt transistor. Transistor is connected to pin 9 and to ground and positive row of the external adaptor. Both grounds on the breadboard are common.
I added all parts to the cardboard and reconnected the wires.
For the bubble mixture I used soap and water. I couldn't find the blowing stick in regular stores around me, so I decided to burn a hole in the spoon for a short time solution since there is a deadline.
I used the spoon and container first to allign the distance and position of the fan and the servo motor. I used a longer container because I saw in the inspiration videos that the aggressive movement of the servo can cause some splashes and drop.
The movement of the arm is good and the positioning.
Yet no bubbles were produced in the first half minute. The splashes were too big. I think having the store bought or 3D printed slotted handle for the bubble blowing would be less messy.
I also think the fan is too weak and/or the hole for the bubbles too big.
EOW Practice
While practicing the EOweek videos, I struggled with including the lcd to my circuit and make it run.
First I couldn't find the right library to run it since the suggested library wasn't available anymore. I reached out in troubleshooting on Slack and one of the instructors shared a link for a working library.
After testing the 'hello world code´, I noticed another library worked. But now the code that was mentioned in the EOWeek practice slides gave me error messages.
I found a thread on arduino page speaking about this issue, saying that the code was outdated. I changed lcd.init to lcd.begin for example.
My final project will have multiple inputs and outputs. I will have to write a code to make Arduino execute all the actions I want to happen in my project.
This week's classes have helped me in understanding how to write a code that can execute multiple actions.
I struggled a lot with the practice videos and making the code for the circuits using only text. I pushed myself to keep searching for extra videos on Arduino and now I find myself enjoying them a lot.
So this week I learned that even though something is hard and intimidating, I can push through that bad feeling and might even come to enjoy something I was averse from in the start.
In the first weeks of the diploma, the learning curve was easier since I already loved laser and 3D machines.
I was able to visit a CNC this week to try making the new prototype. I had a piece of extra wood laying around but I made my drawing 2 cm too big to fit.
Because of the new drawing skills in Fusion I was able to on spot quickly change the drawing and make the width 2 cm smaller without having to make other adaptations to the drawing. Before in autocad I wasn't able to make such quick changes on spot without internet access.