• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

LED Backlight for mirror - PIR to control them

Scheduled Pinned Locked Moved General Discussion
17 Posts 6 Posters 11.6k Views 6 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    Kimzer
    last edited by Aug 14, 2017, 1:46 PM

    Hey,

    I am planning on buying some led strips to have as backlight on my mirror.
    I do not want them to be on all the time, i was hoping there was a way for me to power them from the raspberry pi and have the pir sensor wich now controlls wether the screen is on or off to also turn on/off the LED’s at the same time.

    Is it doable? Would there be enough power in the PI to make it all work reliably?

    If so, can i use any kind of led strip? Is there a module existing for this already?

    1 Reply Last reply Reply Quote 0
    • M Offline
      Mirrorolentia
      last edited by Aug 14, 2017, 5:37 PM

      Hello there,
      I too want to try out this project. I have a WS2812B (60 leds/meter) that I have used for creating a Hyperion configuration. I am planning to use the same. You will probably have to use an external power supply. Seems like a 5 meter strip of 60leds/meter will need ~10-15 Amp current at 5 Volts which obviously Pi cannot sustain. Also I found using an Arduino provides more control than the Pi but that is me. Will try to get something started in a week’s time and update on the progress.
      Please do let me know if you too have started on something.

      1 Reply Last reply Reply Quote 0
      • P Offline
        pjkoeleman
        last edited by pjkoeleman Aug 14, 2017, 8:33 PM Aug 14, 2017, 8:32 PM

        @Mirrorolentia said in LED Backlight for mirror - PIR to control them:

        Please do let me know if you too have started on something.

        I’am working on a Pi-hat (plug on to the GPIO connector) witch can control an RGB-LED strip.
        For the software I want to use a PIR and the clock for switching On/Off. With PWM (Puls Wide Modulation) regulating the brightness. Color changing will be random, but there will be a fixed color in a white color, around 3000 K (warm-white).

        It will take some time to build/write the software, because I’am not a software guru.

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mirrorolentia
          last edited by Aug 20, 2017, 7:05 PM

          So finally have been able to integrate the led lights :) Got the code working just now. However, will need sometime to make a proper module out of it. Tried out with johnnyfive and node-pixel with some luck…but it was hyperion/boblight that did the magic for me.
          Of course, the trigger comes from Alexa/Echo rather than a PIR sensor.

          1 Reply Last reply Reply Quote 0
          • O Offline
            orayoflighto Project Sponsor
            last edited by Aug 21, 2017, 12:19 AM

            I did this.

            alt text

            I used the MMM-PIR-Sensor module and changed the following in node_helper.js:

            From:

                    if (data.indexOf("0x120002") !== -1)
                      exec("/opt/vc/bin/tvservice --preferred && chvt 6 && chvt 7", null);
            

            To:

                    if (data.indexOf("0x120002") !== -1){
                      exec("/opt/vc/bin/tvservice --preferred && chvt 6 && chvt 7", null);
                      exec("python /home/pi/py-spidev/RPi-LPD8806/LED.py");
                   }
            

            and

            From:

                  exec("/opt/vc/bin/tvservice -o", null);
            

            To:

                  exec("/opt/vc/bin/tvservice -o", null);
                  exec("python /home/pi/py-spidev/RPi-LPD8806/off.py");
                   }
            

            Note that in the first from - to there is a “)” missing in the original code that you will need to fix. Also note that as soon as the module gets updated if you hack the code like I did above it will be wiped out when you update.

            C 1 Reply Last reply Aug 21, 2017, 12:25 AM Reply Quote 3
            • C Offline
              cowboysdude Module Developer @orayoflighto
              last edited by cowboysdude Aug 21, 2017, 12:26 AM Aug 21, 2017, 12:25 AM

              @orayoflighto NICE!!! What light strips did you use?

              O 1 Reply Last reply Aug 21, 2017, 12:31 AM Reply Quote 0
              • O Offline
                orayoflighto Project Sponsor @cowboysdude
                last edited by Aug 21, 2017, 12:31 AM

                @cowboysdude

                I used these only because they were incredibly cheap and I originally started out looking at MMM-PiLights which uses the same LPD8806 type:

                https://www.amazon.com/gp/product/B01COEJST8/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

                I used this python code:
                https://github.com/longjos/RPi-LPD8806

                C 1 Reply Last reply Aug 21, 2017, 12:32 AM Reply Quote 2
                • C Offline
                  cowboysdude Module Developer @orayoflighto
                  last edited by cowboysdude Aug 21, 2017, 12:35 AM Aug 21, 2017, 12:32 AM

                  @orayoflighto VERY nice, Thank you!!!

                  You outta do a write up with instructions! MANY people would love this!

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    Snille Module Developer
                    last edited by Aug 21, 2017, 7:36 AM

                    Just to add some depth to this… If you really want to go “crazy” with animations, I’m recommending Bibliopixel and PixelWeb. Then you can “animate” lot’s and trigger them with a curl “command”. Plus you get a nice Web-interface to test the animations in. :)

                    If you cant find it, make it and share it!
                    Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

                    1 Reply Last reply Reply Quote 1
                    • K Offline
                      Kimzer
                      last edited by Aug 21, 2017, 7:53 AM

                      Oh lawd! This looks insanely good. Thanks alot for the guide. Out to go buy some strips today! :D

                      K 1 Reply Last reply Aug 21, 2017, 11:50 AM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        4/17
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy