TP-Link Router Turned Into A DALI Automated Lighting Controller

dali-control-in-tplink-router

The members of Shackspace continue to put up impressive hacks based around the tiny TP-Link routers. This time around [Timm] has shoehorned a DALI controller inside the router case. This is a protocol we don’t remember hearing about before. The Digital Addressable Lighting Interface is a control network for commercial lighting. That way people responsible for taking care of large buildings can shut off all the lights at night (to name just one use). The new room at Shackspace has this style of controllers in its lights.

The two brown wires coming into the router make up the data bus for the DALI system. It connects to the add-on PCB which uses an Atmel AT90PWM316 microcontroller. The chip is specifically designed for DALI networks which made the rest of the project quite easy. It talks to the lights, the router talks to it, bob’s your uncle, and you’ve got network controlled lighting. Get this in a big enough building and you can play some Tetris.

In case you were wondering. Yes, this project has already been added to their TP-Link firmware generator.

20 thoughts on “TP-Link Router Turned Into A DALI Automated Lighting Controller

  1. I have just woken up and am eating breakfast. This project seems interesting and is somewhat close to what I’m working on.

    Interested, I looked at your schematics. I might need more coffee but my first impression is that the galvanic isolation achieved with optoisolators might not be that isolative at all. Seeing how the different grounds do indeed connect via resistors and that the DALI voltages are created non-isolatively. I took a look at uart2dali_mr3020_2.sch as it is newest of the lot.

    Galvanic isolation is something of an interest for me as my current big project, Ell-i system platform, uses Ethernet and PoE for communications and power. We are interested in interfacing other existing systems such as DALI and KNX.

    1. Hah, interestingly enough we’ve been tasked to create a DALI and DMX-enabled ballast for one of our clients yesterday, one of the prerequisites being a minimum of 2.5kV galvanic isolation between nodes

      1. We use a flyback switch mode psu for powering the Ell-duino node from PoE. This maintains isolation nicely. At some time we are going to do a DMX and a DALI interface (open hardware) and we are going to need some more flybacks per node so that the interface part has its own floating supply for the few components it needs.

        Also I noticed I cannot have more than one url for the comments so I chose the Ell-i one instead of Helsinki Hacklab.

      2. It’s a 16v data line though…seems not too hard to isolate such a thing one would think.
        Although since it must support various brightnesses I guess a simple solid state relay won’t do and you need something fancier. But still.

        1. DALI data lines are a two wire bus much like RS-485 or I2C or DMX. The isolation requirement stems from not wanting trouble when a DALI installation grows bigger than one fuse group. Also the comms-only nodes might be end user touchable so isolation is a safety issue as well. Ethernet by itself is isolated so this mod should not pose any real trouble even if it is not really isolated.

    2. Yes, you are right. The controller is not isolated. But this is the same interface which is shown in the datasheets. For prototyping I didn’t want to build my own bus interface with comparators.

      Typically an external power supply with 16V and 250mA is used. They are quite expensive. So I decided to build a (cheap) constant current driver on the pcb. I have a newer version with a constant current driver which can be switched off. So you can still use an isolated DALI controller with an external supply.

      1. Ell-i project will have a open hw open source implementation of a isolated flyback design for all to reap. I’m not sure when this will be available but we aim to provide ourselves isolated communications to many different networks.

        At the moment we like controlling the smpsu switch element directly from mcu without using dedicated silicon for that. The ARM Cortex M0 has plenty of oomph to do that, so we can cut cost this way.

        Our github is at http://github.com/Ell-i/ and we now have only the beginnings: a devboard implementing PoE with a Linear smpsu and STM32 Cortex M0 with Arduino Due compatible pin headers and Arduino IDE support.

        I’ll be happy to report at HaD when we have mcu controlling its own smpsu.

  2. Out of interest, how does it work hacking things then selling them on. As in, if I were to use one of these routers in a project I’m making to sell on, would it be legal? I would be buying the routers then just ripping them out the enclosure and using the PCBs

    1. I believe that would be perfectly legal. However, you should probably remove any logos or branding from the original equipment – or at least from pics advertising your project. You don’t want to accidentally suggest that you are selling a new model of TP-Link router or that TP-Link backs your project

  3. Can you please also explain did you buy DALI lighting modules for your hackerspace or you also made the lighting modules?

    We would like to also use this for our hackerspace, but DALI modules are quite expensive.

    If you bought them please share the source that you used, thanks!

  4. Looking for someone who can Dev a low cost DALI controller that can initiate emergency function and discharge tests and report with Dali led em drivers. Possibly use raspberry PI or similar as a Base unit.

Leave a Reply to FarkanoidCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.