Monday 8 January 2024

Hardwood slim line LED panel light fitting with accent lights

I recently purchased a pair of low profile LED ceiling lights from a charity auction on Ebay.

It seemed like the kind of thing that I’d find a use for eventually, and it was for a good cause.

After buying I had a message from the seller to tell me that they only had one driver for the two panels – I went ahead with the purchase because at the end of the day I wasn’t expecting them to be new and pristine from a charity auction.

My curiosity was piqued when they arrived. I noticed another label sticking out from underneath the address label. I peeled it back, and revealed an Amazon delivery label to a different address.

Initially I figured perhaps it was an Amazon returned item – one of the drivers was missing, therefore the original purchaser returned it, and it was sold on to the charity as one of those wholesale return pallets that you see advertised.

I did also think that the wires on the mains side of the LED driver seemed a little bit thin. However I tested it with those panels and they actually seemed to work okay, so I didn’t think much more of it.

Losing faith

So, I started to put together a project plan to make a light fitting with them.

I wanted to add in a few extra accent lights but everything I had was 12v, and the light fittings driver was 18v. While I was mulling over options – adding in a separate transformer, the space and heat issues to work round, etc. I noticed a couple of other things.

The case of the driver seems to have fake screw heads stamped on them. Not in itself a problem, but kind of sketchy.

And the panels themselves are stamped with 18w, not 18v.

The output of the driver says 9-18v at 300ma.

W=V*A.

There’s no way that if those panels are 18w, the driver can provide enough power to them.

This made me rethink my theory on the background of these lights.

Having a look on Amazon I can see very similar products, with identical looking drivers – the only difference being that the outputs are rated differently.

My guess is that this set of lights came with incorrect drivers, and the original purchaser damaged one whilst trying it.

It’s only a theory and not enough to make a claim against, it ultimately is enough to destroy my faith in these lights and make me not want to use them as they are.

Rebuilding the electronics

I had built the design around the size of these panels, so I decided to rip out all of the electronics.

On doing so I realized that the panels were just flexible LED strip edge mounted to a diffuser.

I swapped out the LED strip that was there with some white 12v strip LEDs. I had to trim about a millimeter off the sides of the diffuser in order to account for the slightly larger LEDs.

In an initial test the LED light was quite patchy, so I took the diffuser from the second light and doubled up. This makes a notable difference.

To drive the strip I’m using a regular RGB LED control box.

Initially my choice of this was simply because it was available and had a small profile so would fit well in the fitting.

However this also gave me the idea I could run the accent lighting and the main light on different color channels, allowing them to be controlled separately. It would also allow me to dim the light.

The design

Because I don’t want to carve out my ceiling to flush fit the panel I planned to build a small mitred frame, with another frame mounted at forty five degrees behind it. The back frame would contain some accent lights, with the front frame housing the main light fitting.



the fitting needed to fit in with the of our lights in the room, so I disassembled the original fitting and spray painted it black.

For the wood frame I opted to use zebrano.

The frames are simple squares with 45 degree mitres, and a 2mm deep by 10mm wide rebate to fit the light fitting frame flush with the surface.

The back frame was turned at a 45 degree angle, and screwed to the front frame.

The back frame also had a pair of key hole plate mounted to the back, which will be used for connecting to the ceiling.

Accent Lighting

Rather than cut up the filters from the second light, I opted instead to use a stack of filters from an old PC monitor. It was simply a case of measuring out the triangles, cutting them and then gluing them in place with hot glue.

Each corner would have a single segment of white LED strip (3 LEDs per corner). These would be connected in series and then connected to the RGB LED control box, on a different color channel to the main light, allowing them to be used independently.

The rest of the electronics

The IR receiver from the control box sticks out behind the front frame, so it is not visible from ground level, but catches enough reflected light from the ceiling to function.

However, this didn't last long and soon found itself wrapped in black tape because what I didn't realise at the time was that the IR receiver worked on the same encoding as our TV remote and we soon bored of having the lights change as we scrolled through TV guide menus.

PSU

The power supply is provided by an AC-DC “wall-wart” – I had to be quite selective in which one I picked to fit within the frame. The one I opted for had a removable face plate which allowed me to remove the socket pins and wire directly into.

The end result

 



Saturday 30 December 2023

Christmas Lights 2023 - Baby bouncer controlled lights

Back in 2020 I made some Christmas lights that could be controlled via Slack and WhatsApp so that Christmas spirit could cross the void created by Covid-19 and its lockdowns.

In subsequent years I added more features, such as morse code.

So now adding to my over-engineered Christmas lights has become something of its own tradition.

In early December this year, while setting up the decorations and mulling over what new silliness I was going to add to the lights, I was asked to fix my son's baby bouncer/cradle thing.

It's a Fisher Price Kick & Play Calming Vibrations bouncer, which has switches in the foot area which I believe are supposed to trigger lights and sounds.

This particular one was a hand-me-down which had been sat in storage, and the battery terminals are all corroded, making it non-functional.

Fixing it wouldn't really be a big deal, but I remembered that like most newborns, my son loves anything that's bright and shiny and blinky, like Christmas lights.

 

So obviously you can see where this is going...

The arch of the chair detaches, and you can see in one of the mounting points 4 pins.

A quick probe with the multimeter shows that these are two pins for each of the two 'pedal' switches.


To interface this with the existing light setup, I decided to again use the GPIO interface of the PCDuino.

Using the guide from before, I identified the GPIO identifier for two pins that I wanted to use, and enabled them as below. Pin 4 (232) is an input and pin 7 (233) is an output that is set to high simply provide a source, as I wanted to keep the main source pins (3v3 etc) free.

echo 232 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio232/direction
chown -R ant:ant /sys/class/gpio/gpio232
echo 233 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio233/direction
chown -R ant:ant /sys/class/gpio/gpio233/value
echo 1 > /sys/class/gpio/gpio233/value

The two pins were connected with a resistor to create a pull up effect. I had initially tried to have it as a pull down but it seemed to still have a lot of flicker in the output.

I picked the switch with the red foot as this tends to be more how Sam would sit. one side of the switch was connected to ground, and the other to pin 4.

The code

I added a thread to the main application which would read the value of the pin and change the lights accordingly.

Because of the way that /sys/class/gpio/gpio232/value is not actually a real file, it was not possible to hold the file open and continually read the input. Instead I had to create a loop which would constantly open the file and read the value. This does cause some overhead, but isn't too bad because the file is never more than one character long.

I had initially planned that when a change is detected, it would hook into the main code to change the lights, however I found this was causing a lot of deadlock issues. 

Instead, the new thread works very independently - it will pick one of the basic colors at random, and make a simple HTTP request to localhost to invoke the change.

The result

I'm not sure if he's aware of the causation between him moving and the lights changing, but like most babies there's twinkling, blinking and sparkly stuff, he's a fan, so he certainly seems to enjoy it.


Wednesday 6 September 2023

Acrylic bending tool and laptop desk mount

Since lockdown in 2020, I’ve continued to work remotely, and sunk a fair bit of time and effort into optimising my home office setup.


One thing that has continued to be a pain is having my laptop on the desk.


I don’t use it has a laptop the majority of the time – is it is closed and I use external peripherals (monitor, keyboard, mouse, microphone and camera). But it continued to take desk space as I had nowhere else to put it.


I had this idea of creating a mount on the side of the desk for it, but couldn’t settle on a approach or material to use. Wood would be too bulky, metal would be overkill and block wifi signal, and so forth.


Plastic seemed like the best option, but it would be far too big to 3D print.


When researching methods for manipulating plastic sheets, I found this video by Youtuber Dietec for a home-built acrylic bending tool.

 

Truth be told, I followed the video pretty much to the letter, so there’s no point rehashing all the points that are made.


The only main difference is I added a couple of toggle clamps on the side, and am using a “Universal” laptop power supply instead of a bench top one.

Anyway, back to the laptop mount.


It’s very simple really, take a sheet of acrylic and bend it into a ‘J’ shape, attach it to the side of the desk, and add laptop.


The piece of acrylic was recovered from an old scrapped project, and was a bit on the short side, however this could be overcome by mounting it lower on the desk skirt.


The bending process seemed quite straightforward. I did notice some crackling in the corners of the bends, I believe this is because I got impatient and stepped through the voltage settings a bit quick, rather than give the material time to heat slowly – so that’s something to bear in mind for next time. I think that's also why there's a slight curve to the lip, as can be seen in the picture below.


Then a couple of screw holes were added (taking advantage of pre-existing holes from the previous project and just widening them), and then screwing it to the desk skirt.

The laptop in place on the mount, tucking nicely under the lip of the desk at the side. Sure it's not a perfect build, but it serves its purpose.






Saturday 10 June 2023

Treadmill Videogame Controller part 2

Since building the treadmill project late last year, I did actually manage to complete a full run through of the original Sonic the Hedgehog.

Along the way I found a few snags and issues with the treadmill:

Direction switch/lever

I soon found that the reed switch control from the cross trainer levers was problematic because there was a lack of tactile feedback to know when the lever was in the correct position for changing direction.

Therefore, I replaced it with a regular switch where normally open connected the ‘right’ key and the normally closed connected to the left key. Using a metal angle bracket I was able to mount it to the frame so that the switch is closed when the lever is fully forward, and open in any other position.

This means that when moving right I just need to keep the lever fully forward, and to change direction I just have to move it from that position.

Although I kept them in place for the duration of the Sonic play-through, I’ve since removed the cross trainer levers, as they do not provide any real benefit over a regular button.

Jump button

The large plastic button that I was using as a jump key broke (it was from a cheap “noise-maker” type toy, and the PCB literally snapped), so that was also replaced with a basic switch. I plan to change this up for something better in the future, but at the time I just wanted to go for a run.

Quick save and quick load 

I found, particularly on the more platform/puzzle sections of the game, it became necessary to make use of the quick save and quick load features of the emulator, so I added an external quick load button to the treadmills handlebar.

A better button system

All of the above can be distilled to a single point - that the button inputs were not good enough.

Although I started the project with the intention of minimising the number of regular button presses, it seems inevitable that there will always be some required.

Configuring the controls

In order to play other games I would need to make some additional adjustments for different control schemes. This would mean altering the firmware and re-uploading every single time I changed the game, which seemed needlessly convoluted.

There were two main reasons for using the Makey Makey. The first was to take advantage of its noise filtering features, and the second was its ability to act as a keyboard.

The noise filtering is the real selling point of using it, but there are other ways to obtain its input and then turn into keyboard input. So I adapted the firmware so that instead of sending keyboard input it would appear to the connected computer as a serial port. On each cycle it would send one byte, with each bit representing the button state (i.e. pressed or released) of each of the buttons.

This would allow a data transfer rate fast enough to handle pretty much any input I can throw at it.

The source code for this can be found at Github.

The software

The software will be an ongoing development project so I’m not going to be sharing it at the moment.

On the computer side, an application will continuously read the serial import, and then translate it into appropriate keyboard events via udev, thereby sending whatever that keyboard input is to ever application is active and in focus on the computer – in the case of this project that will be a game.

For this iteration of the treadmill I’m going to be using the acclaimed indie game Super Meat Boy – as it has a small range of inputs (left, right, sprint and jump) but adds a couple of extra bits of complexity for me to expand on with the treadmill.

Once the serial connection is established, a thread runs constantly, reading the latest byte from the Makey Makey.

It compares the byte to the previously read byte. If a bit that wasn’t previously set is now set, then a corresponding function is called in a secondary thread, which is the input thread.

The input thread maintains a count of “presses” from the treadmill rotations, which increases with each press as well as decreasing with the passing of the specified time interval (the “decay”).

If the count is positive then the first key (the direction) is pressed.

If the count is positive and greater than the defined sprint threshold then the sprint (shift) key is also pressed.

For the jump key, the serial thread will always report the state of the relevant bit to the input thread.

This compares a pair of booleans (jumping and lastJump) – which determines whether the jump (space) key should be pressed or released. It is done this way because Super Meat Boy differentiates between small and large jumps based upon the duration of the key press.

Tuesday 30 May 2023

Wheeled flower pot stand

When I started woodworking, a key motivator was simply financial - make stuff myself and save cash.

A recent trip to the garden centre, where they were selling these wheeled flower pot stands at absurd prices, convinced me to get back to basics and make my own.

There's nothing complex about this build. Simple pallet wood - all from the same pallet to keep consistent appearance, and avoid the need to process the wood too much (planing, thicknessing etc)

A simple grid of five slats with gaps in between and two perpendicular underneath, all 40cm in length. Each overlap with two screws - the only 'gotcha' being to be mindful of the screw placement on the end ones, given that it'll be cut into a circle.



Then simply cut into a circle with a jigsaw, and a quick sand to remove sharp edges.

Four wheels from an old office chair were attached - these are simply push-fit into a drilled hole.

That's all it took - literal junk (pallet wood, wheels scavenged from a binned chair, and even the screws were from the 'miscellaneous' jar). Whole thing took less than a couple hours and saved about thirty quid.


Tuesday 11 April 2023

“Picture and Collection Bar”

This is another one of those projects I found on Pinterest & decided to make a DIY implementation of. The original pin describes it as a “picture and collection bar”.

Essentially using a wooden strip to trap marbles in such a way that they have a little movement but due to the sloped design will always try to move downward and towards the wall.

This means that if you push a piece of paper through the gap at the bottom, there is enough movement for the marbles to get out of its way but they will immediately roll down, providing just enough friction to hold the paper – but not enough friction to prevent you from easily removing the paper again if you need to.

It’s kind of like an ultra slim pin board, but without having to put holes in your paper.


Design
The original design I found used pretty thin strips that appear to be jointed it mitred angles.

Instead I opted for using a larger piece of oak, but then cutting out an angled gap for the marbles.

The cross section looks something like this:

Construction
The actual construction of this was very simple, just a series of rebate cuts on the table saw, occasionally making one of them angled, and making one very us at the bottom of the piece, so that when it’s up against the wall there is a slight gap as can be seen in the above diagram, which will allow paper to pass through.

Then I capped off the ends with a little piece of mahogany, to prevent the marbles from rolling out the sides – this is simply glued and pinned in place – and then finally some finishing.

As the piece of oak I was using was reclaimed and had a couple of screw holes, I patched one which looks a little bit like a knot in the wood, and the other two which were at the edges, I decided to patch using brass tacks, as the holes were in a position where if I were going to screw this to the wall I would have put holes anyway.

Mounting
The tricky part of this project is mounting it to the wall. My design does not have a back piece because I did not want it to protrude too far from the wall. The downside of this means until it is on the wall, the marbles could fall out the back.

So, firstly, I filled the back with some marbles.

 I then used gaffer tape across the back of the marbles and the lower part of the bar – leaving the side top bit exposed as this is where the adhesive is going to go. I left enough excess gaffer tape to be able to fold it round so that there was a ‘handle’ hanging off the bottom of the bar.

Obviously the next step is to mark out a position on the wall to mount it, make sure that it is level, etc. Then apply the glue to the back of the bar, and stick it to the wall.

Once you’re confident that the glue set, you can put on the gaffer tape ‘handle’, to peel the tape away from the marbles on the back, releasing them.

 

 

 

 

 

 

 

Result



Saturday 4 March 2023

Modernising the electronics of a vintage Singer 99k sewing machine

As I mentioned in my previous post when I was restoring the sewing machine, the electronics were in a pretty bad state.


I believe the pedal was meant to allow for variable speed input, but in reality it acted just like a simple on/off switch, and pressing the pedal down the whole way tripped the circuit breaker.

Inside the motor housing once
the rotor had been removed.

Initially I tried just repairing what was there, replacing brushes in the motor, cleaning it all up – which seemed to provide some temporary improvement but it soon deteriorated again.

 

 

 

 

 

 

So I decided to just try and replace all of the electronics with modern equipment, but retained the original casings to try and maintain the rustic aesthetic. I figured with modern advances in electronics it is quite likely that a lower power, modern motor would be able to provide comparable performance to the old one (the analogy that springs to mind is the state of modern cordless power tools versus old mains powered ones).

It is clear that the original motor does not have any kind of gearing to boost power – the circuit seemed to be about as basic and simple as it gets.

As I was researching the old motors I did see some mention about potential asbestos hazards – this is near the bushings of the motor – it is intended to support the bushing and act like a self-centering bearing. As I am entirely replacing the motor I had no need for it. With appropriate protective equipment in place I was able to remove it and dispose of it appropriately.

There was also mention about the being asbestos washers in the foot pedal, however my one does not appear to have these – but nonetheless I will not be using this pedal anyway.

One side the case of the me to opened up I was able to pull out the coil windings and rotor, leaving an empty shell. I removed the original connectors.

 

The screwdriver
To replace the motor I am going to use a cheap cordless screwdriver. Being cordless it should be adaptable to run on a lower power, but given the task that it is designed for, it should still be able to provide enough torque to run the machine due to it’s gearing set up.

In these cordless screwdrivers all the electronics tends to be in the handle, so it is easy to separate out the motor and gearing system from the rest of the device.


With that done I needed to trim off some of the casing to get it to a suitable size to fit in the sewing machine motor case. 

The screwdriver in it's mount

The only modification I needed to make to the sewing machines motor case was to drill out the opening slightly as the shaft of the screwdriver was a little bit wider, however this is not actually visible from the exterior.


To mount the screwdriver, I 3D printed a mount (Github/Thingiverse).

It's simply a friction-fit wedge that goes around the screwdriver body and into the sewing machines original metal case. 

The diameter of the shaft of the motor is the same as the original motors pulley, but worth bearing in mind that the new motor is slower. I had the idea to increase the diameter of the shaft, in order to change the gearing between the motor and the sewing machine and get a bit of a speed increase. It should also increase the grip on the pulley as there will be a larger surface area of the belt in contact with the shaft.

 

 

To do this I created this (Github/Thingiverse). It fits within a small section of aluminium tube (to prevent wear on the plastic), and over the shaft of the screwdriver. It's locked in place with an allen key (cut flush) that fits as if it were a screwdriver bit and locks into this plastic widget. Finally I locked it all together with some adhesive and wrapped a bit of grip-tape around the aluminium. 


Driving and control
To drive a motor I am using a BTS7960 motor driver, controlled by an Arduino (for now, for the purposes of prototyping).


Simply this will be an analog input, which the arduino will translate into pulse width modulation (PWM) and send to the motor driver. This is possibly overkill, but the priority at the moment is too get the machine working – optimization & improvements can come later.

For now, I have a simple potentiometer to set the PWM, and the pedal is actually just a switch cable tied to the legs of the sewing machine. I am hoping to be able to get a treadle foot pedal like those that would have traditionally been part of the table legs that I’m using, and use that – if I’m ever able to find one.


Pulley Belt
The belt connecting the motor to the machine was worn through and hanging on by a thread, so it needed replacing.

There seems to be a lot of various DIY how-to ways suggested to create pulley belts to size, so I started working through those. The results were:

  • Pulley belt from an old printer cut to size and stitched together using fishing wire - failed - snapped.
  • As above, but joined with glue and stitched - snapped.
  • Electrical wire (speaker cable) threaded together, and heat-shrunk to provide a rubberised grip. This seemed promising - it didn't snap at least, but the heat shrink, although intended to provide grip, seemed to have the opposite effect.

After all that, as a temporary measure, I joined 3 nylon cable ties together, just so I could move on to the rest of the project. And as the saying goes "There's nothing more permanent than a temporary fix", it's still going strong.

 

Light
The motor housing also contained a small lamp fitting. This was previously a mains powered, incandescent, bayonet fitting bulb. However I rewired and replaced this with a 12v LED bulb – much in the same way the I did with the Sunset Sarsaparilla lamp project.
 


 

Power
Power was provided by an old desktop computer power supply. This provides 12v lines for driving the motor and the light, and 5v for the logic. Again, this is another quick prototyping move, and will eventually be replaced by something nicer.

Finally all that was left was to oil the machine as indicated in the original manual, and give it a try.