10 Second Disco Light Box - No PC Programming Needed
by NeilBuilds in Circuits > Assistive Tech
53 Views, 0 Favorites, 0 Comments
10 Second Disco Light Box - No PC Programming Needed

Firstly – thank you for your patience. There’s been some personal stuff happen in the background but that’s not what you’re here for.
Following on from the 10 second music box, I was wondering if it was possible to use a time delay relay rather than an Arduino controlling a relay to control a 10 second activation feature. This lowers the barrier to entry for people who think coding is scary and reduces the cost of entry still from £5 ($6) for a generic Arduino Nano to around £1.60 ($2) for the time delay relay.
As fortune would have it the local school for children with complex or additional needs asked me for an interactive 10 second disco light activate by everyone’s favourite 3.5mm jack switch.
The concept is to allow students to interact with their environment through the use of a standard 3.5mm button by activating a disco light. This enabled the higher functioning students to have an impact on their surroundings in a positive way. Through previous discussion with the teachers - 10 seconds was discussed as a reasonable length of time for the lights to activate.
As with previous projects I’ve tried to keep the tools required to a low number and the parts costs as low as practicable.
Downloads
Supplies




Parts
Plastic industrial box (121 x 87 x 192mm) - https://www.screwfix.com/p/schneider-electric-ip66-weatherproof-outdoor-enclosure-121-x-87-x-192mm/355hv - these are generic industrial electrical enclosures.
5V Power bank - Amazon link - chosen as these are on special offer, but any 5V USB powerbank will do.
HW-516 time delay relay - https://www.aliexpress.com/item/1005007549722717.html?spm=a2g0o.order_list.order_list_main.45.27991802mqJls1
Disco360 light – USB powered, I’m sure these are available globally through somewhere like Amazon like this one here https://www.currys.co.uk/products/red5-disco-ice-360-party-light-10273167.html
You can use an extra USB cable to power this but I trimmed off and used the original USB cable from the Disco 360 light.
Signal wire - as you see fit (I used multiple lengths about 10cm long here which seemed to fit in well) I've used white here but feel free to use whatever colour you prefer - here
Or
Male to female jumper wires - Bitsbox link - these are always useful when building something so you can test as you go.
1x 3.5mm mono port - Bitsbox link
Tools to build this:
Good soldering iron starter kit - available here
or a more advanced soldering station with holder that I'm using here
Lead free solder (smaller packs are available) here
Drill - here
3mm drill bit - here
6mm drill bit - here
Wire strippers (I use these as they take the work out of wire sizing) - here
Wire cutters - here
Hot glue gun - Amazon link
Flat head screw driver - hardware shop of choice
Pencil/ permanent marker - makers choice
The Amazon links which I have set here I receive a commission on here which I use to continue developing and making assistive technology items. Alternative shops for all of these parts/ tools do exist.
Prepare the Disco Light and Mount to Lid






I started by trimming the USB cable from the disco light and preparing the wires. Looking back I should have left more wire at both sides to give myself more room but this was fine.
I took the back off the disco light and used that as a template for the disco light location on the plastic enclosure lid marking holes for the mounting screws and for the trimmed power lead to go through.
Drill the screw holes with the 3mm drill bit and the main power lead hole with the 6mm drill bit.
At this point you can mount the disco light to the lid - I'll admit the lack of cable here did make this fun for me but with the screws mounting the disco light - that's what we needed.
The Rest of the Box







I then took the box base, drilled a 6mm hole in each side and used a countersink on the inside to ensure a clean fit for the 3.5mm jack.
I then checked the 3.5mm jack for the normally open contacts and soldered two breadboard wires to the jack. I did say I was keeping this cheap.
This was then mounted into the box with the use of the outside screw.
The USB lead is then connected so the socket is on the outside of the box and the wires pointing to the inside. Tie with a loose knot to create an anti-pull lock, leaving yourself enough cable inside to fit to the relay and enough cable outside to connect to to where the battery back will be. I secure this in place with a little hot glue - just to be sure.
The Fun Bit




At this point I connect the positive and negative wires of the disco light to the relay output.
Add a section of signal wire to the USB power lead and solder to ensure a good connection. This will create a bridge to power the relay control and the relay supply.
Connect the relay up as shown with the negative side of the USB power lead being in the same port on the relay as one of the 3.5mm jack leads. I've included two photos here to show the set up.
At this point - it's time to power up the relay and program it.
If this doesn't make any sense - here's a youtube video which explains it well and a website that gives a good overview.
Relay Programming

The board I got has reverse polarity protection which I felt was pretty cool for something so cheap and when you power the module down, it stores the settings.
There's lots of options but I'll keep this light and deal with the OP (on time) parameter.
Parameters
Parameter description: "OP" - On Power time, "CL" - off time, "LOP" - the number of cycles (1-999 times, "---" represents infinite loop - we won't be using these second two).
Timing range
0.1 seconds (min) to 999 minutes (max)
How to choose the time range?
After setting the mode selection screen parameter value by a short press of the "STOP" button, you can select the time range;
XXX. decimal point in the unit place, time range: 1 second to 999 seconds.
XX.X decimal point in decade place, Timing range: 0.1 seconds to 99.9 seconds
The parameters are independent of each other, but are shared by different Modes.
For example, in P1.1 mode, if you set the on-time "OP" to 5 seconds, then switch to P1.2 mode, it's "OP" will be 5 seconds too.
From the main interface (display 000), short press "SET" button will display "OP" ( "CL", "LOP") and the corresponding time XXX;
Some parameters only use "OP" (such as the mode P1.1, P1.2, P1.3), short press the "SET" key to display only the “OP” and the corresponding time;
Some models have parameters "OP", "CL", "LOP" (such as the mode P3.1, P3.2), short press "SET" button will display "OP" and the corresponding time, “CL” and the corresponding time, “LOP” and the corresponding number of times;
In the main interface by short press "SET" key to see information about the parameters of the current mode - which is handy.
So How do we set parameters?
Technically - you should read the instructions to determine the required operating mode - but we're here to play.
When the module is powered up, the display will show the current work mode (P1.1 default mode so lets use this). To enter the main interface; press "SET" button for 2 seconds and release to enter the mode selection interface; pick a mode by pressing the "UP", "DOWN" key to select the mode (P1.1 ~ P-4). I used P1.1 to keep things easy.
Select the mode (such as P1.1), short press the "SET" button, then the parameter to be set flashes ( "OP" on-time, "CL" off time, "LOP" cycles), by using the "UP", "DOWN" keys to adjust the parameter value. If you press and hold the "UP", "DOWN" keys you get a rapid increase or decrease, a short press of the "UP", "DOWN" keys allows more preciuse increase or decrease by one unit. Once you're happy, short press the "STOP" key to select the decimal point position, select the time range (0.1 seconds to 999 minutes) then short press the "SET" button to set the next parameters of the mode if you want to.
We want to set "OP" to 10.0 seconds, then move the decimal point to the second from right place so the digital display shows 10.0.
After the parameters are set, long press "SET" button for 2 seconds then release. The name of the current mode will flash once, and then return to the main screen. Great work!
Now lets check it to ensure it works (see the video) and yes - you'll need a 3.5mm jack button or to bridge out the 3.5mm jack contacts.
Great - lets glue the battery back to the side of the box, ensuring you've got plenty of USB cable to reach it and - congratulations. You've created a time delay disco light.
PS - On the main interface: If the relay does not work, the display will show "000", with a decimal point under relay state.
There are loads more modes and features available so feel free to have a play with them and have fun.