Computer controlled (compressed time cycle) layout lighting

Discussion in 'Other Electronic Interfaces' started by Timbersurf, Jul 18, 2018.

  1. Timbersurf

    Timbersurf

    Messages:
    720
    Likes Received:
    436
    Joined:
    Jun 20, 2018
    PC controlled (timed cycle) layout lighting

    Computer controlled (compressed time cycle) layout lighting = running a 24 hour cycle of on/off lighting control to simulate a "day" but over a shorter duration (i.e. 2 hours see's rotation through daylight to night to daylight again, then repeats)
    Some sophisticated layouts are run to a timetable, so its my intention to do similar, but to a compressed time. {Miniature wonderland run a light to dar to light cycle time of just 15 minutes}. This will include the layout functions (lights, motion action accessories, etc.) to be synchronised with the train timetable.
    It would be possible to do with electronics (4017's chained together) or with the likes of PIC chips or programmable IC's like Arduino, but my preference for ease, is a PC.
    Much investigation lead me to an inexpensive ready made solution LedWiz] (for pinball machines) that gives (PC) USB control of 32 channels. There are many 1,2,4,8 and 16 channel relay output cards available for PC control, but this only gives on/off control. The advantage of the pinball card is that not only do you get 32 outputs (for £30), but each one is completely variable in intensity (255 steps). This not only means complete control of timing, but also maximum final intensity and variable intensity on the fly (special effects). There are four banks of 8 outputs, each could have a different operating voltage as it switches the -VE (neg). If the supply is 5V, then no resistor is needed for LED or 6v Bulbs, or a higher voltage can be supplied (12v, 24v, etc.) but with an appropriate current limiting resistor.
    Various special features can be added programmatically, such as Sodium pre-ignition, Sodium starter fail, gas light flicker, TV multicolour flicker, belisha beacons, traffic lights, etc. The list is endless!
    There is also a 16 input/16 output card, so reactive elements could be introduced (buttons, red switches, block control, etc.)

    I am well on the way, having procured the LedWiz PCB's and some switches and connectors and box. My intent is to have a on/off/on switch per channel, giving permanently ON (test/manual), OFF, and ON (Auto controlled by PC). Housed in a small control panel box, the outputs will be connected to a 37 pin D Sub connector (detachable from layout for testing, moving, rework, etc)
    I have written the base code in Visual Basic in a spread sheet, but at a later point, once refined and beta tested, may migrate to an .exe file for distribution as a standalone.
    I will start adding further details to this thread, including pics and possibly a video!
     
    paul_l and Splitpin like this.
  2. Splitpin

    Splitpin Full Member

    Messages:
    72
    Likes Received:
    34
    Joined:
    Aug 28, 2017
    Hi TimberSurf , if I could have liked your post more than once I could. That PC board sounds fantastic.
    Can I ask though, are you planning on using a software eg JMRI / RR&Co TrainController / something else on your layout. If so, then timetabling and a fast clock are built in. Still need the 'train software' to LedWiz board communication which I don't have a clue about. However I'm really really interested in this, I went straight to the link you gave and would have ordered but wasn't sure about choosing what seemed to be a designated USB port for the board. Should I just look at my 'connected devices' list and pick a currently vacant USB number ?
     
  3. Timbersurf

    Timbersurf

    Messages:
    720
    Likes Received:
    436
    Joined:
    Jun 20, 2018
    Hi Splitpin, I don't intend using DCC for anything other than running trains. All else will be non DCC. The LEDWiz needs a special driver loading on the PC. This then effectively means you can "Print" to the board. (albeit in gobbly gook binary). I have written an excel spreadsheet that does the control and is therefore very open to manipulation, something not available in "off the shelf" packages that are not designed for running building lights! Just order USB01, if you need a second board you would order USB02 etc. The manufacturer has to "Address" the board when blowing in the software. If you had two boards with the same address, it would get confused. It is possible to have 64 boards on one USB port! You could order USB07 and USB28 if you liked!
     
  4. Timbersurf

    Timbersurf

    Messages:
    720
    Likes Received:
    436
    Joined:
    Jun 20, 2018
    Here is the front panel on the PC, its an excel spreadsheet. All controls are there, including three settable time on periods per channel
     
  5. Splitpin

    Splitpin Full Member

    Messages:
    72
    Likes Received:
    34
    Joined:
    Aug 28, 2017
    Ah gotcha. Thanks for that.
    I have experience of various MS Visual development environments …. what about the ActiveX object have you checked that out ?

    wow on the panel :) lol
     
  6. paul_l

    paul_l Staff Member Administrator

    Messages:
    9,867
    Likes Received:
    5,929
    Joined:
    Dec 5, 2015
    Personally, I think I would have gone down the JMRI route, and used arduino based accessory controllers (possibly with the output controlling a FET (with a 5V gate voltage) to operate switching devices with a higher current (LED RGB lighting strips), or even making an arduino operate the remote control of the LED RGB strip light controller. JMRI would then just activate the accessories as required, synced with the fast clock.

    Paul
     
  7. Timbersurf

    Timbersurf

    Messages:
    720
    Likes Received:
    436
    Joined:
    Jun 20, 2018
    I don't really want my layout to be run by a PC, but the cheapest off the shelf solution I could find at the time per PWM output was the LEDwiz. You may question why I ended up on a PC and excel, but it is just what I am used to and has served well as proof of concept. The intent was to migrate to pure VB (or some such software) and onto another platform (I was guessing at the time, either a phone app or a raspberry). Since then (over 2 years ago) I have got into Arduino's and this may well be final 'Supervisor' solution (TBA). I may yet develop the Arduino as a distributed control system, with one being supervisor (running the sequence and having the HMI) with a buss to child ones that drive multiple PWM and run sub programs (sodium flicker, bad starter, etc). My current workbench project is two high rise flats, with Arduino controlled floor control. This could be started and ended (9 till 5) from one output off the LEDWiz, giving 16 sub channels. But that's for another thread!
     
  8. Timbersurf

    Timbersurf

    Messages:
    720
    Likes Received:
    436
    Joined:
    Jun 20, 2018
    Below is a quick sketch, note the PSU I am using is 10A, so I will be fusing 4 circuits to something like (20ma x 30 leds = 600mA) 1 Amp per quarter of the board.
    Alternate channels used for clarity as an example


    Here is the LEDWiz mounted in a box, 32 wires to be soldered to a 50 way D Sub connector, power in in the middle, USB off the LEDWiz poking out of a hole.


    The 32 wires go from the LEDWiz to 32 switches (On-Off-Auto) to allow manual deselection or direct (On) or via the LEDWiz.


    And here is the front with as yet no labels, sitting in it's wooden cradle on the layout side

     

Share This Page