Code Monkey home page Code Monkey logo

pc_light_controler's Introduction

Aims :

  • control RGB lights from my computer case (rgb lights are basically ws2812b on 5v led strips)
  • trigger animation from hdd led activity or audio output
  • remember my settings :
    • which animation to trigger at start,
    • on external trigger
    • animation speed
    • trigger level (for audio)
    • brightness
  • power on / power off my PC (since wake on lan doesn't work on my MB)

Needed components :

  • 1x ESP8266 (in my case : lolin v3)
  • 1x PCB (schema on kicad directory)
  • 6x 470ohms resistors
  • 3x DIP-4 817C Optocouplers
  • 2x 4 pins connectors (1 pin is to be removed)
  • 6x 2 pins connectors
  • 1x jack 3.5 connector (audio trigger IN)

Needed librairies :

  • ESP8266WiFi
  • ESP8266WebServer
  • WS2812FX (code based on "esp8266_webinterface" example files from that library)
  • EEPROM

Control URLs (GET) :

    http://<@IP of ESP>/set?<command1>&<command2>&<command3>...
commands can be :
  • power_bton=1 : trigger power button for 600ms (power on / off / sleep computer)
  • power_bton=9 : trigger power button for 32s (force power off computer)
  • on : starts animation
  • off : power off leds
  • reset : restarts ESP
  • trig_mode=0 : trigger mode disabled
  • trig_mode=1 : HDD led triggers animation
  • trig_mode=2 : audio level triggers animation (default)
  • trig=1 : triggers the "random fireworks" animation
  • trig : triggers the current animation
  • m=<0-56/59> : switch to animation (see http://<IP of ESP>/ for numbers)
  • b=<0-255> : sets brightness
  • s=<number> : sets animation speed
  • c=<000000-ffffff> : sets color
  • a=+ : autocycle = on
  • a=- : autocycle = off

TODO :

  • edit the 4 lines (50+51, 70+71) with your values :
    • #define WIFI_SSID "YOUR SSID" // WiFi network
    • #define WIFI_PASSWORD "YOUR WIFI PASSWORD" // WiFi network password

    • #define LED_COUNT 60 // number of leds of your strip N°1
    • #define LED_COUNT2 80 // number of leds of your strip N°2

  • Disable MQTT support if you don't want it (comment line 23) OR Update MQTT Settings (broker, port, topics from line 24 to 27)
  • /!\ by default, when your computer is not ON (power led = off), no animation is shown (except some trigger by jack or hdd led if configured so),
  • So if you don't see any led animation, check that power led pin is connected and on the right way (check polarity).
    To disable this behaviour, comment lines from 276 to 294
  • print your case (to avoid electrical shorts ^^), 1 available here : https://www.thingiverse.com/thing:4238962

pc_light_controler's People

Contributors

rayn2k18 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.