Chest Expansion Regulating Fan Speed- a Game

by poultonmt in Circuits > Arduino

234 Views, 0 Favorites, 0 Comments

Chest Expansion Regulating Fan Speed- a Game

Screen Shot 2022-04-14 at 5.26.21 PM.png

This project was a made with the combined efforts of Ghaidaa Al Khafaji, Nate Jones, and Matt Poulton (myself) for our Wearable Bioinstrumentation course at Virginia Tech. We were tasked with creating an interactive biofeedback demonstration that takes a biosignal and has an engaging output with real-time controls. We decided to create a system where a fan was powered by a variable voltage based on the signal received from a chest band. The amount of power the fan received was based on a percentage of maximum voltage and how close the user was to their maximum chest expansion. The deeper the breath, the more power to the fan.

The fan was used to push a ping pong ball out of a tube and down a ramp, full of obstacles to bounce off of, and into the target zone, which was full of cups. The goal of the game was to turn on the fan and make a ball into the cup.

Supplies

You will need a few things to make the game work:

  • Arduino Uno microcontroller
  • Breadboard
  • Wire jumpers
  • Alligator clip cables
  • 5V DC brushless fan (any fan with PWM capabilities and adequate output will do)
  • Clear acrylic tube (diameter must be slightly larger than the fan diameter)
  • Electrical or duct tape
  • Hot glue
  • Stretch sensor that changes resistivity when it is pulled apart (conducive fabric would also work)
  • Buckles, straps, and nylon belt material to create your chest band
  • Ping pong balls or any lightweight ball whose diameter is slightly smaller than the tube
  • Cups
  • Cardboard

Assemble the Belt

Screen Shot 2022-04-14 at 6.14.06 PM.png
Screen Shot 2022-04-14 at 6.13.45 PM.png
Screen Shot 2022-04-14 at 6.14.52 PM.png

You will need to create a chest band for the input to the circuit. Cut about 2 to 3 feet of belt material for each half of the belt. Remember, these two halves will be linked by the stretch sensor. Run your belt material through an slidable buckle and loop the end of your belt material into the male end of the belt buckle. Do the same with your other half with the female buckle. Pull the remaining slack back over and into the slidable buckle. This will allow you to adjust the length of the belt to accommodate different sized chests. With the opposite end of the belt, you will need to find a way to connect your stretch sensor to the chest band. We used 2 adjustable buckles and a metal D clip on each end. We looped the belt through one buckle, into the D clip, and pulled the belt back through into the adjustable buckle. Once this was secured, the same was done with the stretch sensor on the opposite side of the D clip. This was mirrored on the opposite half of the belt. Once you have completed this, the chest band is finished!

Construct the Circuit

Screen Shot 2022-04-14 at 6.18.02 PM.png
Screen Shot 2022-04-14 at 6.18.50 PM.png
Screen Shot 2022-04-14 at 7.57.25 PM.png

Construct the circuit using a series of wire jumpers and single resistor. Start by connecting the Arduino Uno ground and 5V pins on the analog side to the ground and positive (+) rails on the breadboard. Also connect the ground on the digital side of the Arduino to the breadboard ground. From there you can start filling in the circuit.

Connect a wire from the ground to a row, both on the breadboard. In the same row, connect a wire that will serve as a terminal for the chest belt. You can clip on end of an alligator clip to this wire and the other end to the stretch sensor. Connect another alligator clip to the opposite end of the stretch sensor and another wire. Plug this wire into a separate row on the breadboard. In the same row, form a voltage divider by spanning a 100 ohm resistor between this row and the ground. In the same row still, connect a wire to A0 pin on the Arduino. By doing this, 5 volts will be run from the Arduino, through the stretch sensor in the chest band, and back to Arduino for processing.

Lastly, connect the fan to the circuit. Plug in the red (+) and black (-) wires into the positive and ground rail in the breadboard. Connect the pulse width modulating (PWM) wire to a separate row in the breadboard and then connect another wire from that row to the D10 pin. Our fan had a fourth wire (signal wire) that had no use so it was plugged into an empty row.

Fit the Tube and Write Code

Screen Shot 2022-04-14 at 6.17.18 PM.png

In order to aim the ball, you will need to fit the fan inside a tube. We suggest placing the tube vertically on a flat surface, sliding the fan into the tube (upside down), and aligning the fan in the center of the tube while looking down. Have a hot glue gun and some electrical or duct tape on hand to secure the fan in position. You can write a quick script and try turning on the fan once you think you have it positioned in the center and listen for the fan hitting the sidewall. Once you have it centered, you can hot glue or tape the fan in place. We used hot glue on the mounted frame of the fan and then sealed the edges with electrical tape so that no air could escape out the sides. Make sure not to cover the backing of the fan because it will need airflow from the back side to fill the tube in order to push the ball. Once the tube and fan are mated, test the setup with the tube laying horizontally and loaded with a ball. The fan should have enough power to push out the ball with its maximum voltage supplied.

Once the fan and tube are finished, write your code however you want. Our code was written in MATLAB and started with 5 seconds for calibration for the user to breathe deeply and exhale fully. This allowed the Arduino to detect the user's maximum and minimum voltages associated with chest expansion. The rest of the code read the detected voltage, related that to how the chest was expanded, and output a corresponding voltage to the fan. A deeper breath will stretch more of the sensor on the chest belt, create a lower resistivity, and a greater voltage will be received by the Arduino. The Arduino will then translate the detected voltage into an output voltage to the fan. The closer the received voltage is to the maximum voltage, the higher percentage of the 5V is sent to the fan. Our MATLAB code is provided at the bottom of this section.

Create Your Track

Screen Shot 2022-04-14 at 6.19.11 PM.png
Screen Shot 2022-04-14 at 7.26.12 PM.png

Be creative! We used an unfolded cardboard box to make a ramp and rested it on another box. The box served both as a platform and a storage container for the whole system. On the ramp, we hot glued dixie cups in random locations to make pegs for the ball to bounce off of. We hot glued more cardboard to the front on the platform box to make sidewalls so that the ball would not bounce away. On the end of the track, we hot glued more dixie cups inside of a shoebox style cardboard box. These were the target cups. By using a box with a lid, you can fold up the lid to make a backboard for the ball to bounce off of more (we left the backboard down for the purposes of the demonstration and photos so you could see the contents of the box). Don't forget to secure your ramp and boxes with plenty of tape and glue and to make bumpers on the sides of the ramps so that the ball does not escape.

Test Your Contraption

Screen Shot 2022-04-14 at 6.18.24 PM.png

With your chest band, fan, tube, circuit, and track assembled, it is time to test your system. out on the chest band, try out the code, see if the fan can push the ball given your input, and try to make the ball in a cup. You can see which cups are harder to hit and assign points to each cup. Make it challenging! Try moving the fan from left to right along the top of your track. Does the left side make more cups than the middle or right? Experiment with positioning.

Raise Fan Heigh (optional)

Screen Shot 2022-04-14 at 6.19.47 PM.png

If you need to, you can raise the base of the tube where the fan is seated in order to help the ball come out faster if needed. This may not be necessary but we needed to give the ball a little assistance because our fan was not extremely effective at pushing the ball out as fast as we wanted. Just cut out a few cardboard rectangles and mount the tube on top of it. If your track has a lip like ours, You can use these cutouts to match the heigh, so the fan is not fighting gravity. You can also slide the fan from the to right and try to hit different cups. Have fun!