Overengineered Screaming Ball

by Joris_d in Circuits > Arduino

295 Views, 2 Favorites, 0 Comments

Overengineered Screaming Ball

20200112_154421.jpg
20200112_154411.jpg
20200112_154348.jpg
20200112_154341.jpg
20200112_154319.jpg
20200112_154355.jpg

Welcome to my instructable on how to make a useless screaming ball, this ball really doesn't do a whole lot more than make a lot of noise when you roll or move it.

Supplies

For this you will need the following:
  • Arduino UNO
  • MPU6050 Accelerometer/Gyroscope
  • A very loud buzzer (I have a solid-state buzzer from Okaphone Elektronika Groningen)
  • 550 mAh 3.7v lithium polymer accu
  • Lithium polymer micro USB charger (only if you want it recharchable)
  • An ampty PCB
  • A bunch of small pinless cables
  • A foam ball bought from Pipoos (any foam ball will do)
  • Iron wire
  • A rocker switch

Step 1: Making Sure Everything Works

screaming_ball_bb.png

Step one: Make sure you have all the parts and test them out using a breadboard like this:

For this ball I used the following code:

<p>#include "I2Cdev.h"<br>#include "MPU6050.h"</p><p>#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
#endif</p><p>MPU6050 accelgyro;</p><p>int16_t ax, ay, az;
int16_t gx, gy, gz;</p><p>int timer = 5;
int buzzer = 13;
int16_t tax, tay, taz;
int change = 0;</p><p>#define OUTPUT_READABLE_ACCELGYRO</p><p>#define LED_PIN 15
bool blinkState = false;</p><p>void setup() {
    #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
        Wire.begin();
    #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
        Fastwire::setup(400, true);
    #endif</p><p>    Serial.begin(38400);</p><p>    pinMode(buzzer, OUTPUT);
    
    // initialize device
    Serial.println("Initializing I2C devices...");
    accelgyro.initialize();</p><p>    Serial.println("Testing device connections...");
    Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");</p><p>    pinMode(LED_PIN, OUTPUT);
}</p><p>void loop() {
    accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);</p><p>   
    #ifdef OUTPUT_READABLE_ACCELGYRO
        ax = map(ax,-32767, 32767, 0, 360);
        ay = map(ay,-32767, 32767, 0, 360);
        az = map(az,-32767, 32767, 0, 360);
        
        timer--;
        if(timer < 0){
          change = (tax - ax);
          Serial.print("Change: ");
          Serial.println(change);
          </p><p>          
          tax = ax;
          tay = ay;
          taz = az;
          timer = 3;
        }</p><p>        if(change < -10 || change > 10){
          digitalWrite(buzzer, HIGH);
        } else {
          digitalWrite(buzzer, 0);   
        }
    #endif</p><p>    #ifdef OUTPUT_BINARY_ACCELGYRO
        Serial.write((uint8_t)(ax >> 8)); Serial.write((uint8_t)(ax & 0xFF));
        Serial.write((uint8_t)(ay >> 8)); Serial.write((uint8_t)(ay & 0xFF));
        Serial.write((uint8_t)(az >> 8)); Serial.write((uint8_t)(az & 0xFF));
        Serial.write((uint8_t)(gx >> 8)); Serial.write((uint8_t)(gx & 0xFF));
        Serial.write((uint8_t)(gy >> 8)); Serial.write((uint8_t)(gy & 0xFF));
        Serial.write((uint8_t)(gz >> 8)); Serial.write((uint8_t)(gz & 0xFF));
    #endif</p><p>    blinkState = !blinkState;
    digitalWrite(LED_PIN, blinkState);
}</p>

Step 2: First Step of Assembly

20200112_154407.jpg

Solder a bunch of pins on top of the piece of PCB so it alligns with your Arduino Uno

Step 3: Soldering All the Components to the PCB

20200112_154355 - Copy.jpg
20200112_221902.jpg
20200112_221909.jpg

Solder all the components in parallel beginning with the 3.7v battery and make sure to disconnect it while soldering. (My battery came with this handy connector that I could just click off)

Step 4: Hot Glueing Metal Wire to Your PCB

20200112_221924.jpg

Yes this sounds weird, but doing this will ensure that the components in the ball don't just move around while it is rolling. Make the wire at least as long as the diameter of the ball, and maybe even longer so you have the option to cut some off later.

Step 5: Reflection and Making the Holes in the Ball

20200112_221917.jpg

Okay, now you should have some sort of "stretcher" type thing with an empty pcb in the middle with pins and an arduino attached to it. Now measure out where you want the ball to be inside of your ball and draw some spots at the points where the iron wire will go through, make sure that both halves of the ball can still be put on top of eachother while the dots you've drawn are alligned.

Once you've made the holes (I made them by rotating the metal and pushing it through the foam) carefully put the contraption inside of it and put the 2 halves of the ball around the metal wire. When you're done you should have a ball with 4 metal wires sticking out of it.

Step 6: Make a Bigger Hole in the Middle of One Side of the Ball for the on and Off Switch

20200112_154415.jpg

Also be sure to solder some cables to the button in the inside so you can connect the + cable (the red one) from the battery through the button to make it toggleable (highly recommended, otherwise you will end up with a forever screaming ball. At least until the battery runs dry)

Step 7 (Optional): Ballance the Weight of the Ball So the Center of Mass Is in the Middle

You could do this by taking the components and placing them in the ball on the inside of the foam ball.

Step 8: (Optional) Glue the Ball Shut

If you want the ball to be sturdy, I highly recommend glueing the ball shut or bending the iron wire along the outside of the ball so both halves don't come apart. I haven't done this in the tutorial because I want to show off the inside to others.

Step 7/8/9: Profit!

20200112_231652.jpg

Well, that should be the overengineered ball that screams when it moves.