Neopixel Colour Selectable Desk Lamp

by chrisweedonart in Circuits > LEDs

1300 Views, 14 Favorites, 0 Comments

Neopixel Colour Selectable Desk Lamp

Capture1.JPG

The aim of this project was to create a contemporary design desk lamp using Neopixel strips which could be controlled using a potentiometer to adjust the brightness and the colours from bright white to a warm white and also a number of selectable colours.

Most Arduino Neopixel programmes seem to change colours/effects automatically through the programme or for the lamp to be controlled via wifi, I didn't want this.

I wanted to be able to control brightness and the colour manually with a potentiometer.

Supplies

Attiny167

Three Neopixel 8 bit strip

2 Potentiometers with knobs

Wire

3D printer PLA

3 M4 nuts and bolts varying lengths

4 self adhesive silicone pads

Design and 3D Modelling

Capture3.JPG
Capture5.JPG
Capture4.JPG
Capture6.JPG
Capture2.JPG

I started by researching contemporary design lamps online, I didn't simply want to copy another design but create my own.

The 3D design was undertaken using OnShape

I wanted a contemporary design with a slim main arm set at an angle mounted on a wedge shaped base to contain the electronics. The lamp head needed to articulate to change the angle of the light.

All the items needed to be 3D printed on my Ender 3 so I was restricted on size particularly of the main arm which would be the longest part, I designed this to fit diagonally across the print bed.

I like to design items that are relatively easy to print and where possible without needing very much support, so I am thinking about this during the design process and where necessary breaking down into smaller parts that can be superglued together if necessary.

The top of the base is set at 20 degrees from the horizontal and the main arm is 20 degrees from vertical. The end of the arm is curved to lead into the head which will be set horizontally, but can be tilted as it is hinged. There is a simple articulated joint between the arm and head through which an M4 bolt is fixed. The main arm is set into a slot in the base and bolted through with 2 M4 bolts.

The cable to control the Neopixels goes through a hole in the centre of the arm, across the articulated joint and into the lamp head.

Electronics

Capture7.JPG

I used an Attiny167 development board which provides 5v output to power the neopixels without the need for any separate power supply.

The lamp is made up of three 8 bit Neopixel strips connected together.

Two potentiometers

Arduino Coding

I searched the internet for a project that did something similar to what I wanted to achieve, I couldn't find exactly what I required. After some research I combined and adapted aspects of various code that I found.

The final code is actually very simple and makes use of an array of Hex colours which are selected by rotating one of the potentiometers. The colours in the array can easily be changed and code re-uploaded.

The Brightness is also controlled by potentiometer mapping it to setBrightness function although this isn't recommended to be in a loop it does seem to work.

I had previously used similar code to control the brightness which displayed each pixel separately I really wanted to change them all at once. There is a feature in Neopixel.h for doing this but it is not recommended however it seems to work ok.

I used to following array of colours in the code:

// 6 rainbow colours and white to pale yellow (warm white)very subtle 17 colours

long colour[] = {0xfd0707, 0xff8a12, 0xdddb03,0x129114, 0x0d0ddf,

0x8402ad, 0xffffff, 0xfffff0,0xffffe0, 0xffffd1,

0xffffc2, 0xffffb2, 0xffffa3,0xffff94, 0xffff85,

0xffff75, 0xffff66};

Downloads

3D Printing

As mentioned earlier I have designed the lamp to be printed easily and without the use of any support structure as much as possible.

All items were printed using PLA.

There are the following 10 separate parts to print:

Base

Arm

Lamp Head

Diffuser, this is printed using a clear PLA

2 Coin holders

4 Feet

I use Ultimaker Cura slicer with the following settings:

All items were printed with PLA using 200 Deg C nozzle and 60 Deg C Bed temperature. Layer height 0.2mm and nozzle 0.4 mm. Infill percentage of 50%. I used the Zig Zag support pattern as this seems to be the easiest to remove after printing.

The arm is designed to be printed on its edge diagonally across the print bed, this is printed with support to ensure that the hole through the centre for the cable is created and holes for the bolt to fix the articulated head. Once printed the support structure was easily removed using a pair of pointed pliers to grab and pull it out.

The Base should be printed upside down so the the to surface sits on the bed, again this should be printed with support for the arm slot, USB port and cable hole.

The Lamp Head should be printed with the opening for the Neopixel strips facing upwards and with support to ensure the bolt holes are created.

The coin holders are printed with the opening uppermost without support.

The 4 feet are printed with the sides square to the bed.

Construction

IMG_20210914_110137.jpg

Once all the printed parts have been made and any support structures removed the lamp can be constructed.

Before bolting the the main arm to the base thread the wire through the hold in the centre so that there is sufficient length either end to connect the Attiny and Neopixels.

Bolt the arm to the base with 2 bolts

Bolt the arm to the lamp head through the joint feeding the wire over the top of the bolt.

Connect the Attiny as per the wiring diagram and solder the various connections.

Bolt the potentiometers to the base and add the knobs.

Using a glue gun apply some glue to the back of the Attiny and press into place on the base.

Fill the coin holders with 1 pence pieces , apply super glue to the edge and plcae in the location on the base, hold until set.

Apply superglue to each of the feet and put in each corner. Apply a silicone self adhesive dot to each to prevent the lamp slipping on the surface.

Connect all three neopixel strips apply glue from glue gun and press into place in the lamp head.

Push into place the diffuser.

Plug in the USB charger and play and adjust the potentiometers to change brightness and colour.

Final Project

IMG_20210914_110353.jpg
IMG_20210914_110409.jpg
IMG_20210914_110430.jpg
3D Printed Desk Lamp

Once assembled simply plug in a micro usb power supply and use the potentiometers to vary the colours and brightness.

One improvement I would make is rather than plugging power directly into the Attiny I would add a separate micro usb socket with a switch between so it can easily be switched off.