L3m.io
This is the personal website of Lemonade1947
We are hightech lowlives.
We are going nowhere fast.
View All
A Fitting Toggle
2024-12-29
A while ago, probably a few years ago now, I decided that the torch I had zip tied to a micrphone stand above my desk wasn't an adequate work light. Like many people my age, I'm allergic to well lit rooms but I can't deny the utility of a bright light now and then.I deliberated over this for many days, perhaps weeks, looking at different options available, mounting systems that'd allow me to position it over my desk where I wanted, brightnesses, colour rendering indexes, all this sort of thing. Eventually, I gave up and decided anything worth having was more expensive than I was willing to pay, and anything I could afford wouldn't be bright enough to work by.
When I say work, I don't mean programming of course. I mean fiddly little electronics. Fiddly things need a lot of light thrown at them, this is a fact of life.
Having come to this conclusion, I decided I'd have to build something.
So, 30 watts of LEDs and a big heat sink later, I got to work.
Below are some pictures of the lamp in it's original location, my old flat, attached to my mic arm.
RIP to the bench power supply that ran this lamp for a few months while I was building the control circuitry and sourcing a suitable power supply. You were built into my soldering station, and were not designed to do 2.5 amps continuous. I had to replace the whole thing.
The way this worked, was that the control box under the desk had three power levels, four if you include off. Via some mosfets and a little ATTiny, one could set a low, medium, or high setting.
I was quite pleased with it once I had it working, but history shows that I never actually used any of the settings other than high and off. Still, it was a good learning experience. My first time programming an ATTiny, and my first time driving mosfets properly.
All that being said, dear reader, this post isn't about the lamp itself, but what replaced the switch box.
At some point after the creation of the lamp, I moved to another flat. Because of how (poorly) integrated the lamp was into the desk, Wires had to be cut. The control circuitry didn't make it to the new flat, and I ended up with a lamp, but no switch.
Incidentally, the mic arm it'd previously been mounted too also found a different home at the new flat, so that was another difference that made the old setup almost impossible to transplant.
The lamp sat in storage for about a year, before I finally decided that I needed it again. Once again having made do until then with a, this time magnetic, torch attached to the mic stand.
At some point this year I became fascinated with relatively cheap chinese camera mounts. I realised at some point that all of these are designed to hold heavy DSLRs, and thus I could likely repurpose them to hold many other things. As of now I have four of them holding up things behind my desk, one of which is the lamp.
But I digress.
The lamp finally had a new home above my desk, and I had resolved to control it using a set of RF remote controlled plugs that I'd been given as a gift by someone who knew how much I hate anything that connects to the internet.
I'll fully admit, this did work for a long time. It was a perfectly adequate solution. But i always had this feeling that it didn't fit the lamp I'd made.
I decided to embark on what is the obvious path from this point. I would reverse engineer the little RF remote control and make something truly fitting.
I started where anyone'd start. By searching to see if anyone had done this before. I already had a hunch about how I might go about doing this, and actually had the majority of the parts I'd need to build a prototype hanging around already.
What actually ended up being complicated, or at least it was before I knew how, was how one might decode the transmissions from the remote control.
I had read online about someone much cleverer than me reverse engineering the pulses using a standard RTL-SDR dongle, something I had access too, and a piece of software called Universal Radio Hacker. After validating that I could receive the pulses at all in GQRX, I then set about trying to decode them.
Dear reader, while these pieces of software are clearly extremely powerful, I am not. I confess that I had no luck with this method whatsoever, and quickly grew disheartened. No matter what I did with the strings of bits and bytes that the program spat out, I was unable to trigger any of my switched outlets, and thus I found myself back at square one.
Fortunately, however I found that the work had already been done for me. I should have looked closer the first time, it always has been. A library exists that can not only transmit the codes but, with the correct hardware, can also read them in. Not long after, I had my working prototype. Two switches, a radio transmitter, and a Wemos D1 Mini clone.
After this, I simply pulled the remaining six codes from the remote, cast it aside, and begun work on my hardware design. The fun part was finally here.
I got to work on the CAD, ordered some LEDs and Toggle switches, and got printing.
The switch pannel was finished! all that was left to do was to buy yet another cheap, chinese DSLR mount and mount it to my desk using the compatible brass insert I'd incorporated into the design.
You'll notice there are five switches. Currently, they control, from left to right: small lamp, the aforementioned big lamp, desk fan, and a small electronic heater. The fifth one is currently unallocated.
Lessons Learned:- The tolerances on my ancient, highly modified Ender 5 are still good enough to make friction fit parts. This is good to know.
- There is always a library to do this type of thing.
- The WeMos D1 Mini isn't the ideal choice for this type of project. Gets upset when certain lines are high on boot.