Lucky Resistor
Menu
  • Home
  • Learn
    • Learn C++
    • Product Photography for Electronics
      • Required Equipment and Software
    • Soldering for Show
  • Projects
  • Libraries
  • Applications
  • Shop
  • About
    • About Me
    • Contact
    • Stay Informed
  •  
Menu

Table Light

This is a very short tutorial, how to create a simple but beautiful table light. It will be less detailed as previous tutorials, but feel free to ask questions in the comment section of this page. The best part is: The used components are really cheap – so why no make two or three lamps?

Video

First a short video which demonstrates the final product and all 50 modes I implemented in the software you can download from GutHub.

Required Parts

  • Cheap candle holder “Skurar” from IKEA. (~$3)
  • Plastic drain pipe with 50mm outer diameter. (~$2)
  • Adafruit NeoPixel ring with 24 RGBW LEDs. (~$10)
  • Adafruit Trinket 5V Microcontroller. (~$7)
  • 1000µF capacitor.
  • 470Ω resistor.
  • Small white push button. I use this one.
  • A small (!) power jack, matching the power supply you use. I use this one.
  • A power supply with 5V and minimum 2A. (A good one ~$10)
  • A piece of stripboard, pin headers, wire, solder.
  • A package of snow white “Sugru“ is nice for good insulation but optional.
  • Hot-melt adhesive simplifies everything. Can be used for insulation as well.
  • Bright white paper, best about 120g/m² + glue to paste it onto the drain pipe.

Total cost: It should be possible to build everything with less than $40 – if you have some spare parts ready in your workshop. You can omit the power supply and use batteries, but the most expensive part is the NeoPixel ring.

Required Tools

  • Drill with a metal drill bit matching the button size and the power jack.
  • Hot-melt adhesive gun.
  • Soldering iron.
  • Various pliers.
  • Computer with USB 2.0 connector, USB cable and Arduino software to program the Trinket microcontroller. Final software is available in this tutorial.
  • Utility knife (best one with segmented blade).
  • Saw to cut the pipe into segments.
  • A slide gauge is handy to measure the size of the button and power jack.

To test all components, this things could be handy as well:

  • Large breadboard.
  • Jumper cables.
  • Multimeter.
  • Stable lab power supply.

Prepare the Candle Holder

The candle holder from IKEA is made from sheet metal, pained in white.

lucky-resistor-1

First measure the diameter of the button cap you use and the diameter of the power plug. Add some tolerance to prevent the button from clinging.

Drill the hole for the button cap and the power plug into the candle holder. Do not dill the holes too low. Make sure the power jack can be glued straight on the bottom of the candle holder while the jack fits straight trough the drilled hole. Same with the push button. After you drilled the holes into the candle holder, it is hard to fix them if they are at the wrong place.

Use a stitching awl to make small hole exactly at the intended center. This prevents the drill from slipping.

Make also sure the negative pole is on the outside of your power plug. If not, drill the hole larger and add some paint to prevent any contact of the plug with the metal.

lucky-resistor-2

Prepare the Drain Pipe

The drain pipe requires an outer diameter of ~50mm to fit into the NeoPixel ring. Cut a piece with a length of 85mm from the pipe, ideally using a mitre-box saw. Alternatively exactly mark the cut in an exact right angle around the pipe and cut it free hand.

Use some sand paper to smooth the edges of the cut and make sure the piece is exactly upright on your table.

lucky-resistor-3

Measure the height of the push button case and the power jack with all contacts from the bottom of the candle holder. Add 10-15mm tolerance. Subtract this value from the pipe length and cut out a strip of paper with this resulting width and about 1⅓ of the pipe circumference as length.

lucky-resistor-4

Glue the paper around the pipe and make sure the bottom edge is as right-angled as possible (better than shown in the image above ;-).

lucky-resistor-5

The paper will overlap as shown above. Put glue up to the outer edge of the paper to make sure there is absolutely no gap. Wait until the glue is dry, then use the utility knife to cut off the paper which juts out over the top edge.

lucky-resistor-6

Now use a fibre–tip pen to mark exactly three foots/legs at an 120º angle each. Use the utility knife to cut out three areas about 1-2mm and leave only three foots/legs. This spacing is required for the cables from the NeoPixel ring and the power jack and push button. Using exactly three small foots/legs will make the pipe stand steady on the bottom of the candle lamp – even the edge of the pipe is not cut very precise.

Use the utility knife again, and cut at one side enough space for the push button and power jack casings and connections into the pipe. You can extend this later, so start as small as possible and check how much material you have to cut off.

Prepare the Stripboard

The easiest way to bring the stripboard into the right size is by breaking it along the holes. You need a piece which fits perfectly into the pipe and has enough space to hold the Trinket and the capacitor. Best is you arrange everything and check which length you need.

lucky-resistor-7

Use a ruler to cut small grooves into the stripboard on both sides.

lucky-resistor-8

lucky-resistor-9

Use a pliers to break the stripboard exactly at the groves. Make sure the tip of the pliers is exactly in front of the groove to make sure it breaks at the right place.

lucky-resistor-10

If you succeed :-), you got a piece of stripboard in the right size.

lucky-resistor-11

Check if it fits into the pipe. Best is if it sticks at its place, if not – do not worry – hot glue will fix everything.

lucky-resistor-12

lucky-resistor-13

Prepare and Test the Circuit

Thanks to Adafruit, the circuit is very simple. See the following schema how to connect the components.Table Lamp Schema Small

Solder pin headers to your Trinket and add a short cable to the NeoPixel ring so you will be able to test the whole circuit on a breadboard. Setup all components on the breadboard and make the connections using jumper cables.

lucky-resistor-14

Program the Microcontroller

  1. First setup the Arduino IDE as described in this detailed tutorial.
  2. Use the library manager of the Arduino IDE to install the “Adafruit NeoPixel” library (minimum version 1.0.5).
  3. Now download the software from the following GitHub repository:
    https://github.com/LuckyResistor/TableLight
  4. Open the project and set the board to “Adafruit Trinket 8MHz”.
  5. Set the programmer to “USBtinyISP”.
  6. Connect the USB cable from your computer to the Trinket. The red LED should pulse slowly for a few seconds. You have to click on the upload button while the LED pules this way. Press the small reset button if you missed the moment.

Test the Circuit

After uploading the sketch into the Trinket the LEDs of the NeoPixel ring should light up white after start. Use the button using short presses to circle trough all 50 different colour modes. Press the button longer than three seconds to change the LED brightness. If everything works fine, you can remove the USB cable and start building the rest of the table lamp.

Add the Button and Power Jack

This is the most difficult part of the project. Prepare a flat cable with three wires approximate 12cm long. Strip the insulation from the ends and prepare another short wire 1-2cm long. Check which pins of the power jack and push button you have to connect. The short wire will connect the ground pin from the power jack with one pin of the push button. You should see the following setup:

lucky-resistor-15

The the case of this push button, I had to connect the two pins on the same side.

lucky-resistor-16

First solder all wires to the power jack. Use a power plug and a multimeter to check each connection. Remove any unused pins from the power jack.

lucky-resistor-17

Now solder the other wires to the push button. Use a multimeter to check if a press of the push button will make a connection and also check all other wires.

Next use a short bit of insulation tape for the bottom of the lamp and insert the push button cap into the hole. Use tweezers to hold the button in place, so the front of the button case is as close as possible to the wall of the lamp. Try to press the button to make sure everything will work in this configuration.

lucky-resistor-18

Use hot glue to fix the button in place. Do not test the button now! This small amounts of hot glue will not be able to hold the button in place.

Next use a power plug and insert it into the power jack trough the second hole. Make sure the power plug is flat on the surface from the outside and inserted in a right-angle.

Now use more hot glue to fix the power jack into place. Keep the power plug inserted to make sure there is no glue leaking in the power jack opening.

lucky-resistor-19

Next you can either use large amounts of hit glue to finally fix the push button and power jack into place and insulate the contacts, or you can use Sugru for this task.

lucky-resistor-20

Put the Sugru over the button and power jack and make sure all contact points are covered as well, make sure there are no air gaps under this cover. Check if the pipe still fits onto the bottom of the lamp.

Keep the power plug inserted and do not test the push button now!

Wait at least 24h for the Sugru to dry. If you are sure the Sugru is rock solid, test the push button again and remove the power plug. Test if the power plug can be inserted without too much force, otherwise use a drill to remove some traces of Sugru. Be very careful if you use a drill to make sure you do not accidentally damage the power jack.

lucky-resistor-21

Connect the NeoPixel Ring

It is time to connect the NeoPixel ring. Use another flat cable with three wires and connect the power and ground pads, also the data input pad. These pads are very close to the LED pins, be very careful not to damage them or create short circuits!

lucky-resistor-22

Use more hot glue to fix the ring in a perfect right-angle on the pipe.

lucky-resistor-23

lucky-resistor-24

Check if the pipe and NeoPixel ring fit into the lamp. Use a pencil to mark the positions of the foots/legs of the pipe on the bottom of the lamp. Remove the pipe and use large amounts of hot glue at the marked places. Put back the pipe into the glue. Carefully center the pipe as long the glue is still hot.

Build the Circuit Board

lucky-resistor-25

Setup the circuit on the strip board you prepared before. Make sure the board fits into the pipe with all components soldered on it. Next solder the connections from the power jack, push button and NeoPixel ring to your circuit board.

I used female headers to make the Trinket replaceable but soldered all the rest directly to the board. If you have some connectors, you could use them to be able to disassemble the lamp if some component has to be replaced.

lucky-resistor-26

Test the Wiring

Before you connect the lamp to your power supply, carefully check all wires with the wiring schema using a multimeter. Make sure there are no short circuits and only the required pins have a connection.

Enjoy!

If you are sure everything is correct, connect the power supply with the lamp and check if everything is working as expected.

lucky-resistor-27lucky-resistor-28

Enjoy your great table lamp!

lucky-resistor-29

Next Steps

You should also add a lid to the pipe to hide the microcontroller from view. Just use the same paper you used to wrap the pipe and cut a circle with the correct size from it. Also use some thick cardboard and cut a circle with the exact diameter of the inner size of the pipe. Glue both parts together to get a nice lid.

I hope you found this tutorial useful. Please leave a comment if you have any questions, ideas or additions.

Lucky Resistor

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay Updated

Join me on Mastodon!

Top Posts & Pages

  • Storage Boxes System for 3D Print
  • Use Enum with More Class!
  • Simple Box with Lid for 3D-Print
  • Fan Controller
  • Shop
  • Real Time Counter and Integer Overflow
  • How and Why to use Namespaces
  • The Hinges and its Secrets for Perfect PETG Print
  • Extreme Integers – Doom from Below
  • Build a 3D Printer Enclosure

Latest Posts

  • The Importance of Wall Profiles in 3D Printing2023-02-12
  • The Hinges and its Secrets for Perfect PETG Print2023-02-07
  • Better Bridging with Slicer Guides2023-02-04
  • Stronger 3D Printed Parts with Vertical Perimeter Linking2023-02-02
  • Logic Gates Puzzle 1012023-02-02
  • Candlelight Emulation – Complexity with Layering2023-02-01
  • Three Ways to Integrate LED Light Into the Modular Lantern2023-01-29
  • The 3D Printed Modular Lantern2023-01-17

Categories

  • 3D Printing
  • Build
  • Common
  • Fail
  • Fun
  • Learn
  • Projects
  • Puzzle
  • Recommendations
  • Request for Comments
  • Review
  • Software
Copyright (c)2022 by Lucky Resistor. All rights reserved.
 

Loading Comments...