The best tools to make your project dreams come true

Login or Signup
USD


By Adafruit Industries

Make It Bubble

Courtesy of Adafruit

Overview

Who doesn't love getting a bottle of bubbles to have fun with friends and pets? What's that? You get tired of all that blowing?

Figure 1A

Circuit Playground Express comes to the rescue. Along with the Crickit robotics controller, you can build a simple robot that dips the wand in bubble solution and blows the bubbles for you! Great at parties!

This guide will show you how to build your own bubble blowing robot.

Figure 2

Parts

Supplies

You'll want to go to your local store and pick up the following:

  • 2 x Bubble Solution: Liquid Bubbles with 1" (2.5 cm) bubble wands.
  • 1 x Container: 2" x 4" (5 cm x 10 cm) or so, deep enough to dip bubble wand in sideways, 1.5" (2.5 cm) or so.
  • 1 x Legos or other parts mounting items: Legos make for a flexible way to mount the fan and servo for the project.
  • 1 x Super Glue: For gluing mounts to bases. Hot glue may also work.

There are a number of bubble solution recipes on the Internet if you would like to mix up your own. If you decide to make your own bubble wand also, note that the container will need to be deeper than the diameter of the bubble wand.

Sub-Assemblies

Electrical Connections

Figure 3

Use the assembly instructions for attaching the Circuit Playground Express to the Crickit.

The servo plugs into the Crickit board in the block of pins marked Servo. The lightest color (yellow/orange) connects to the signal pin near the board edge. The connector side with the black wire faces the center of the board.

For the DC motor, use alligator clips to the motor wires, connect the pin ends to the Motor 2 pins (the ground and Motor 1 pins are unused). The clips will connect to the motor connection wires. If you ever find the fan running backwards, power off the project and swap the alligator connections which will reverse the direction of the motor.

The Wand

If you have very long bubble wand handles, you may need to trim them. About 8 cm / 3" works well but you'll want to check the mechanics of your setup to ensure things will work.

Select a servo horn from the package that comes with the servo. I used the X shaped horn but the double inline one is fine. The wand will be connected to the servo horn using the long pointy screws that come with the servo.

Drill two holes using a tiny drill bit that matches holes in the horn. Take the horn and using a short screw, connect the horn to the servo.

Screw the wand onto the horn. Alternatively, you can try to hot glue or super glue the wand onto the horn. Gluing will not allow removal of the wand and since the wand covers the horn attachment screw, the horn is permanently attached. Screws would be best.

Attach the horn to the servo body with the short screw provided. If you use the longer screw it might damage the servo. The longer screws are used to attach items like the wand to the horn.

Figure 4

The wand screwed onto the horn and flat top Lego pieces glued onto the motor mounts.

Mounting the Motor and Servo

I chose Lego to build mounts for this project. It allowed for positioning both the servo and the fan motor in many different ways to find the best configuration.

To make the DC motor Lego compatible, I super glued two pieces, one 2x1, another 2x2 - both with flat heads. For the Servo, I used two 2x2 flat head pieces. If you do not have these pieces in your Lego box, they can be obtained from https://shop.lego.com. If you need additional "standard" pieces to mount the motor and fan, plan on picking those pieces up at the same time.

Figure 5

Super glue two 2x2 tiles onto the servo and one each 2x2 and 2x1 onto the DC Motor Mount. Allow to dry.

You can now snap the DC motor into the motor holder and press on the fan blades.

Your Bubble Container

Your container with all the bubble solution in it should preferably be square and deep:

  • A bit deeper than the diameter of the bubble wand so the servo can fully dunk the wand into the solution and coat the surface. Less than a full dunk does not guarantee the wand has the full amount of solution to produce bubbles.
  • Square helps fit against the base of the servo. When the wand is moved by the servo up and down, you need to ensure the wand does not hit any part of the bubble mixture container, bottom or sides.

Leftover food containers and takeout containers might work. The one below came as a craft container from Michaels.

Figure 6

Check your plastic container selection for a somewhat deep rectangular or square container, a bit deeper than the diameter of your bubble wand.

Code

You can code this project in either Microsoft MakeCode or CircuitPython, both are super easy.

MakeCode

Time to tell the bot what to do in Microsoft MakeCode. If you are new to using MakeCode and Circuit Playground Express, see this guide to demonstrate how to get things going.

The program for the bubble machine only takes a few code blocks:

Figure 7

Open this Example in MakeCode

When the boards power on, on start is run. The DC motor with the fan is set to 100% speed. Feel free to adjust this if it is too strong for your setup and solution - a lower value might prevent bubbles popping immediately when the wand comes up.

The forever loop lifts the wand out of the solution (angle 30 degrees), waits two seconds, then dips it down again waiting 2/5ths of a second in the solution before repeating.

CircuitPython

The CircuitPython code is very similar to the MakeCode. Motor 2 for the fan is turned on and the servo is told to move up and down at timed intervals. I had to adjust one angle from 165 in MakeCode to 145 in CircuitPython to get the movement the same as the MakeCode.

 

Copy Code
# CircuitPython 3.0 CRICKIT dMake It Bubble
import time
from adafruit_crickit import crickit

motor_2 = crickit.dc_motor_2
motor_2.throttle = 1 # full speed forward

while True:
print("servo up")
crickit.servo_1.angle = 30
time.sleep(2)
print("servo down")
crickit.servo_1.angle = 145
time.sleep(0.4)

 

Possible Modifications to the Code

If the servo angles do not correspond to your setup, they should be adjusted accordingly. It might be easier to remove the servo horn, twist it to the area you want the wand to move and resecure it if the horn screw is accessible.

The pauses between actions are adjustable to your setup. You may need more than 2 seconds to have the fan blow all of the bubble fluid off the wand. If it is blowing bubbles at too fast a rate, adjust the 400 milliseconds up.

If the fan is blowing too hard, you can do two things:

  1. Adjust the fan further back from the wand.
  2. Adjust the fan speed in the sketch to be lower.

The fan does not need to be at 100% (CircuitPython 1). Probably you do not want it much below 75% (CircuitPython 0.75), the factor here is the viscosity/thickness of the bubble solution. If it is real thick, more air will be needed.

Final Assembly

We will need to give both the fan and the servo some height:

  1. The servo is placed high enough so the wand can dip down into the bubbles, then back up to catch the breeze of the fan.
  2. The Fan to have the air stream plow through the center of the wand to have the bubbles come out.

You can see the Lego pieces I used, your configuration may be different (this is why I chose Lego, fast prototyping, no sawing of wood or fiddling with metal).

Figure 8

Both the fan and the servo have a base to lift them to the correct heights.

Below is the final bubble blower assembled. It uses a base that is 10x10 and I used one that was one block high to give the fan and servo more lift when placed against the container of bubbles.

Figure 9

I originally had the fan back to provide a weaker blowing force for my first bubbles. I think adding additional solution made my mixture harder to blow so the fan was carefully moved close to the wand. This is the beauty of Lego and other methods of mounting, if you find your configuration isn't ideal, you can quickly change it. Everyone's situation is different.

Connecting the Crickit

Make sure the DC motor and the servo are connected to the Crickit per the diagram on the previous page, just in case you had to disconnect things to get them placed together. The final setup is pictured below:

Figure 10

Be sure the bubble solution doesn't get on the Crickit.

Use

Figure 11

Bubbles

Figure 12

You will want a good quantity of bubble solution. I went to Wal-Mart and they had a six-pack of large bubble bottles. Each has a wand in it.

Fill the Container

Fill your container so that the bubbles cover the end of the wand every time the wand is dipped down by the servo. If you try the machine out and the servo is not moving the wand correctly you can either take the servo horn off and twist it or change the angles in the code to the two locations you need.

Location, Location, Location

Consider using this project outside. the bubble solution may spill and the bubbles popping will make things wet and soapy.

Have Fun!

Have fun with your project!

Figure 13

Key Parts and Components

Add all Digi-Key Parts to Cart
  • 1528-2280-ND
  • 1528-2631-ND
  • 1528-1075-ND
  • 1528-1150-ND
  • P646-ND
  • 1528-2654-ND