landscape light timer with ATX power supply

Posted on
  • This project is to build a "modern" landscape light timer from an ATX power supply.

    The purpose/features that make this "better" than common setup using a wall timer are:

    1. Easier ownership - user never has to change the timer to a new time between seasons.
    2. Efficient - power for ESP8266 chip is less than that consumed by mechanical timer.
    3. Cost effective - ATX power supplies are readily available, and effecient ones are far more inexpensive than professional 12v lighting equipment power supplies.
    4. Unique - features ability to turn on/off from webpage (IOT friendly). you can even expose port 80 to internet to control from internet (how many times have you wanted to run your landscape lights from other location (cough, cough)? )
    5. Fun - for those like me, ability to write code to solve a problem is fun.... (answering critics who say too complex).
    6. Flexible - ESP Web IDE is still accessible when deployed, so new code can be added easily.

    Software design:
    The application is written to pull sunset info from wunderground for my location. It then determines how long until sunset, and sleeps. It then runs for predetermined number of hours, turns off, and repeats again the following day.
    A webserver is also run on port 80 that allows review of system status, turning on the lights, etc.
    The latest version of the software can be found at­ster/espurino/landscape.js

    Hardware design:
    Simple. The ESP8266 is running off of the 5V standby line (via buck converter down to 3.3). The "green" signal line, on the ATX, is pulled to ground via "D4" digital line on the ESP8266, across a 10k resistor to turn on the ATX supply.

    Pardon the "in progress" look. Still doing testing.

  • Wow, that's very cool. So do you have to turn the ATX power supply on before turning on WiFi, or does it provide enough standby power that you can connect to the internet even without turning the main part of it on?

  • 5v standby power is sufficient to run the ESP8266 via buck converter.

  • New code updated­ster/espurino/landscape.js

    Code for sleeping until the sunset, based upon the wunderground API:

          if(nHoursTilSunset > 0)
                //add 15 minutes from sunset
                var nMinutesTilSS = weather.moon_phase.sunset.minute - weather.moon_phase.current_time.minute + 15;
                var nSleepTime = (nHoursTilSunset*nMilisPerHour) + (nMinutesTilSS*60000);
                setMode("sleeping until sunset", "Turn on lights", nMilisForLights);
                setTimeout(turnOnLights, nSleepTime);
  • Code is updated.

  • Nice, thanks!

  • I've been happily building these, but running on Sonoff now. I really like the convenience of having some house lights that follow the sunset. Probably over-engineered, but that is where the fun comes in!

    Let me know if you'd like to buy one, $10 plus shipping.

    1 Attachment

    • IMG_20180202_165914.jpg
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

landscape light timer with ATX power supply

Posted by Avatar for Will @Will