Analogue lightsaber fx system

Thread Starter

Canobi

Joined Mar 4, 2015
29
Hi folks :)


A few years back, I started designing my own lightsaber fx system. However, despite the many versions i came up with, I'm more than a little Dysmumeric and while I can just muddle through enough to make electronics a hobby, it turns out I can't write code for toffee, despite my best efforts.

Having failed to find someone with enough knowlege or time to help in that area, I saw it as a challenge to see if I could design an analogue equivalent with the kinds of features one normally associates with uC control and so far it's looking like it could happen, with a maybe a little help from you guys in one or two areas.

At the moment I'm looking for a way to recreate the bright pulsating effect when two lightsaber blades are pressed against each other (known as "lock up" in the saber smithing community).

I looked at using a 555 array and other semiconductor shenanigans to produce the pulsing effect but eventually rejected them for various logistical reasons and it got sidelined until I read an article by evil mad scientist.

In the article, he provides a small schematic which shows how one can use a candle effect LED and transfer it's output characteristics to a high power LED using a transistor:

The artical itself
https://www.evilmadscientist.com/2011/does-this-led-sound-funny-to-you/

the schematic from the article:


It's worth noting that the transistor in the schematic has long been discontinued but I have found others that are a close match on the RS website.

I've designed the system to support 1w RGBW LEDs, the white LED being resurved for the lock up effect and "flash on clash" which is just a single bright flash whenever the blades connect momentarily.

What I'd like to do is integrate the above circuit to share control of the white LED with the flash control circuit via a mosfet gate but its my lack of understanding regarding transistors that brings me here.

The schematic below shows how I've arranged the circuits in qestion, just not sure if it will work as tended:
 

Thread Starter

Canobi

Joined Mar 4, 2015
29
Hi again folks :)

As I've posted a piece of the analogue fx system as part of a query, I may as well post the rest of it, though I have only just finished piecing it all together so some component values are still missing and some of those that are present may need to be changed.

It should be noted that the stars of the show are the two WT588D-16P audio playback modules by Waytronic. I realise that they sit quite far back in the schematic, so I'm jumping the gun a bit, but they play a major role, not least in synchronising the light and audio.

I had looked into using ones called DF players as they were recommended by many other saber tinkerers as they host a slot for a micro SD card that makes sound file changing a breeze but after more digging for info, I found out that support for them was very limited making it hard to get one running.

The WT588Ds on the other hand are very well supported and have more aces up their sleeve than a crooked gambler. This is reflected in the fact that there are a total of three individual sets of documents (including a user manual for the software used to change settings and install/replace audio files but more on that in a sec).

The modules also sport different memory classes, from 8Meg to 32Meg and here they bring out ace number one as all models have over 100 slots which in turn can hold over 200 files each. For ace number two, depending on the mode they are operating in, they can also be 28 voice polyphonic (ie, 28 play cycles can be triggered simultaneously).

This allows one to balance cost considerations with expected file sizes and usage very efficiently, though the downside with the 16 pin and 28 pin modules is that they require a programmer board, which come with a host of push buttons as well ad both forms of audio output for testing purposes (these are PWM for direct speaker driving giving a total of .5w into am 8 ohm speaker, and DAC for use with amplifiers). If cost is a consideration, there is also an ISP adaptor one can use to access the programming pins which a little cheaper than the main board:

Programmer/testing board


ISP programmer


While neither programmers are exactly a bank breaker, they are still a fair bit more expensive than a top spec playback module. However, I eventually picked up both as I know I'll be using them but it's worth considering getting the WT588D-U version if you'll only ever need one module as they sport the programmer onboard and they simply connect to a computer via micro USB, though they are a fair bit longer than its kin.

The software is free and it can be downloaded from the Waytronic website but to save the hastle of searching, I have placed a link to my dropbox to download a package containing all the relevant materials should anyone have need of it:

https://www.dropbox.com/s/w9y6fg7xb4p87zo/WT588D.rar?dl=0


Ace number three is the shear number of settings that change the way the module functions. These include but are not limited to, the modules operational modes (supporting two types of Uc control modes and a manual control mode) and an large selection of playback styles to choose from, which can be applied to each sound file individually for. but the fifth ace in these decks of cards is their ability to seamlessly loop audio files. This is crucial for the ubiquitous "humming" sound that the blade makes when the saber is on but held stationary. Any pauses between loop cycles will spoil the effect and I was actually quite surprised to learn that almost none of the alternative playback modules available can do this well, or supports this feature at all.

The modules for the system will be set to manual key mode. In this mode, a play cycle is started when one of the"key" pins is pulled to ground, of which there are four on the 16 pin modules. Due to this limitation, I opted to rope in a second module for more system flexibility but it's taken a lot of careful planning for the audio treatment and their subsequent playback styles as the entire system is dependent on me getting that part right to work properly.

Talking of which, I took advantage of a pin called the BUSY pin. This pin has been provided as a source or sink for a playback status LED and can be set to go low or high during a play cycle, so I will be setting the pin to go high in order to use it to drive the gates to the mosfets that control the blade LEDs (bar the white LED that is) as it will result in the synchronisation of light and sound fx.


At the head of the system is an analogue SP3T, which is used for changing between RGB LED dies. Manual SP3Ts are usually toggle or paddle type switches, which are just too big and bulky to fit into lightsaber hilts, though it did occure to me that I could use three small latching pushbuttons, which would allow for colour mixing as well but high power LEDs are hungry beasts and using more than one at a time will drain power and heat things up quite quickly, what with it eventually being confined within the tight space of a hilt, so for this system I will be sticking to unmixed colours and the white at any one time in order gain longer battery life and cooler running temps.

The analogue switch on the other hand requires a voltage to run and operates by applying a logic level voltage to the devices inputs. In this case, there are two inputs and the logic for switching channels looks like this:
COM to NO1= In1 Hi - In2 Lo
COM to NO2= In1 Hi - In2 Hi
COM to NO3= In1 Lo - In2 Hi.

However, all the device's channels are NO (Normally Open) by default, therefore, a Lo/Lo situation would occur when both latching buttons are open circuit and this is something I wanted to prevent from happening as the function of activating/deactivating the blade and associated sound fx has been designated to another part of the system, so this little sidedoor needed to be closed.

Took quite awhile for me to figure it out but the solution came to me the other night and that was to use a trio of mosfets (a PNP and two NPN) placed between the latching pushbuttons and the switch's inputs, which serves the function of changing the way the pushbuttons operate the switch's input logic. With this setup, button1 controls input1 and input2, with button2 relegated to controlling input1 only and I've arranged the circuit so that by default, input1 is high when both buttons are open circuit. The culmination being that the arrangement allows for changing between all three NO channels without the analogue switch ever seeing a Lo - Lo signal at both inputs at the same time.


Prior to working that one out, I also looking for a way to create a pseudo "profile" that would connect and isolate the pushbuttons from the voltage rail used for the input logic. The idea being that it would be a preventative to accidental changes while dueling. After searching around the interwebs for some ideas, I settled on using a NAND gate soft latch due to the circuits simplicity and minimum supportive component count. As reference, I have posted a pic of the original circuit I followed below:



I then arranged the circuit so that the soft latch operates the gate to a mosfet which controls the rail used to supply the logic via the push buttons. The soft latch input RC network was then calculated such that the button used to activate the soft latch has to be held low for three seconds before the circuit latches and turns the mosfet on (which I believe is referred to as "delay before make") but here I assume that it will take three seconds to latch the circuit again.

At some point I will make a little proto PCB of this particular circuit for testing purposes. If it works I will be looking at expanding on it so I can use momentary buttons to operate the SP3T instead of latching type buttons as momentary are available as surface mount, which come in some very small sizes, allowing for much more cunning and efficient use of limited hilt space.

The next part of the system brings me to the circuit in my first post. The lower half of which I didn't explain though. So this one utilises a 555 timer used in one shot mode. The output is tied to the gate of the mosfet controlling the white LED and effectively recreates the bright flash seen when two lightsaber blades momentarily connect with each other.

I made use of an impact sensor switch (or spring return switch) to pull the 555's trigger pin to ground. The downside to the spring variety is that they are somewhat prone to multiple contact events due to the nature of the spring inside the sensor, which have a habit of flailing around like an epileptic slinky causing multiple triggering events, so to combat the erratic behaviour, I placed a debounce circuit between the switch and the 555's trigger pin.

The debounce circuit comprises an RCR network and works such that when the switch pulls the capacitor to ground, it discharges and no further contact events can pass a signal until the capacitor has fully recharged again.

The RC network on the 555s output pin has been calculated to produce a flash time of .3 seconds with the trigger debounce set to .33, which seems about right to me but it can easily be adjusted by changing the value of R (with C@1uf, R=100k=.1 second).

The circuit above the 555 is in charge of emulating the pulsating white light effect that's produced when two lightsaber blades are locked together, which is explained in my first post, so I will skip that part of the system, though I have since changed the PNP transistor in my schematic to one that is a closer match to the discontinued transistor in EvilMadScintist's circuit diagram.

With LED selection and fx sorted, I roped in an analogue SPST switch to "activate" and "deactivate" the lightsaber. The switch has a normally closed position by default, so I've designated that position to blade off as it will keep the key pin to the associated audio clip to ground. The clip will be set to play once with no repeat, which will act as an interrupt that prevents the pin assigned to the hum audio from restarting a loop cycle until the switch receives a high signal on the select pin and changes to the normally open position to "activate" the lightsaber again.

The switch only operates power to the LEDs by way of triggering the relevant audio fx, it doesn't disconnect power to the system as a whole, this is because everything needs to be "live" or it would be hindered by device wake up and shutdown times. For that, ports for a battery disconnect switch have been placed in series with the battery and power regulation input terminals..

The next part of the system absorbed much of my focus and time as it's a bit on the experimental side bit I thought it was worth a shotp. I need a way to trigger the sound fx associated with the blade being swung about and the sensor normally associated with that that is an accelerometer via UV but here I'm attempting to use an analogue variant as a standalone device. My reasoning is that it outputs ratiometric voltages relative to the forces being measured and in theory, I should be able to use the generated voltages to operate mosfet gates as long as the output voltage crosses the mosfet's minimum gate threshold voltage.

The accelerometers frequency is set by the capacitors on the output pins but not entirely sure what to set it at so calculated for mid frequency for now and added pullup resistors on each axis to aid better gate operation as the accelerometer's max output voltage for each axis as around 2.8v, so for now I'm using mosfets with a very low gate threshold of 1v or less in order for the circuit to at least work as intended, though I haven't tried it in real life yet.
Power conditioning for the system is via two fixed regulators, the first is a 1.3A 3v3 LM1117, which provides for most of the iCs, the modules flash memory and the LEDs. It sounds a lot but even with one colour and the white LED on constantly, there is plenty of headroom as the total consumption requirements are only half the regulator's max capacity.

There is also a .6A 5v NCP663 which provides power to both of the modules Vcc pins and a 3w mono amp situated at the back of the system (more on that in a bit).

I ended up modifying the 5v regulator circuit with an outboard pass transistor as I'd missed a detail in the audio amps datasheet which states that the max current requirement can reach upto 1A and the regulator is only rated for .6A but having run out a board real estate to put a second SOT-223 within the size constraints I've set, I went with a transistor rated for 1.5A to give it plenty of overhead as it will only be providing around 500mA at most.

With the bypass transistor set up as it is, currents below 600mA will flow through the regulator. Above 600mA the input current flowing through the 1 ohm resistor develops a voltage. As this voltage increases above 0.6V (600mA through 1 ohm), the transistor starts to conduct, supplying the extra current to the load. The 10 ohm resistor is there to simply limit excessive base current and the 1 ohm will be rated for .5w~1w depending on demand.


And that brings us to the back end of the system, which is the 3w amp I mentioned above and the only part I still haven't been able to work out. I'm wanting to use the modules DAC outputs but I'm having a hard time figuring out how to use the provided data to come up with the figures needed for summed single ended inputs that the amp is capable of accommodating.


Below is a jpg of my full schematic, I apologise for its lack of detail but all the notation became illegible at this size so I've posted link below to download a high res PDF for better scrutiny and a link to the datasheet for the amplifier.



Schematic PDF:
https://www.dropbox.com/s/aossfx6z4a8fzhs/Analogue Lightsaber FX Schematic.pdf?dl=0

Audio amp datasheet:
https://www.dropbox.com/s/d2wgsyqidmhhfw1/TPA2011D1 3.2-W Mono Filter-Free Class-D Audio.pdf?dl=0
 
Last edited:
Top