I have always wanted to use an accelerometer in a project, so when my daughter Beatrice was born I knew exactly what to build; The Hypno-Jellyfish! The Hypno-Jellyfish is a jellyfish-shaped toy filled with RGB LEDs that changes color when you move it. So if you have just become a father, (or want to give someone else a very personal/strange gift), this is the project for you.
When designing a toy for a baby you need to understand the intended users modus opperandi.
1. If it fits in the mouth, it will go in the mouth.
- Has to be free of toxins
- No small parts that can be swallowed
- All parts that can be touched by the user has to be waterproof
2. If it can be pulled it will be pulled with as much force that can be achieved by a 0 year old.
- Needs to be built to handle some serious pulling.
3. If it can be dropped on the floor it will be thrown on the floor repeatedly and you have to pick it up over and over again.
- Make it undroppable or very sturdy.
4. Blinking lights are beautiful and will be stared at intently.
To remove as much sensitive parts out of Beatrices reach as possible, I decided to go with a two part design. The first part contains the Arduino and the battery, this part will sit on top of the babygym and out of baby reach. The other part is the jellyfish, constructed from polymorph plastic, that contains the Neopixel ring and the accelerometer.
To achieve a sturdy connection between the two parts that would hold for design requirement 2, I made use of some paracord where I replaced the center strands wires from an ethernet cable. I could only fit two wires in each paracord mantle, so to get the 6 connections I needed, I had to use three pieces of paracord with two wires in each mantle. I then braided the paracords to make one wire. This way all mechanical stress will be picked up by the paracord and the wires will hopefully stay soldered in place.
Step 2 – Electronics
The accelerometer (MPU6050) is connected to the Arduino Nano with five wires.
- MPU6050 – Arduino
- VCC – 3.3V
- GND – GND
- SCL – A5
- SDA – A4
- INT – D2
The NeoPixel ring only needs VDD (PWR), GND and a DATA in. I chose to power the Neopixel ring from the 3.3V output on the Arduino. In a worst case scenario the Neopixel ring could draw to much power from the Arduino, but to save on the number of parts, and also number of wires, I decided to try it and it worked. Ideally I should have used a power regulator circuit to provide power to the Neopixel straight from the battery to avoid overloading the Arduino.
- Neopixel Ring – Arduino
- PWR – 3.3V
- GND – GND
- IN – 100 ohm resistor – D5
Step 3 – Making the jellyfish
The jellyfish is made from Polymorph plastic which I bought of BLRTronics on ebay. Polymorph plastic is a really cool material. In room temperature it is hard and durable, but if you heat it to above 60 C it becomes translucent and soft, and can easily be molded by hand. It is non-toxic and is often used in medical implants. However it is not super easy to work with, and when it is soft it tends to stick to itself.
My first approach was to mold body and tentacles from one pice of plastic. As I was almost finished I decided to heat up only the tentacles to give them a final twist. This was a bad decision and all the tentacles got tangled and stuck to each other so I was back to square one again.
To avoid making the same misstake again, I decided to mold the tentacles and the bottom part of the body, (that houses the neopixel ring), as separate parts. I then heated the bottom part of the body and made little knobs with a pair of tweezers where I planned to attach the tentacles. Finally I attached the tentacles to the body by heating only the knobs on the body in some hot water and only the top of the tentacles to avoid a sticky tangly tentacle mess again.
This method turned out to be much more successful. After successfully attaching all tentacles, I attached the Neopixel ring and accelerometer to the bottom part of the body with a small pice of polymorph plastic across the ring and accelerometer. The top part of the body was molded around the paracord to avoid any joints to the body. To make sure all mechanical stress is picked up by the paracord, and not the wires, I made a big knot inside the jellyfish that is to big to pass through the hole. Finally I joined the top and bottom part of the jellyfish with another piece of polymorph plastic that I had heated thoroughly so that it was rely sticky and acted as a glue.
Step 4 – Code
The code is based on the i2cdevlib by Jeff Rowberg and Adafruits neopixel library. The basic concept is to read the position of the accelerometer every 300 ms and compare the result. If there is a big enough change between the current and last value it is considered as a ”movement detected” and the color changes. The code can be found at my github in the Hypno-Jellyfish repo.
If you don’t have any kids or know anyone who has and still want to build one, you can always claim you are going to use it for light painting.