ORIGINAL SOLARFIDGET LIPO EDITION
by fuzzybritches0 in Circuits > Arduino
417 Views, 4 Favorites, 0 Comments
ORIGINAL SOLARFIDGET LIPO EDITION
Using an LED strip (of 32 WS2812B individually addressable LEDs) and an MPU6050 gyro/accel, this fidget calculates the position of a rotating pendulum that reacts to acceleration and gravity and simulates the effect of gravity on different bodies in our solar system (including Pluto).
This version comes with a 750 mAh LiPo battery and a USB charger station.
For more information, please visit: https://github.com/fuzzybritches0/solarfidget
Supplies
All necessary files for printing and programming the Arduino, can be found at:
https://github.com/fuzzybritches0/solarfidget/
- 1x Arduino Nano or compatible
- 1x MPU6050 breakout board
- 1x TP4056 battery charging breakout board
- 1x strip of 32 WS2812B individually addressable LEDs (*)
- 1x 44x24.5x9mm 750mAh LiPo battery with Molex plug
- 1x male Molex plug (**)
- 1x 3d-printed models of both the fidget and charger parts (***)
- 1x USB mini cable
- 4x 0.3x4x5 mm compressing spring
- 4x M3 locknut
- 4x M3 nut
- 4x M3x10mm bolt
- 4x M3x4mm bolt
- 8x cylinder magnet d=5mm,h=2mm,
- and a punch of cables one can salvage from old LAN cables or similar.(*): Use a strip with an LED density of 144 LEDs per metre.
(**): When buying a set of batteries there is normally a charger included from which you can salvage male Molex plugs.
(***): all four parts can be found as .3mf files in the design-solarfidget/3mf folder and can be imported directly into the 3d slicer software. If you need to make changes to accommodate your own hardware, use the solarfidget.scad file to do so.
Printing
I printed the parts with a PRUSA i3 MKR3s printer, used the PrusaSlicer 2.4.0 software, selected 0.20mm QUALITY print settings with 30% infill and used a transparent PLA material. I printed the four parts all in one go. It took about 6 hours.
I recommend transparent PLA material. White PLA works, too. The light, however, will not be as bright. Any other colour will only let through that colour and make it impossible to distinguish between planets.
Using another material than PLA will likely result in slightly different dimensions and the electronics being loose or too tight to fit. The fit for the MPU6050 is particularity crucial and should be very tight to hold it in place perfectly.
2.3.1 Customizing the parts
If you need to make changes to the parts, use the solarfidget.scad file to do so. At the beginning of the file, change the dimensions of the electronic parts, then further down, in the file, adjust the placements for those parts so that they don't overlap. The electronic parts positions can be altered in the module named top. batteryC is the battery charging breakout board. If you intend to change the amount of LEDs, remember, you can only change the amount by a multiple of 4.
Magnets
Place four magnets inside the charger and four inside the fidget so that they both lock in place. The magnets go around the charging towers into the four round holes. Have the magnet's poles in the fidget all oriented in the same direction. Reverse the poles in the charger. There is no room for error, since you will have to destroy the parts to remove the magnets. If you have to do that, turn the parts around and hit the parts with something pointy and hard (a screw driver will do) at the points where the magnets are. They will fall out and collect together with each other.
Pic. 1: Use a crooked M6 key, place the magnet on the crooked end and use a hammer to fix the magnets in place.
USB Mini Cable
Cut the USB mini cable about 10cm from the mini USB plug side. Carefully remove the PVC coat and the shielding. There should be four cables: one black, one red, one white and one green. Also remove as much of the hard plastic from the mini USB plug as possible - we only have limited space - but don't break the plug. We won't be using the red or the black cable. If you messed them up, we are still good to go.
Fidget
Now, we will work on the part of the fidget that houses all the electronics, that is, the top part.
Place the top part of the fidget in front of you, facing the inside and having the charging towers face up. Connect the two cables of the mini USB plug as follows from left to right (leave the first and fourth empty): white, green
Add a red cable for +5V to the first tower and a black cable to the last tower for GND. Don't use the cables form the USB plug.
Use the M3 nuts and M3x4mm bolts to secure the cables. Clean the inside of the towers if there is loose or deformed material inside from printing the overhang. Push the nuts inside the towers. This should be quite easy. If not, use a longer M3 bolt to drive them into place.
Make sure there is only blank wire between the nut and the tower. Keep the blank wire away form the bold. We don't want the wire to curl around the bolt.
Before we can install the battery charging breakout board, we need to get rid of the USB plug:
Pic. 1: Charging breakout boardwith the USB plug.
Pic. 2: Charging breakout boardwith the USB plug removed.
Connect the Arduino Nano to the mini USB plug. Push the Arduino inside its proper place. This shouldn't be too difficult. Push the battery charging breakout board into its proper place. Finally push the MPU6050 breakout board into its proper place. You might have difficulties there. But try! Eventually, it will go in. It is a very tight fit. Have the MPU6050face up. On the MPU6050 have the X-axis point to the right and left.
Pic. 3: Magnets and hardware installed.Arduinoplugged in.
LED Strip
Solder three spots onto the 32 addressable LED strip. Note the direction of the arrows on the strip and solder the spots on the right end. If the arrow points to the end of the strip, it's the wrong end.
Pic. 1: Solder the spots onto the back.
Soldering
Wire all cables left and right through the openings in the battery compartment, if they come from the MPU6050 or battery charging breakout board. Keep the cables as short as possible. Have them stacked on both sides of the battery, left and right, so that the battery gets a nice fit. They should not stack below the battery. If so, you won't be able to close up the fidget, or even damage the battery or other components, when you try. Have them go next to each other.
Soldering: Battery Charging Breakout Board
All spots marked with the Minus (-), on the battery charging breakout board, are the same. Ground that board to the Arduino. Solder the red cable from the charging tower to +In on the battery charging breakout board. Use the black cable to ground the board.
Solder OUT+ from the battery charging breakout board to VIN on the Arduino.
Soldering: MPU6050
Solder VIN from the MPU6050 to 3V3 on the Arduino and ground the MPU6050 on the battery charging breakout board. Now, solder SCL, SDA and INT from the MPU6050 to A5, A4 and D2 on the Arduino, respectively.
Soldering: MOLEX Plug
Solder two cables to the male MOLEX plug. When you connect a battery to the plug, you can see which cable is which. Make sure the plug and cable are properly isolated. Use shrink tubing. Never solder with a connected battery! Don't bend the cables around the solder spots at the MOLEX plug. This will lead to broken contacts.
Solder the two cables to BAT+ and BAT- on the battery charging breakout board, accordingly. If you do it the wrong way and connect a battery, your board will get fried and smoke will come out.
Soldering: LED Strip
Now, solder a red cable to +5V, a black cable to GND (either on the Arduino or the battery charging breakout board - whichever is easier for you) and a different coloured cable to D6 on the Arduino. Then solder them to Plus (+), DATA and Minus (-) on the LED strip, respectively; that is, the top most solder spot is Plus (+), the middle one is DATA and the lowest one is Minus (-).
Battery
Now, connect the battery to the MOLEX plug and place it inside the fidget.
Charging Station
Don't forget to route the cable through the bottom part of the charging station first, before you continue. Clean the inside of the towers if needed.
Use the 0.3x4x5 mm compressing springs, the M3 locknuts and the M3x10mm bolts to finish up the charger. Have the bolts look out of the charger around one mm, enough so that the fidget gets good contact when pushed down by the magnets. Get it right now. Later on, it will be very difficult to change.
Pic. 1: Here you see the bolts looking out a little.
To figure out which cable goes where place the fidget's charging towers next to the charging station's charging towers.
Now, wind the blank wires of the four cables around the end of the bolts. Have as much blank wire as possible go around and make it really tight.
Pic. 2: The wire is wound up around the bolts tight, so as to give a good contact and reduce the resistance as much as possible.
Now, apply tin-solder on all of the blank wire.
Pic. 3: The wire will act as a sponge when you apply tin-solder. Apply plenty.
Software
Open the file at: https://github.com/fuzzybritches0/solarfidget/blob/main/arduino-solarfidget/arduino-solarfidget.ino in a new sketch in your Arduino IDE.
Place the file at: https://github.com/fuzzybritches0/solarfidget/tree/main/arduino-solarfidget/libraries/solarfidget in a subdirectory in your Arduino/libraries folder
Place the files at: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/I2Cdev in a subdirectory in your Arduino/libraries folder
Place the files at: https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050 in a subdirectory in your Arduino/libraries folder
Place the files at: https://github.com/adafruit/Adafruit_NeoPixel in a subdirectory in your Arduino/libraries folder
Open the Arduino IDE and load the file: arduino-solarfidget/arduino-solarfidget.ino
Place the fidget on top of the charger, the charger on a level surface and connect it to your computer. Open the serial monitor. Compile and upload the programme to the Arduino. Wait for the Arduino to reset and start. Look at the serial monitor and note down the calibration values.
Now, in the file: arduino-solarfidget/arduino-solarfidget.ino find the following line:
#define SERIAL_DEBUG
Comment out this line so that it looks like this:
//#define SERIAL_DEBUG
Find and uncomment the line:
//#define FIDGET 1
Now, find the lines:
#if (FIDGET == 1) // Fill in your calibration values here mpu.setXAccelOffset(0); mpu.setYAccelOffset(0); mpu.setZAccelOffset(0); mpu.setXGyroOffset(0); mpu.setYGyroOffset(0); mpu.setZGyroOffset(0); #endif
and replace the 0 values with the values you just noted down for Gyro and Accel.
Save the file and upload the programme again.
Finally make sure the LED strip is placed correctly in the fidget and the light of the pendulum is at the right spot. Do this by holding the fidget askew and wait for the pendulum to rest. Now, move the strip either left or right to bring the light into the correct position.
After that, slide the other part of the fidget on.
If you want power saving, uncomment the following line.
//#define POWERSAVING
If in power saving mode, before you try enabling the fidget, hold it for a few seconds in your hands. If you have trouble enabling it, just flip it continuously by 180 degrees until it enables.
Power saving mode is only active when the fidget is off and sitting still.
You should all be set now. Have fun travelling our solar system.
Manual Instructions
You can travel the following bodies in our solarsystem in order:
- Mercury (0.38g) (white)
- Venus (0.904g) (light blue)
- Earth (1g) (dark blue)
- Mars (0.3794g) (red brown)
- Jupiter (2.528g) (white grey)
- Saturn (1.065g) (yellow)
- Uranus (0.886g) (violet)
- Neptune (1.14g) (green)
- Pluto (0.063g) (pink)
Pic 1: To travel from planet to planet hold the fidget horizontally, turn it twice by 180 degrees. If there is no change, try doing it faster.
Pic 2: To turn the fidget on or off hold the fidget horizontally, turn it thrice by 180 degrees. If there is no change, try doing it faster.