Magic Lamp with wireless charger, Adafruit Trinket & NeoPixels


The idea for this little project is to have a lamp which can be turned on or off simply by moving it on a desk.

A wireless charging base is built into the desk’s surface, and a circuit with microcontroller and LEDs gets powered wirelessly using the charging coil.

Components & Circuit

The electronic components used in this project are the following:

Screen Shot 2015-06-19 at 21.14.48The Qi Wireless Charger was bought on eBay for a couple of euros. According to the specs, it is capable of outputting 5V/1A, which should be more than sufficient for this simple circuit.

Connecting everything together is simple:

  • the coil’s positive terminal is connected to the Trinket & NeoPixel USB+/PWR pins
  • the coil’s negative terminal is connected to the Trinket & NeoPixel GND pins
  • the Trinket’s #0 pin is connected to the NeoPixel IN pin

Program & Testing

The Trinket is programmed using the Arduino IDE in order to animate the NeoPixel Ring. But before this can be done, the necessary libraries need to be installed.

Adafruit already has excellent tutorials covering this on their learning system:

Once the hardware is supported and the library installed, it is possible to program the Trinket. An example program is provided with the NeoPixel library, called “strandtest”. This sketch cycles through different animations and colors and is perfect to understand how the NeoPixel Ring is being animated.

Below are some animated gifs (you may need to click to see the animation) showing a quick tests with the wireless charger first and then with the Trinket and NeoPixel Ring.

 voltmeter-gif neopixel-gif

Assembly & Demo

To hold the electronics, a simple housing is required. This can be done using a readily available container or can be custom created using cardboard, plastic, or even using 3D printing.

I opted for the latter and created a simple hollow cylinder just big enough to hold all the parts. The wireless charger coil is at the bottom and the NeoPixel Ring at the top. I’m also using a crystal ball on top of the circuit to diffuse the light.

photo 1 photo 4

I hid the wireless charger base in the desk’s surface, under my cutting mat. When the circuit is placed above the charger, it lights up without requiring a wired power source. Magic.

photo 5 photo 4

Because of the crystal ball sitting on top the NeoPixel Ring, some effects are also reflected on the ceiling, gradually changing color.


The video below provides an overview from start to completion, to end with a demo of the magic lamp.

© Frederick Vandenbosch, 2014-2021. Unauthorised use and/or duplication of this material without express and written permission from this blog’s author and owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Frederick Vandenbosch with appropriate and specific direction to the original content.