NEW: RoboRover Core is live! Educational robot base with USB-C rechargeable battery, sensors, OLED + Wi-Fi — ready for projects. 🤖

Orders via Akis Express or Box Now (before 12 PM) Mon–Fri ship same day. Cyprus Post orders ship next working day. 🚀

MagicMotion - DIY Mood Lamp using Kypruino/Arduino

The finished MagicMotion DIY Mood Lamp, featuring a 3D-printed outer shell, internal NeoPixel lighting, and motion-based control using an MPU6050 sensor.

Team Robo |

In this project, we created an interactive DIY mood lamp using a Kypruino, an MPU6050 motion sensor, and NeoPixels. Instead of relying on buttons or an app, the lamp responds directly to movement. By tilting or shaking it, the user can control brightness, change colours, and trigger different lighting effects.

The goal of this project was to turn a simple lamp into something more playful and expressive. It combines motion sensing, embedded programming, electronics, and 3D printing into one build, resulting in a lamp that feels much more interactive than a standard light.

In this guide, we will go through the main idea behind the project, the components used, the wiring, the 3D-printed enclosure, and the code that makes the whole lamp work.


Why did we make this project?

A mood lamp felt like the perfect project for combining sensor technology with something creative and personal. It gave us the chance to work with real accelerometer data, gesture detection, colour transitions, and animation design, while still building something practical and visually appealing.

It also serves as a great example of how an idea can move from concept to finished product through design, prototyping, electronics, and programming.


What the lamp does

The MagicMotion Mood Lamp reacts to movement in several different ways:

  • Tilt control: tilting the lamp changes its brightness
  • Shake detection: shaking the lamp cycles to the next colour
  • Smooth transitions: colour changes fade gradually instead of switching abruptly
  • Idle animations: each colour has its own soft animation while the lamp is sitting still
  • Flip-to-off: turning the lamp upside down switches it off

This makes the lamp feel less like a basic lighting device and more like an interactive object that responds naturally to the user.


Components used

For this build, we used:

  • 1 × Kypruino board
  • 1 × MPU6050 accelerometer and gyroscope module
  • 1 × NeoPixel ring or internal NeoPixel lighting module
  • Jumper wires
  • USB cable for power and programming
  • 1 × 3D-printed cylindrical lamp enclosure
  • Arduino IDE for programming

The Kypruino

The Kypruino is the main controller of the project. It reads the motion data from the MPU6050 and uses that information to control the NeoPixels inside the lamp.

Because it is compact, easy to program, and well suited for beginner-friendly interactive projects, it works well as the brain of the lamp.


The MPU6050 motion sensor

The MPU6050 is a small motion-tracking module that combines a 3-axis accelerometer and a 3-axis gyroscope on one board. It communicates with the Kypruino using the I2C protocol, which keeps the wiring simple.

In this project, the sensor is used in several ways:

  • Dynamic acceleration is used to detect shake gestures and trigger colour changes
  • Orientation data is used to detect when the lamp is turned upside down and should switch off
  • Accelerometer readings are used to calculate the tilt angle relative to gravity, allowing tilt-based brightness control

To make this possible, the lamp first records a reference gravity vector during startup, which becomes the baseline for future movement detection.


Designing and 3D printing the lamp

One of the most important parts of this project was the enclosure. The lamp was designed as a cylindrical 3D-printed case that could hold the electronics inside while also diffusing the light from the NeoPixels.

The outer shell gives the lamp its final visual style and helps disperse light better due to its fuzzy skin, while the internal space provides room for the Kypruino, the MPU6050, and the wiring. The design also includes an opening for the USB cable so the lamp can be powered and programmed easily.

The printed structure helps turn the project from a simple desk prototype into a more polished finished object. It also shows how 3D printing can be used not only for mechanical parts, but also for presentation, enclosure design, and improving the user experience of electronics projects.

 

Assembling the 3D-printed cylindrical enclosure by sliding its 3D-printed parts into each other.

3D-printed cylindrical enclosure designed to hold the electronics inside while diffusing the NeoPixel lighting across the outer surface.

Wiring and electronics

The lamp is powered through USB, with the cable entering the enclosure through a small opening and connecting to the Kypruino inside.

MPU6050 motion sensor

MPU6050 Pin Connects to Kypruino
SDA A4
SCL A5
VCC 5V
GND GND

NeoPixel lighting

NeoPixel Pin Connects to Kypruino
DIN D8
VCC 5V
GND GND

Once the wiring is complete, the electronics can be placed inside the 3D-printed body and secured so the sensor readings remain stable during use.

Internal wiring layout of the lamp, showing the Kypruino and MPU6050 sensor connections.

Programming the effects

The lamp’s behaviour is controlled entirely through code. The program reads motion data from the MPU6050 and translates that data into lighting changes and animations.

Startup calibration

When the lamp is first powered on, it stays still for a brief moment while it records several accelerometer readings. This gives the program a reference for what the normal upright position looks like under gravity.

Tilt detection for brightness control

As the lamp is tilted, the program compares the live angle to the original starting position. This allows the brightness to change gradually as the angle changes. Once the lamp is returned upright, the brightness remains at the value reached during tilting.

Shake detection for colour changes

When the lamp is shaken, the sensor detects a sharp burst of motion that is different from simple tilting. This gesture is used to move to the next colour in the sequence.

Smooth colour transitions

Rather than switching instantly, the lamp fades from one colour to the next. This makes the effect softer and more visually pleasing.

Idle animations

When the lamp is sitting still, it does not remain completely static. Each selected colour has its own gentle animation, such as breathing, pulsing, or subtle shifting patterns, which helps the lamp feel more alive.

Flip-to-off

If the lamp is turned upside down, the code recognises the orientation change and switches the lamp off. This creates an intuitive way to stop the effect without needing a separate control button.


Final result and experience

The final result is a fully working handheld mood lamp that responds naturally to movement. It does not need buttons, menus, or an app. Instead, the interaction is based entirely on physical gestures.

The combination of colour transitions, gesture control, and idle animations makes the lamp feel dynamic even when it is simply resting on a table. Beyond the finished object itself, the project was also a great introduction to working with real motion data and turning sensor readings into something interactive and visual.


Possible future enhancements

  • Sound-reactive mode: add a microphone so the lamp can respond to music or ambient sound
  • More internal lighting: increase the number of LEDs inside the enclosure for stronger lighting effects
  • Battery-powered version: replace USB power with a rechargeable battery and charging circuit for portability
  • More gesture types: detect additional movements such as double-shakes, circular motions, or specific tilt patterns

Conclusion

This project combines 3D printing, electronics, and programming to turn a simple lamp into something interactive and engaging. It shows how motion sensing can be used in a creative way to control light, and how a small set of components can produce a result that feels polished and expressive.

More importantly, it demonstrates how coding and sensor data can be turned into a real physical experience. The MagicMotion Mood Lamp is not just a light source — it is a playful example of how digital fabrication and embedded systems can work together to create something memorable.

Leave a comment

Please note: comments must be approved before they are published.