Showing posts with label electronics. Show all posts
Showing posts with label electronics. Show all posts

Monday, 23 December 2024

Christmas Lights 2024

It’s become something of a tradition at this point that each year I continue to build upon the interactive Christmas lights which I started in 2020.

Previous iterations:


Now that my kid is walking, the baby bouncer control I added last year is redundant, but is given me the idea of continuing to build upon the lights following his progress stages.
So this year I purchased a Playstation dance mat.


The single board computer that I have been using is pretty much tapped out in terms of resources – trying to add a USB hub in order to connect the controller pulled too much power, so in order to do that would mean having another powered USB socket (currently there are 3, which all powered from a single wall socket, 3 port USB charger)

However the way that I have developed the control software is that it is ultimately a small web server on the local network.


Therefore I can connect the dance mat to a different machine then just have it control the lights over the network. It’s perhaps not the most optimal way of doing things, but is ultimately a temporary installation for a couple of weeks.


To connect the dance mat, I am using a Playstation to USB adapter (it’s a PS2 dance mat).


This shows up under lsusb, and using the details taken from there I can connect it using udev, following the same method that I used in order to connect the treadmill from a different project.

 

Thursday, 28 November 2024

Memory Box with lid-triggered audio

After having our son, my partner wanted me to make her a memory box where she could keep all the trinkets and keepsakes from his birth.

As it is something of an old stereotype that such things would be kept in an old shoe box, I wanted to mimic that aesthetic.

The box is made from iroko, sides of approx 1cm, joined with box joints.
The base is simple hardboard, rebated into the sides.

I didn’t really want to add hardware such as hinges as I felt it would detract from the shoebox aesthetic, so I opted for a simple lift off lid.

The lid itself is made from a thicker piece of iroko, with trim added around the edges.

In order to provide a good friction fit, a piece of plywood, wrapped in t-shirt fabric, matching the boxes internal width and depth was added to the lid. This holds the lid on without rattling around, and incidentally hides the “bonus feature” of the box.

The bonus feature

Of course I can’t do anything normal like just make a box.

During his first few weeks, whenever our son sneezed, he would follow it up with a little noise that sounded like he was saying “oh..”. Of course it was incredibly cute and a memory we want to cherish forever.

What my partner didn’t know at the time, is I had managed to catch this on video, and I wanted to surprise her with it. 

A few years ago (around 2015-2016 I think), Sainsburys brought out a Christmas biscuit selection box which included a gadget for recording a message that would play when the biscuit tin was opened.

Somewhere along the line somebody I know must have got one, I scavenged the gadget from the tin once it was empty, and it spent the past few years sat in my electronics junk drawer, waiting for a project to be used in.

 

 

The circuit board is clearly designed as a disposable product – it is powered by 3 button cell batteries, which are riveted to the PCB itself. Whatever microcontroller powers it is hidden under an epoxy blob, and the only other notable features are a small microphone, speaker, a light dependent resistor (which is how it detects if the box is opened), and a small switch used to start and stop recording.

First thing to do was to drill out the rivets and get rid of the dead batteries.
Rather than replace them with more button cells, I opted for wiring in a AAA battery holder, I just had to follow the PCB traces and connect it at the right point.

 The microphone is pretty much as crap as you would expect for something of that size in a ostensibly disposable product, so I needed a better way to record the audio.


To do that I replaced the microphone with a 3.5mm jack and coupling capacitor. Once I’d copied over the recording, I removed that as well to save space, and also removed the record button to avoid overwriting.

 

Then it was simply a matter of hiding the electronics in the box. This was done by carving out a hollow in the middle of the lid. The ‘inner lid’ of plywood that was also used to create a friction latch, added sufficient depth to the lid in order to hide the battery and PCB.

The underside of the lid with hollow for PCB/battery and speaker.


The t-shirt fabric that covered the inner lid also hid the circuitry, while also allowing enough light to pass through to activate the recording.


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, 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.

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.

 

 

Thursday, 15 December 2022

Slack/Whatsapp controlled colour-changing and morse code Christmas lights

Several years ago I made some Christmas lights that could be controlled via Slack and WhatsApp, and every year since I find that I need to update the interface to these platforms to account for the changes that they make during the year. 

Usability updates

This year whilst I was doing that, I took the opportunity to add a few new features and simplify the interface.

Now it responds to some key words – all, top, bottom, half, alternate, led, and allows the user to specify certain colours by word and all colours by hex code.

Additionally I refined the serial interface to speed things up.

Moving to a single-board computer

 
For my home implementation of this, previously I would just run a USB extension lead from my desktop. 


I have now migrated the code to a PCDuino2 single board computer. This is a 1Ghz Allwinner A10 chip SBC, which also contains Arduino pin headers.


The board is discontinued (I bought this one from Maplin years ago during their closing down sale), and as a result there is little in the way of official repositories or archives for the Ubuntu variant distribution that it runs. Plus it looks like there’s some sketchiness around the official firmwares around the allwinner chip that powers it.


I found a version of Armbian linux for this platform and burnt it to a micro SD card.
This allowed me to get the PCDuino to boot to Armbian.


Unfortunately it looks like there is no real support for installing Armbian to the NAND storage which is on the PCDuino. However, leaving it on the micro SD has some advantages such as easily being able to image and back up the install.


Then it was simply a case of connecting it to the network and updating it, enabling SSHD for ease of maintenance going forward, and installing required tools for the Christmas lights server (JDK and Arduino).


As the PCDuino is not a typical Arduino development board it needs its own board definition to be used with the Arduino IDE, so for now I decided to continue using an externally connected Arduino.

 

Implementing morse code

 
One of the downsides to the set up the I currently have is that the serial data transmission can be disrupted by the update process transferring data from the Arduino to the lights.


The changes I have made reduce the amount of data that is transmitted via serial and so minimize the problem.


However there is additional functionality that I wish to add that will require further data to be transmitted – that is to have a set of lights which flash similarly to regular Christmas lights, but instead of a standard or random pattern, they blink out morse code, based on a message input from the control application.


Rather than cram more functionality into the WS2812 lights that I am currently using, I plan to leave them be and use a regular set of plain white fairy lights for this. Typically I have always decorated our Christmas trees with a multi colours set and a plain white set, so this fits with what I would typically do anyway.

The lights I used are powered from 3xAA batteries (4.5v), which can easily be substituted for USB and powered from a USB hub. To toggle their on and off state, I have used an optocoupler which will be toggled from the PCDuinos GPIO pins.


The ‘arduino-style’ pins of the PCDuino board can be reached in be linux file system via GPIO – similar to the way I toggled an output pin on the frequency switch project.


Seeing is this makes it quite easy to simply toggle a pin on and off, I should be able to use this for the morse code without having to depend on the rather outdated and no longer supported PCDuino board definitions.

Finding the pin reference

 
A ‘gotcha’ about using the sysfs GPIO interface is that the pin numbers as they may have silk screened on the board do not necessarily correlate to the pin numbers in the file system.


The first thing to do is figure out what the pin identifier would be. In this instance, I found some config files for the PCDuino on GitHub.


There lists the PCDuinos GPIO pins and there corresponding identifier, summarised below.

GPIO PinPin ID
0PI19
1PI18
2PH07
3PH06
4PH08
5PB02
6PI03
7PH09
8PH10
9PH05
10PI10
11PI12
12PI13
13PI11
14PH11
15PH12
16PH13
17PH14
18PH15
19PH16

I’d decided to use GPIO 8, so the relevant ID is H10

The Sunxi wiki demonstrates how to calculate the relevant GPIO number from that ID

(position of letter in alphabet - 1) * 32 + pin number

so with H10, H is the 8th letter so

(8-1)*32 + 10 = 234


So with that number calculated, we can export the pin with

echo 234 > /sys/class/gpio/export

which will make ‘gpio234’ available under /sys/class/gpio.

From there we can make it an output, and change the ownership so of it’s value file so that a regular user can write to it.

echo out > /sys/class/gpio/gpio234/direction

chown -R ant:ant /sys/class/gpio/gpio234/value


Then to switch the lights on,

echo 1 > /sys/class/gpio/gpio234/value

and

echo 0 > /sys/class/gpio/gpio234/value

to turn them off


A demo video is below, and as usual the source is available on GitHub.

Merry Christmas!

 

 

Saturday, 15 October 2022

Treadmill Videogame Controller

Like a lot of people, I spend a lot of time trying to balance the need for exercise and fitness with the desire to sit on the couch and play video games.

So I figured why not combine the two.

To start with I picked up a treadmill – this one is a manual treadmill as I want its movement to be dictated by my running, not by some electric motor.

There is a small control panel on the treadmill which provides some statistics. It is completely optional and not required to use the treadmill. It gets it’s power from a separate battery supply.

Although this is not particularly useful to me, it does indicate there is some type of encoder in the treadmill assembly to measure these values. Before even taking the treadmill part I can surmise that this is most likely either a magnet and reed switch assembly, a hall effect sensor, or a rotary encoder.

Once I got the treadmill, I could see a simple 2-wire lead from the base of the unit through to the control panel, connected with a 3.5mm jack.

I breadboarded a small breakout so that I could connect the oscilloscope and see what kind of signal was being passed.


This revealed that there’s 2.5v being sent down the line (tip of jack is positive), and that the signal would transition between high and low as the treadmill was used, and the frequency would increase as the speed increases.

In it’s most basic form, if we can translate those state transitions to key presses, that should work.

There was however a whole lot of noise in the signal which seemed to be caused by resonance in the treadmill frame, as there would be severe jumps simply by my touching it.

Initial Implementation

An initial attempt to use an Arduino and have the signal trigger interrupts wasn’t successful due to the noise, and filtering attempts became quickly time consuming.

The requirement for the filtering and the requirement for it to be an input device led me to a MakeyMakey development board.

This board is advertised as an educational toy, that allows users to turn anything into a key. In order to do this it provides a significant amount of signal processing and filtering. So in other words, exactly what I’m looking for.

This means that very little is required on the software side, as the Makey Makey presents inputs to the computer the same as a keyboard would, and applications generally will not notice any difference.

By simply connecting a crocodile clip from the tip of the 3.5mm jack to an ‘key’ on the Makey Makey, and connecting the body of the jack to the ground of it, that is already enough to get some response. Every pulse sent by the treadmill gets interpreted as a key press and release by the Makey Makey.

Problems

The only problem with that is with the treadmill in normal operation, the pulses (and therefore keypresses) are so quick that they do not translate real world movement into equivalent in-game movement.

With the treadmill running, the red marks show the time that the key is pressed. The two ‘bursts’ of movement on the treadmill appear as a total of 14 short keypresses.

 

Instead, either the rapid tap causes the character to barely move, or if the treadmill stops when the signal is high, the character runs at full speed without needing any further movement on the treadmill.

 

The treadmill stopped when the signal is high – making it look like the key is held down indefinitely, even though the user is not running

 

What I want to do is to bring the game input more “in step” (ha) with the movement of the treadmill, so that the same two bursts of treadmill movement would look more like the following:

 

The two bursts of activity are represented as two longer keypresses, as if the key were held down for the time the treadmill is moving

To do this, I forked the source repository of the Makey Makey project, and made some edits.

The changes are mostly in the updateInputStates function, and focus on the ‘right’ key on the Makey Makey, as I will be using a side-scroller game to test.

Demo

To demonstrate what this change does, below are two screenshots which represent a few seconds of continuous running on the treadmill.
The first is with the treadmill connected to the “Up” key, which is unaffected by the code changes. The input is shown as repeated press and release events.
The second is with the treadmill connected to the “Right” key, which is the one that I have changed.
The impact is shown any as press events, up until the point that the treadmill stops. This is the same as if the key were held down.

The test code is based on KeyEventDemo – the only change is that I removed the KeyTyped event as it is not relevant to this exercise.

Implementation 

Unfortunately there is no way of determining the treadmills direction of travel as it was obviously not designed for that, but in a game I may want to change direction.

What I have done is a workaround for now is I have made the same change for the left key as I did for the right and have wired the treadmill to the Makey Makey like so:

This means by simply flicking the switch I can change direction. In a subsequent moment of inspiration I swapped the switch for a pair of reed switches and a magnet attached to one of the cross-fit handlebars that are on the treadmill - allowing for the direction to be controlled with the left lever.

I have also wired a simple momentary switch to the space key to allow my character to jump.

For now this whole contraption is held together by screw terminals and crocodile clips as it is only a prototype and is a platform I want to expand on in future.

The Game

For this initial experiment I wanted to use a game where input is limited, as a proof of concept.

To keep with the theme of running and speed Sonic the Hedgehog seemed like a suitable choice.

I will be running this on a PC with a Sega Genesis/Mega Drive emulator.

Please note the various copyright and legal complexities around the use of emulators and ROMs - the short version is that you should not use ROMs of games you don't own.

I actually own two copies of the game - an original Mega Drive cartridge, and a PC version as part of the "Sega Mega Collection Plus". It's just that the Mega Drive emulated ROM is easier to interface with.

The end result:

 

Saturday, 18 June 2022

Fallout New Vegas inspired "Sunset Sarsaparilla" lamp

In Fallout New Vegas there is a fictional drink - Sunset Sarsaparilla - and in various locations throughout the game there are these bottle lamps, which served as the inspiration for this project.

 

 

I'm not trying to make a perfect replica, but instead just follow the general format of the design.



Lamp

The base lamp I am re-purposing is a basic  bedside lamp. It has a simple stem that lends itself well to this kind of project






Bottle

I found a beer bottle which had no embossing or branding on it other than an easily removed label.

To drill the hole in the bottom of the bottle I created a single-use jig to hold the bottle upside down. I filled the curved base of the bottle with water to act as coolant and lubricant, as excess heat can be a big problem when drilling glass. An abrasive drill bit, normally meant for drilling tile, was used, which worked very well.

In it's simplest guise, the project would just be "Drill hole in bottom of bottle, thread lamp through bottle, done."

 

Switch

Although I didn't want to make this project an on-the-nose gaming build, I do have some Sunset Sarsaparilla branded bottle caps, which I wanted to use as the switch. However I don't want the sharp-ish edges of the cap exposed, so I encased it in two-part epoxy resin.

This sat atop a simple toggle push-switch poking through from the bottom of the base.


Assembly

Starting with the stem of the lamp, I drilled a small hole in its side, to thread the fairy lights through.

Then the connector end of the fairy lights are threaded through that hole, and the lights themselves wound fairly tightly around the stem

A second, plain brass, bottle cap was drilled to fit the stem of the lamp, and threaded onto the lead for the main bulb.

This was then attached to the top of the stem, and the lead threaded through.

This assembly was then put into the bottle. Before pushing the bottle cap down entirely, by pinching the end of the fairy lights and then rotating the stem, the lights could be unwound, so that they expanded into the bottle.

At this point the fairy lights were tested (with just battery power) to ensure no wires were broken or damaged during assembly.

 

 

Power

The original lamp runs on regular mains voltage.


However I'd like to reduce it so that I can add some fairy lights in the bottle for some additional lighting.

There exist 12v DC bulbs for the type of fitting this lamp has (E14 SES), which would typically be used in caravans etc. Obviously it's not just a case of switching the bulb over, else the 12v DC bulb will just get destroyed.

So firstly, I'm removing the plug from the lamp, so it's not connected back to direct mains by accident.

I intend to simply use a 12V wall-wart, which the new bulb can be powered directly from.

The fairy lights that I'm using are powered by 2 CR2032 coin cell batteries (6v), so I'll still need to reduce the voltage to power them.

To do this I'm using a LM317 regulator, with 4.7k and 1.5k ohm resistors to create a 5.4v output voltage

I'm also including a small current-limiting diode on the output to the fairy lights for added protection.

Base

The base of the original lamp, aside from a weight, was hollow. I took the base and flattened it into a simple metal disc.  

My router was broken, so had to be
creative with a forstner drill
I took a piece of chestnut wood, and cut a new base from that, hollowing out the enough to recess the original base disc, and house the additional electronics.

 In the top another hole was drilled from the button

The button that the bottle cap will sit on
 




 



End Result