Programmable Sequential Switch

Customising, building or repairing your own gear? Need help with acoustic treatment or soundproofing? Ask away…

Programmable Sequential Switch

Post by Folderol »

Well, it took a while to get started on this (over 2 years) but here we go.

First the specification

The unit will have 8 mains channels and two isolated low voltage DC ones, both with 9V and 12V.

All the mains channels will be independently fused at 3.15A. The DC ones will have built-in S/C protection.

The timing between switches will be programmable from the computer it's attached to via USB.

The unit will also use the USB link to tell the computer to shutdown.

Start/Stop will be with a single button, and Stop will be a true power off.

Individual channels can be disabled.

There will be a 'traffic light' indication on individual channels.
Green - On.
Yellow - Triggered but disabled.
Red - On, but not drawing power (could be simply unplugged).

Initial work.
Using the parts I already had I've almost competed the front panel. There are some components missing because I filched them for other projects. I decided to hand write the legends - embracing the imperfections - as someone on here said :)

The back panel is complete - again with hand written legends. To protect all of these, after the ink was completely dry, I coated the panels with clear varnish.

I've made a start on the chassis, but am currently waiting for parts.

I'll be putting some pictures up soon-ish, and also the schematics as they become finalised. So that's about it so far.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Drew Stephenson »

And what will it do? Other than switch in a programmable sequence...
User avatar
Drew Stephenson
Apprentice Guru
Posts: 27707 Joined: Sun Jul 05, 2015 12:00 am Location: York
(The forumuser formerly known as Blinddrew)
Ignore the post count, I have no idea what I'm doing...
https://drewstephenson.bandcamp.com/

Re: Programmable Sequential Switch

Post by Folderol »

Hmmm. I though everyone knew by now. I've surely bor^H^H^told enough people :lol:
NE way...
At the press of a button my entire music setup will be started in the correct sequence, and with the best timing for a clean start.

In order, that will be:
Computer monitor
Computer
Audio interface
Hardware MIDI controller
(longest delay here)
Amplifier
Sound canvas (9V)
SY35 (12V)

That will leave three switched mains outputs spare. Were I still using the QS300, it would only have been two.

Similarly, pressing the same button will perform a manged shutdown, first telling the computer to do so, and making sure it will have had plenty of time before its power is removed.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Funkyflash5 »

I'll look forward to more detail on this! I've got parts laying around with similar intentions, and seeing how things work for you might just get me moving on it. Or it'll still be another 2 years but either way it'll be good to see someone do it!
Funkyflash5
Regular
Posts: 215 Joined: Thu Apr 26, 2018 12:43 am Location: Wisconsin, USA

Re: Programmable Sequential Switch

Post by ef37a »

ef37a
Jedi Poster
Posts: 17905 Joined: Mon May 29, 2006 12:00 am Location: northampton uk

Re: Programmable Sequential Switch

Post by Kwackman »

ef37a wrote: Tue Dec 28, 2021 2:35 pm Err?

https://www.electricalworld.com/en/Zexu ... -3203.aspx

No?

Dave.

Will's is sequential, with some low voltage outputs too..
User avatar
Kwackman
Frequent Poster
Posts: 3457 Joined: Thu Nov 07, 2002 12:00 am Location: Belfast
Cubase, guitars.

Re: Programmable Sequential Switch

Post by ef37a »

Kwackman wrote: Tue Dec 28, 2021 2:49 pm
ef37a wrote: Tue Dec 28, 2021 2:35 pm Err?

https://www.electricalworld.com/en/Zexu ... -3203.aspx

No?

Dave.

Will's is sequential, with some low voltage outputs too..

So's that if you do one switch after t'other! Low volts? Wall rats.

Dave
ef37a
Jedi Poster
Posts: 17905 Joined: Mon May 29, 2006 12:00 am Location: northampton uk

Re: Programmable Sequential Switch

Post by Folderol »

I think you are completely missing the point Dave!

I don't want to go round switching on a bunch of kit (in the right order and timing), then do the same again in reverse (remembering to shutdown the computer first).

With this, I will press one button, have a slurp from my teacup, scratch my head, then PLAY. When I'm done I'll hit the same button again and walk away.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by ef37a »

Folderol wrote: Tue Dec 28, 2021 5:04 pm I think you are completely missing the point Dave!

I don't want to go round switching on a bunch of kit (in the right order and timing), then do the same again in reverse (remembering to shutdown the computer first).

With this, I will press one button, have a slurp from my teacup, scratch my head, then PLAY. When I'm done I'll hit the same button again and walk away.

I KNOW Will ! Just winding you up. I expected you to tell me to F O!
ef37a
Jedi Poster
Posts: 17905 Joined: Mon May 29, 2006 12:00 am Location: northampton uk

Re: Programmable Sequential Switch

Post by Music Wolf »

With all of these new universities* spewing out graduates with degrees in Music Technology each year wouldn’t it be easier to just offer one of them an internship and give them the opportunity of gaining some valuable experience to add to their cv? It’s not as though you’d have to pay them.

*i.e. West Riding Metropolitan University, formerly Keighley Leisure Centre.
User avatar
Music Wolf
Frequent Poster
Posts: 2842 Joined: Fri Feb 17, 2006 12:00 am Location: Exiled to St Helens

Re: Programmable Sequential Switch

Post by Mike Stranks »

Music Wolf wrote: Tue Dec 28, 2021 9:15 pm With all of these new universities* spewing out graduates with degrees in Music Technology each year wouldn’t it be easier to just offer one of them an internship and give them the opportunity of gaining some valuable experience to add to their cv? It’s not as though you’d have to pay them.

*i.e. West Riding Metropolitan University, formerly Keighley Leisure Centre.

I know you jest, but... these days many aspiring 'recordists' have the haziest and vaguest of notions of the difference between an amp and a volt, never mind their relationship to the watt... they pop up here fairly regularly. I wouldn't want any of these anywhere near any sort of electricals I was involved in - however basic. :lol:
Mike Stranks
Jedi Poster
Posts: 10585 Joined: Fri Jan 03, 2003 12:00 am

Re: Programmable Sequential Switch

Post by Folderol »

Wow! All this interest and I've not got past the preamble yet :lol:
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Folderol »

Just in case you think I'd gone away :tongue:
I've got a couple of pictures for you to mull over.
The first is a combined image of the front panel ( outside and inside).
Image
You'll notice that only three channels have pairs of diodes - I'm still waiting for supplies to arrive. All the rest is from existing stock - I'm slowly running out of spare bits.

Then there's the back panel. This is almost entirely new parts bought just before Christmas.
Image

I'm annoyed that the mains in socket ended up slightly skewed, but in my defense all this work is done by hand. The only machine tool I have is a small (cheap) pillar drill.

To the left you can see a slightly unusual plug/socket assembly. The two plugs sit comfortably side by side, and are screw terminal, so quite independent (for the two DC operated units). These have different voltages and polarity, but the supplies are fully isolated and wiring is such that they can be placed in either position.

Below that (inside view) is the Arduino on it's mounting bracket. The programming for that is nearly complete.

You'll notice that all the fuse holders have a dollop of epoxy. When I ordered them I hadn't noticed they were push-fit ones. I try to avoid these as the hole sizes are really critical, and in this case turned out to be between the two drill sizes I had :(

I'm still working on the schematics as well as the rest of the build, so I'll present them as they are completed... ish :P
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Wonks »

I don’t really like the use of the input socket mounting screw as the chassis earth screw. It’s always best to use a dedicated ground screw/bolt.
User avatar
Wonks
Jedi Poster
Posts: 17931 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Programmable Sequential Switch

Post by Folderol »

I quite agree.
Once the rest is wired in there will be another three points around the main chassis. Then the only time this could be a risk is if the back is off and this screw is undone and there is a live to back panel short.

Oh, and those three will be on a continuous cable i.e. stripped and folded, not cut, so all three would have to be undone for the rest of the metalwork to be at risk.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Eddy Deegan »

I can't comment on the electrical aspects but the workmanship looks very tidy there Will and I do appreciate a bit of neat wiring :)
User avatar
Eddy Deegan
Moderator
Posts: 9553 Joined: Wed Sep 01, 2004 12:00 am Location: Brighton & Hove, UK
Some of my works | The SOS Forum Album projects | My Jamuary 2025 works

Re: Programmable Sequential Switch

Post by Wonks »

Folderol wrote: Sun Jan 02, 2022 2:15 pm I quite agree.
Once the rest is wired in there will be another three points around the main chassis. Then the only time this could be a risk is if the back is off and this screw is undone and there is a live to back panel short.

Oh, and those three will be on a continuous cable i.e. stripped and folded, not cut, so all three would have to be undone for the rest of the metalwork to be at risk.

All fine. I was sure you had it all in hand. Just wanted to mention it in case someone only read part of the build and went and did the same but without the extra safety steps.
User avatar
Wonks
Jedi Poster
Posts: 17931 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Programmable Sequential Switch

Post by Folderol »

The main control system is now done and mostly setup and tested. The Mains outputs are fully tested and work very well. For each channel, with no load or with a load of less that 0.5W the red LED comes on with a slow transition to the green one between 0.5W and 1W load. I've also tested emulating mains filters, and that shows only the red LED. I haven't fully tested the DC outputs, and it's possible I may need to make adjustments.

The schematic for these is here:
www.musically.me.uk/Switcher/Controls-Logic.pdf

Looking at one of the mains channels (left hand side):
With Sx1 open, a 5V signal from the Arduino lights LEDx3. However, close the switch and the Qx1 transistor turns on, and with a b-e voltage of only 0.6V starves the LED of power. This in turn drives RLx1 and (if there is no load) the diode chain along with LEDx2. The reason for the two diodes is so that if there is power drawn ICx1 turns on, and we want to make sure the voltage across this and LEDx1 is low enough to rob the red one of power.

The upper (mains) section uses BRx1 and MRx1 simply to provide a fairly stable AC voltage drop of between 1.8V and 2.5V when power is drawn. Rx4 acts to drop this much lower for leakage currents. The Optocoupler (ICx1) requires 1.3V to start conducting, with Rx3 limiting its current to a safe level. Cx1 provides a degree of spike and RF suppression. This system is much simpler (and cheaper) than using the usual current transformers or hall-effect devices and their associated electronics.
Purists would want the fuse on the input side, but it's more convenient where it is, and protects the whole of the switcher from a faulty external load.

DC channels (right hand side):
The initial control circuit is identical to the mains ones, so uses the same legends. For the upper part we use a simple transistor as the switch with MRx2 and MRx3 providing the current sensitive voltage drop, with Rx6 controlling the no-load point. We have a different problem here, in that the DC-DC converter will draw about 100mA when there is no load attached, so I might have to make adjustments to Rx6 to find the sweet spot. The current sense has to be this side, otherwise the output voltage would vary with loading, whereas the DC-DC converter can handle a wide range of input voltage.
No fuses are needed on the outputs, as both the converter and the 9V regulator are current limited at 1A. Cx2 and Rx8 are static and RF suppression.

While testing all the mains channels I had a fault on just one. This was not on the mains side, but the control itself. Neither red nor green LED would come on - yet early tests had shown no problems. After much head-scratching I discovered there was a dead short between the positive side of the green LED and the front panel - which now it was fitted was fixed at 0V, so there was an uncontrolled path between +12V, LEDx2, Dx1, Dx2, LEDx1, 0V. This took out everything except Dx2 :(

The way these LEDs are fitted in the panel is a method I've used without any problems countless times - until now. They are simply pushed into a hole exactly the right size, with a dab of glue. A close examination revealed that this LED was slightly malformed, and the positive leg was exposed, so was touching the panel. This didn't show up when testing the panel by itself as it wasn't connected to anything.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Wonks »

Can I assume that Sx1 is one of the mini-toggle switches on the front panel, and allows you to keep or turn a channel off manually?

If so, did you think about making this a manual on/manual off/auto switch? If your Arduino fails, your power stays off with no means of turning it back on short of manually plugging the outlets into a suitable mains strip and the DC supplies back to wall warts.
User avatar
Wonks
Jedi Poster
Posts: 17931 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Programmable Sequential Switch

Post by Folderol »

That's a good point Dave (although I've yet to have an Arduino fail that wasn't externally killed).
However, the simplest way would be to change the switches to three position ones. In the 'manual' position it would directly short the transistor collector to ground. This would be quite a lot of messing about with existing wiring. It would also incur an extra £20 or so, and leave me with 10 'spare' switches.

There is an alternative which I could add without any mods to the existing work as a retro-fit. That would involve 20 diodes (less than £1 in total) and a spare ordinary toggle (that I already have) as a common bypass switch. That also has the advantage of simply adding the diodes to the next order I make, so no minimum charge issue. I'd be inclined to put this switch on the back of the unit alongside the USB socket.

Therefore as an honorable mention I've decided to go with this:
www.musically.me.uk/Switcher/Wonks-Mod.pdf
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Wonks »

Why thank you, kind sir!
User avatar
Wonks
Jedi Poster
Posts: 17931 Joined: Thu May 29, 2003 12:00 am Location: Reading, UK
Reliably fallible.

Re: Programmable Sequential Switch

Post by Folderol »

Just a small update.
Failed components now changed and using a faked Arduino enable signal all channels responding as expected with no load, 40W and 100W incandescent lamps.
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Folderol »

Coming in thick and fast now :)

The 'Programmable' bit :)

The computer has a background task checking for messages from the Arduino every 100mS. If it can't see the Arduino that task exits, so to change the Arduino settings the USB cable is unplugged, and after a few seconds plugged in again. In this particular case, once settings have been changed, the computer must either be rebooted or shut down in the normal way before turning off the switcher.

With the computer not reading the Arduino in the background all the delay timings for individual channels can be set using any serial comms program on the computer. These settings will be stored in the Arduino.

The timings are completely independent of each other, and for switching on are relative to the time the switcher was started. Timings are in milliseconds, starting from 10 and in 10mS steps up to 30000 (30 seconds). Similarly the timings for switching off are relative the moment the start-stop button is pressed. To prevent false triggering this button is only recognised at the point where all channels have been set to 'on' (regardless off the local enable switches).

At the moment the switch off begins, the computer is sent a command to shut itself down, and its off time should be long enough to ensure this has happened before it is disconnected. The switcher disconnects itself from the mains only when all channels have been switched off. Incidentally, although the outputs are fused at 3.15 amps, the relay contacts are rated at 10 amps.

Here are the available commands:

?, help, info - show available commands
list - show current settings
set defaults - settings to default values


These first three commands are obvious.

list

gives:

Chan 1 on 10 off 1100
Chan 2 on 20 off 1050
Chan 3 on 60 off 1010
Chan 4 on 3000 off 600
Chan 5 on 3020 off 500
Chan 6 on 3040 off 400
Chan 7 on 80 off 150
Chan 8 on 4000 off 200
Chan 9 on 8000 off 100
Chan 10 on 9000 off 10


Notice how channel 7 is timed completely out of sequence for both on and off times.
For actually setting the timings:

set <n1> on <n2> - set chan n1 delay on time to time n2
(optional extension) off <n3> - delay off time to time n3
set <n1> off <n2> - set chan n1 delay off time to time n2


As you can see, 'on' and 'off' commands can be used separately if only wanting to set one or the other.

set 3 on 50 off 1000

gives:

Chan 3 on 50
off 1000
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!

Re: Programmable Sequential Switch

Post by Folderol »

I finally got round to testing the controls logic for the DC channels. It works but nowhere near well enough. The problem being trying to compensate for the current drawn by the DC-DC converters. This is high enough to make actual moderate current demand 'invisible'. So, back to the drawing board. The sensing either had to be far more complex, or had to be on the output side of the converters.

I double-checked the converters spec. and was pleasantly surprised the output voltage could be adjusted upwards to more than 13V, This opened up possibilities.

I decided I could accept a small amount of voltage variation, so plotted one of the 1A rectifiers I used in the original design. This turned out to be way too high, from about 0.5V per device at 1mA to 1.5V at 1A. However, I then thought about using a 3A rectifier - the same as the ones used in the AC channels. This was much better 0.52V @ 1mA, 0.72V @ 1A.

So, with the converter set to 12.62V I end up with an output range of 11.9 to 12.1. I'm quite happy with that. Also, apart from a current limiting resistor (Rx6) there is no fiddling about with the transistor. However in order to maintain isolation, this now has to go through an optocoupler in a similar way to the AC channels - I don't currently have any DC ones, but temporarily 'borrowed' one of the AC ones to test, and that worked fine.

Final testing of the circuit resulted in a minimum load of about 20mA to reliably indicate that something was connected, below that the LED output was very weak and went off completely at about 10mA. I'm quite happy with that too!

Obligatory schematic:
www.musically.me.uk/Switcher/Controls-Logic-Update.pdf
User avatar
Folderol
Jedi Poster
Posts: 19728 Joined: Sat Nov 15, 2008 12:00 am Location: The Mudway Towns, UK
Yes. I am that Linux nut {apparently now an 'elderly'}
Onwards and... err... sideways!
Post Reply