MMM sensor+WS2812b and CONFIG RESET button



  • This app was made to improveour magicmirrors.

    it allows you

    • to control LED strip by sensor and also
    • with a hardware button connected to Raspberry you can rewrite your config file (set to default values). The operation will be confirmed by three lights in red color.
      here is short video
      Raspberry

    Installation

    1. Download and install the latest ws2812b library to your Raspberry:
    • sudo pip install rpi-ws281x
    1. Clone the repository : git clone https://github.com/sergge1/MMM-senorled
    2. Enter the repository: cd MMM-senorled/
    3. Edit parameters in configuration section of the *.py file: numbers of LED and GPIO pins
      5 Run the app with: sudo python sensorbtnled.py

    Hardware used:

    LED strip WS2812b https://www.aliexpress.com/item/32820628563.html

    Buttons https://www.aliexpress.com/item/33060639491.html

    Movement sensor RCWL-0516 https://www.aliexpress.com/item/32816228153.html

    Option Description
    SHUTOFF_DELAY Delay in seconds for sensor state change, e,g, how long the LED will light after no movement detected. The default value is 5.
    PIR_PIN GPIO pin number to which the sensor is connected. The default value is 11.
    LED_COUNT Number of LEDs connected to the strip. The default value is 160.
    LED_PIN GPIO pin number to which the LED data line is connected. The default value is 21
    LED_BRIGHTNESS Britness of LED lights. 0 is no light, 255 is the maximum brightness. The default value is 255.
    copy [] set of files which should be rewritten. The default value is ['/home/pi/MagicMirror/config/config.js.sample', '/home/pi/MagicMirror/config/config.js.sample'].
    writePin GPIO pin to which hardware button is conected (Other button pin is connected to any GND. The default value is 3.

    and here is description and GIT

    Any ideas and comments are appreciated.
    As well as your direct pull requests to the project on the github page.