Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. RGB LED strip controller with FastLED

RGB LED strip controller with FastLED

Scheduled Pinned Locked Moved My Project
14 Posts 5 Posters 7.4k Views 5 Watching
  • 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.
  • rollercontainerR Offline
    rollercontainerR Offline
    rollercontainer
    wrote on last edited by
    #1

    Hi,

    I built a 1m x 1,5m accoustic absorber with Basotect for the ceiling in my living room. To generate ambient lighting, I installed a non-smart analog 5m LED strip on the top side. My first attempt was to use PWM from arduino which resultet in visual steps when do slow fading. Next approcach was a 12bit PWM motor shield, resulting in 4096 steps which were smooth but I couldn't use the real good FastLED library. So I ended up with a P9813 RGB MosFET Board from ebay which represents a single pixel. (But can easily chained for several strips in the room.) FastLED is dithering between the 256 steps of the arduino and produces very smooth transitions.

    Hardware:

    • Arduino Nano (~5€)
    • NRF24L01 (~2€)
    • P9813 RGB MosFet Board from ebay (Full Color RGB LED Strip Driver Sensor v1.1 for Arduino STM32 AVR P9813) (4,29€)
    • LM2596S DC-DC Step-Down Converter for 12V->5V (~1€)
    • 5m RGB LED Strip ( < 10€)
    • old 12V laptop power supply

    Software:

    My setup is a mqttClientGateway and a raspi with node-red.
    To change color, you can send a RRGGBB string to mysensors-in/node-id/0/1/0/40
    To change the fade time you can send a integer from 0 to 255 to mysensors-in/node-id/1/1/0/24
    To persist the current settings to eeprom you can send a "1" (meaning bool "true") to mysensors-in/node-id/2/1/0/2
    To set the brightness you can send 0 to 100 (V_PERCENTAGE) to mysensors-in/node-id/3/1/0/3

    https://github.com/rollercontainer/nanoP9813FastLEDMySensors/blob/master/main.cpp

    This code is working. Nevertheless it could be a lot better. It is posted, to help people take code lines or inspirations out of it. I think, I change the setup to esp8266 because of the OTA flash ability.

    Greetings

    1 Reply Last reply
    1
    • pansenP Offline
      pansenP Offline
      pansen
      wrote on last edited by
      #2

      I think you might have left out the LM2596 since the Nano linear regulator should be able to cope with 12V.

      Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

      micahM 1 Reply Last reply
      0
      • gohanG Offline
        gohanG Offline
        gohan
        Mod
        wrote on last edited by
        #3

        Many say it's better don't push those regulators to the limit if you are unsure about the quality 😁

        1 Reply Last reply
        0
        • pansenP pansen

          I think you might have left out the LM2596 since the Nano linear regulator should be able to cope with 12V.

          micahM Offline
          micahM Offline
          micah
          wrote on last edited by
          #4

          @pansen I've burned out a couple nano's and pro mini's by supplying what was supposedly 12v from a wall wart.

          So I would advise using a linear voltage regulator

          1 Reply Last reply
          0
          • pansenP Offline
            pansenP Offline
            pansen
            wrote on last edited by
            #5

            @micah @gohan Yeah I could imagine nasty spikes from a cheap power supply can fry the regulator. I still find an LM2596 overpowered for this. At least take a 7805 :P

            Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

            AWIA 1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #6

              for 0.65€ a piece you don't go broke if you buy some LM2596 :)

              1 Reply Last reply
              0
              • micahM Offline
                micahM Offline
                micah
                wrote on last edited by
                #7

                Yeah I usually use some 78xx variant

                1 Reply Last reply
                0
                • pansenP pansen

                  @micah @gohan Yeah I could imagine nasty spikes from a cheap power supply can fry the regulator. I still find an LM2596 overpowered for this. At least take a 7805 :P

                  AWIA Offline
                  AWIA Offline
                  AWI
                  Hero Member
                  wrote on last edited by
                  #8

                  @pansen Agree and price is one thing but I would prefer a linear regulator for its stability and noise.

                  pansenP 1 Reply Last reply
                  0
                  • gohanG Offline
                    gohanG Offline
                    gohan
                    Mod
                    wrote on last edited by
                    #9

                    but linear regulator would waste a lot of energy/heat, wouldn't it?

                    micahM 1 Reply Last reply
                    0
                    • gohanG gohan

                      but linear regulator would waste a lot of energy/heat, wouldn't it?

                      micahM Offline
                      micahM Offline
                      micah
                      wrote on last edited by
                      #10

                      @gohan maybe, I don't know, I only pretend to be an electrical engineer in my spare time... Lol

                      1 Reply Last reply
                      0
                      • gohanG Offline
                        gohanG Offline
                        gohan
                        Mod
                        wrote on last edited by
                        #11

                        well for powering a Nano there should not be that much heat dissipated, being a low power device

                        1 Reply Last reply
                        0
                        • AWIA AWI

                          @pansen Agree and price is one thing but I would prefer a linear regulator for its stability and noise.

                          pansenP Offline
                          pansenP Offline
                          pansen
                          wrote on last edited by pansen
                          #12

                          @AWI Was about to say that ;) For a hobbyist it doesn't matter that much but switching regulators are quite nasty when it comes to EMI.

                          @gohan: A good rule of thumb is to assume that the voltage difference from input to output of the linear regulator will be converted to heat. So if you have a high current application or a high voltage difference a switching regulator is better. In case of running an Arduino (let's say it consumes 80mA@5V which is quite high) it's negligible: P=U*I=(12-5)*0.08=0.5W which should be dissipated without heatsink easily.

                          edit: ah you just answered yourself ;D

                          Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

                          AWIA 1 Reply Last reply
                          1
                          • pansenP pansen

                            @AWI Was about to say that ;) For a hobbyist it doesn't matter that much but switching regulators are quite nasty when it comes to EMI.

                            @gohan: A good rule of thumb is to assume that the voltage difference from input to output of the linear regulator will be converted to heat. So if you have a high current application or a high voltage difference a switching regulator is better. In case of running an Arduino (let's say it consumes 80mA@5V which is quite high) it's negligible: P=U*I=(12-5)*0.08=0.5W which should be dissipated without heatsink easily.

                            edit: ah you just answered yourself ;D

                            AWIA Offline
                            AWIA Offline
                            AWI
                            Hero Member
                            wrote on last edited by
                            #13

                            @pansen To add to that... these step down Power converter(boards) are not really suited for low power applications. Their efficiency is likely (much) worse than a linear regulator.

                            pansenP 1 Reply Last reply
                            1
                            • AWIA AWI

                              @pansen To add to that... these step down Power converter(boards) are not really suited for low power applications. Their efficiency is likely (much) worse than a linear regulator.

                              pansenP Offline
                              pansenP Offline
                              pansen
                              wrote on last edited by
                              #14

                              @AWI Ha, I forgot about that...I remembered that you actually need a minimum load on the output of the switching regulator for it to even run. I created a spreadsheet just taking into account the quiescent currents and assuming 70% effciency for the lm2596 (a "bit" optimistic. Datasheet says 80% at 3A load for 12V-5V operation). Quiescent current for the LM2596 is much higher.

                              Considering the mini pro takes about 12-20mA running, I am sure to opt for the 7805 or LM317 from now on ;) (If there is nothing else drawing current). I think nano etc are comparable but the FTDI USB to serial converter probably adds some current that the mini pro is missing.

                              0_1491471717305_upload-90fd958b-83f1-4af4-abbc-f4103ec1e2fc

                              0_1491471734938_analysis7805.xlsx

                              Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              9

                              Online

                              11.7k

                              Users

                              11.2k

                              Topics

                              113.1k

                              Posts


                              Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • MySensors
                              • OpenHardware.io
                              • Categories
                              • Recent
                              • Tags
                              • Popular