Category: DIY

The color mix master

A while back a friend asked me if I could build a custom toy for a little guy called Oscar. She said something in the lines of ”The little guy is crazy about knobs, button, switches and blinking lights. You know, the same stuff that you like.” Of course I could not pass up an opportunity to lead a new requite towards the world of electronics so I accepted. Now it’s finished and the Color mix master is born.

Operation

The basic function is that the six RGB diodes on the top is controlled by the knobs, switches and buttons below. The color mix master has 5 modes which can be cycled between by pushing the buttons at the bottom.

Mode 1

In mode one the three switches works as a way to input a binary number. The LED that correspond to the number set by the switches is lit up correspondingly. The three knobs that are colored red, green and blue can be used to set the hue of the LED.

Mode 2

In mode two the three switches works as a way to input a binary number just as in mode one. But what is different in mode two is that the all LEDs up to the number that correspond to the number set by the switches are lit up. The three knobs can be used to set the hue of the LED.

Mode 3

In mode three the switches works just like in mode two but LED color is a fading rainbow and the knobs have no function.

Mode 4

In mode four the switches works just like in mode two. The LED color is a some random sparkles in different colors and the knobs have no function.

Mode 5

In mode five the switches works just like in mode two. The LED color is a dot moving back and fourth between left and right with a fading rainbow trail and the knobs have no function.

Hardware

The case of the color mix master is an old router that I have spray painted red. It had plenty of room inside after ripping out the old circuitry.


The LEDs are through hole APA106 LEDs and they function in all essence like the WS2812B that is sold by Adafruit under the name Neopixels. They have the nice ability that you can address each diode individually using only one output from the microcontroller. Each diode has a data in, data out, GND and 5V. The diodes are connected one after another where the output from one diode is the input for the next. To make the spacing between the LEDs match the holes I had drilled in the case I made a little jig with the same spacing between the holes as in the final case to use while soldering.

The microcontroller is an Pro Mini, it has the same Processor as the Arduino, ATmega328P, but it doesn’t have USB or a voltage regulator, this makes it bit cheaper but you have to take care of the usb communications and power control your self. To provide 5V power I used a standard LM7805 voltage regulator and a 9V battery. The LEDs shouldn’t be powered from the microcontroller directly because they consume quite a lot of power and you would risk damaging your microcontroller. Instead you can run power to the LEDs directly from the LM7805 as long as you remember to connect the ground to the same rail as the microcontroller is using. If you would like to build a similar device based on my code any microcontoller that can be programmed with the Arduino IDE can be used just as long as it has at least 6 Digital IO pins and 3 analog input pins.

Software

The software is a real hack. It was done in haste to be ready for christmas and can be improved greatly. I had problems to get the debouncing library to work so every time I pressed the button it registered as two presses. There are also unused methods etc. but hey it works! The LEDs are controlled by the excellent fastled.io library. The code is available at my github: https://github.com/clarholm/Color-Mix-master

Annonser

Hypno-Jellyfish

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.

 

Design requirements

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.

Parts

Step 1

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.

Vacation project, a time laps panning rig from an egg timer and a bottle.

A positive thing with being on vacation is that you have more spare time than usual. A negative thing with being on vacation is that you are far away from your lab and tools. Luckily, creativity is not confined to any particular place and there is always something that you can use to build something. During one of my spare time moments, my eyes fell on an egg timer, and I remembered seeing someone using an egg timer to make a time lapse panning rig. This seemed like the perfect vacation project! Two plastic bottles, a board, a screw, a few minutes work and the time lapse rig was finished. tlr_final_sunset

How to build it

Materials

  • An Oval egg timer
  • A plastic bottle
  • A knife and a pair of scissors
  • A piece of string
  • A marker pen
  • An iPhone with the app iMotion or any other time lapse app.

Optional, for a make shift camera support.

  • Another bottle
  • A board
  • A screw

tlr_materials

Step 1, fitting the bottle on the egg timer.

Use the string to find the circumference of the egg timer by wrapping it around the the egg timer and cutting it so the ends of the string meets. Now wrap the string around the neck of the bottle and mark the spot to cut, then cut the bottle’s neck at the mark. You might have to use the scissors to trim the size a bit to make it fit snuggly on top of the egg timer.

Step 2, cutout to fit the phone.

Cut the bottom of the bottle. Place your phone on its long side in the center of the bottle, then mark the thickness of the phone. Next, use your phone to mark its breadth to know how far to cut. Once you have made the marks, use the scissors to cut the bottle to the right shape.

Step 3, Setting up the shot

Launch the iMotion app and set the timer to take at least one picture every 2nd second. If you use less frequent shots the footage will be a bit choppy and not the fluid motion we want. On the 360 degrees shot at 1:09 in the video I set iMotion up to take one picture every third second and that turned out a little choppy. Wind up the egg timer and place the phone in the bottle, start the iMotion and wait.

Step 4, Optional, the camera support board.

I quickly realized that you often want to tilt the camera a bit, or that the wind knocked the camera over. To remedy this, I built a camera support. The camera support is just a piece of board with the bottom of a bottle screwed on to it. The bottle was cut to fit the bottom of the egg timer. This makes it more easy to place the rig on an uneven surface or to tilt it to take a shot at an angle.

A dirt cheap DIY digital microscope

When I first saw this instructable by Yoshinok on how to make a microscope using a lens from an old laser pointer, I knew that I had to build one. The first attempt turned out pretty well, but I did learn some things from the build.

If I was to build another one, I would make sure that I positioned the lens between the two threaded rods that holds the sample tray, rather than towards the edge of the plexiglass. The only structural support the sample tray has are the two wing-nuts that is used to adjust the focus with. This makes it sensitive to weight distribution and if the sample it self is heavy, then the sample tray will tilt outwards due to the skewed weight distribution. It´s  hard to find focus when the tray is tilted. This weight distribution problem could perhaps be improved with some washers on top of the wing nuts and in the original instructable Yoshinok uses washes on top of the wing nuts. I would also have made the plexiglas the phone is placed on slightly bigger to allow for different positions of the phone.

The second thing I found was that the nuts I used to hold the plexiglas the phone is placed on, are too thick. The laser lens has a very short focal length, so the sample has to be very close to the lens to get a clear focus. If the sample is small and flat, it will still be out of focus even if the sample support tray is raised as high as it goes before it is stopped by the nuts. I solved this by using a plastic lid that I had laying around, which fit between the supports to raise the sample of the sample tray so that it could be put into focus. I used M8 size rod and nuts but I would say that M6 would be enough and those nuts are much thinner.

It is a very fun and useful little thing and it is very simple both to build and to use.

The First fly

Salt

Coin and rollerball pentip

LCD Screens

Screen comparison between Sony Xperia ZR and iPhone 5. Max magnification of a white area.

Wild Strawberry

The second fly

Leaf

Bellflower

Oxeye

Feather

Sand

Charcoal