Cutting a circuit board

It’s not the prettiest thing, but it works.

Work did a hack-a-thon event last week on Thursday and Friday. I decided to do a hardware project. The developers in the company can never decide how bright they want the lights on in the room, so I built a lamp that would auto-adjust based on the ambient lighting.

The circuit is a simple LED dimmer circuit. It uses a photo resistor to measure the ambient light in the room and then adjusts the brightness of the LEDs based on that. It also does a Redshit on the color of the LEDs. I’m using WS2812 LEDs. The microcontroller is an Arduino Beetle board from DFRobot that uses the leonardo chip. I love these little guys and have used them in quite a few projects.

I’ll grab pictures of the final lamp. The prototype was made with PVC and had a protoboard bolted to the top of it. It looked very ‘highschool science project’ looking, but it managed to net me two awards… Best hardware and Most Creative. I called it ‘Sir Lampalot’.

I’m currently rebuilding the lamp using a copper pipe to replace the PVC. It’s looking pretty nice. I need to sand and buff the copper and put some clear coat on it so it stays nice and shiny. I also 3d printed a box to mount the circuit board in.

On to the CNC side of the project.

I tried to cut a circuit board for the project. I ran into issues during the hack-a-thon, but was finally able to get something cut yesterday during my day off.

I’m having a problem with the cheap 10º engraving bits breaking the tips off. I may be cutting too fast @120mm/min

I used Eagle to design the board and I used pcb-gcode to create the cut paths.

I then had to edit the g-code files. The drill gcode adds tool changes for each of the drill bits, but those don’t seem to work, so I take them all out. I then use a drill bit big enough for everything.

I also add a G00 X0 Y0 to the end of the engraving code so that it goes back to home so I can switch the engraving bit with the drill bit.

The engraving bits seem to leave a rough edge, so I hit the bottom of the board with a little sand paper.


Great project. That little micro looks pretty slick. The box is neat too. Nice and small. I’d love to see the lamp pics. (Rough and polished images, if you’re willing to share).

Where did you point the photoresistor? I would think the light from the lamp would affect it.

Also, all developers should know that 0 is the correct amount of light. I would make an exception for a light conteolled by an arduino though.

Wow, inexpensive too:

I’ll have to remember that for my next project. Oh, who am I kidding I’ll probably order two without even having a project.

The photo resistor is mounted in the top of the lamp pointing up. The LEDs pointing down don’t affect it at all. Putting at the top of the lamp also keeps the light from the monitors from hitting it also.

I’ll get some pictures at some point.

I ordered one of those microcontrollers, and then turned around and ordered 8 more :slight_smile: This is my last one, so it’s about time I stock back up. The sad thing is, I can only remember where I put 3 of them…

The new lamp is finished. I had to test it to make sure it worked after re-running new wires through the stand.




Oh, it brightens up after the lights are off! That makes so much sense. I was thinking it would match the light in the room. That’s a very good looking lamp. I bet you could sell those.

Ran into a few design flaws. Having to work them out…

First flaw. The photoresistor was picking up some stray light from the end of the lamp. In partial-lit rooms, the LED could trigger the photoresistor to lower the brightness, then the light in the room would cause it to go brighter, so it would get into a weird flicker state. Fixed this one already by re-printing the photoresistor mount to add higher side walls blocking more light from below.

Second issue, is the light doesn’t get bright enough fast enough. I think I want to set it so that I can either adjust the point where the max-brightness turns on, or something. Maybe just use a POT on it.

Lastly, I really want some type of feedback showing me what the microcontroller is doing. I have one of those tiny OLED screens with 4 lines. I think I’ll try adding that just showing the current brightness level as a 0-100% or something.

On a side note. The copper pipe that the LEDs are mounted in makes an AWESOME heat sink for the LEDs.