[DIY] AtmoOrb - A Hue like mood lamp based on Particle Photon with NeoPixel - *Tutorial added* (1 Viewer)

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Introduction

    Since Hue had its fair share of limitations due to the protocol and it not being well suited for fast Ambilight @Lightning303 and I started working on something similar without all the limitations called AtmoOrb, he completed his one a while back:

    [DIY] AtmoOrb - A Hue like mood lamp based on Arduino, ESP8266 wifi module and WS2812B rgb leds

    However wanted something that was easier hardware wise to build so waited for the Particle Photon which delay after delay finally arrived in July, afterwards waited a while for the Neo Pixel ring kit which was the last part of the puzzle.

    The project is now completed and includes the awesome color smoothing done by @Lightning303.

    Description

    A Hue like lamp controlled by AtmoLight that takes the average color from your video or audio (VU meter) and displays that on the AtmoOrb lamp via Wi-Fi.
    A number of calculations are done to prevent flickering and during dark enough scenes it will turn off, with AtmoLight you can configure all those settings:

    Darkness limit
    Gamma
    Saturation
    Position - multiple lamps for different screen areas

    Besides AtmoLight it can be controlled from Android and Windows via their own respective apps as well as externally via Hyperion.

    Hardware

    Comes down to these parts and no actual soldering except maybe the Neopixel headers but Adafruit can probably ship those pre-soldered as well, just stick em together and upload the code:

    - Particle Photon - Particle Store
    - Neopixel ring kit - Adafruit Particle/Spark NeoPixel Ring Kit - 24 NeoPixels ID: 2268 - $24.95 : Adafruit Industries, Unique & fun DIY electronics and kits
    - 5V adapter (1A or higher) with DC jack connector - 5V 2A (2000mA) switching power supply - UL Listed ID: 276 - $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits
    - Female DC jack to connect power - Female DC Power adapter - 2.1mm jack to screw terminal block ID: 368 - $2.00 : Adafruit Industries, Unique & fun DIY electronics and kits
    - Lamp fixture - Ikea Fado used in videos: FADO Tischleuchte - IKEA

    If you want to use other WS2812B / Neopixel leds you can use the Data out connection on the ring kit to do so.
    Most of the parts you should be able to get from your local shops however the Neopixel ring kit at least at this time is a Adafruit exclusive.

    Connection scheme

    NeoPixel ring kit --> Particle Photon (no soldering required)
    5V 1A or higher DC adapter --> NeoPixel ring kit 5V DC connector

    For testing you can connect the Photon micro USB connector to a PC to power the leds and Photon itself however make sure to disconnect the 5V DC adapter when you do this.

    Tutorial

    03+bob+ross+1[1].jpg


    Step 1


    For requirements check the Hardware chapter

    Recommended Photon firmware is 0.5.3 as 0.6.0 and up don't work properly with the FastLED library as of March 2017.

    Obviously first make sure the hardware is connected, basically you need have the Photon and Neopixel ring kit clicked together.

    Setup the Particle Photon using their own guide and open your Particle Build environment (build.particle.io), create a new application there and include the Library FastLED from the left side menu

    FastLED_librarySelection.png


    Make sure to use FastLED 3.1.4 or higher as otherwise the app will not compile, select your app after clicking "Include in App" and re-open your app sketch again.

    Afterwards use this sketch for Orb UDP multicast (preferred) in the app you created:

    AtmoOrb/AtmoOrb_UDP.ino at master · ambilight-4-mediaportal/AtmoOrb · GitHub

    Change your Orb ID at the top of the sketch if needed, for multiple Orbs you can assign the same ID to group them or different ones ranging from 1-255 to control them separately.
    Now upload that application to your Photon.

    In case you run into compile errors due to a FastLED library mismatch (bug in Particle IDE) follow these instructions:

    platforms/avr/led_sysdefs_avr.h: No such file or directory · Issue #2 · focalintent/FastLED-Sparkcore · GitHub

    Step 2

    First you can test if everything works right with either the Android or Windows app, specify the Orb ID there and leave the rest default:

    Releases · ambilight-4-mediaportal/AtmoOrbDroid · GitHub (Android app)
    Releases · RickDB/AtmoOrbNET · GitHub (Windows app)

    Make sure you are in the same network as your lamps, if that works continue onward.

    Step 3

    You can also use Hyperion to control the AtmoOrb device if you want to and can then skip this step and follow the guide here:

    AtmoOrb Device


    - Install the latest version of AtmoLight via the Mediaportal Extensions Manager (1.17.0.0 or higher)
    - Open Mediaportal configuration and go to Plugins, select AtmoLight and click config

    250921_YqdXjV5.png


    - Enable AtmoOrb and change any Effect Settings you want to use

    AtmoLight_2.png


    - Now add the lamp with the ID you used in the sketch from Step 1 and optionally change any gamma / color correction, also if you have an non-standard setup with more than 24 leds you can change the default.

    Only need to enter ID / Multicast and change the area you want to use for the average color (used 100% in example), afterwards press Add and Save to exit the AtmoLight configuration.

    AtmoLightAtmoOrbConfig.PNG


    Step 4

    Now start Mediaportal and if everything went alright you now have Orbs that change color based on your Video or Music.

    Optional features

    Option 1 - Smoothing tweaks

    In the Photon Orb sketch you can tweak smoothing, the default is 200ms (50 steps * 4ms).
    If you want to change that you can do so at the top of the Photon Orb sketch:

    Code:
    // SMOOTHING SETTINGS
    #define SMOOTH_STEPS 50 // Steps to take for smoothing colors
    #define SMOOTH_DELAY 4 // Delay between smoothing steps
    #define SMOOTH_BLOCK 0 // Block incoming colors while smoothing

    For instance if you wanted 100ms you can change SMOOTH_STEPS to 25.

    Option 2 - Other protocol usage

    If for some reason you can't or don't like using Multicast the Orb also supports TCP and UDP on IP basis, in the Code / Software section there are sketches for TCP and UDP IP already works with the UDP Multicast sketch
    You add them the same way only in AtmoLight you select a different Connection Type and Protocol / IP.

    Code / Software

    Particle cloud code
    TCP
    AtmoOrb/AtmoOrb_TCP.ino at master · ambilight-4-mediaportal/AtmoOrb · GitHub

    UDP Multicast + UDP IP
    AtmoOrb/AtmoOrb_UDP.ino at master · ambilight-4-mediaportal/AtmoOrb · GitHub

    Android app to control Orbs (UDP multicast only)
    GitHub - ambilight-4-mediaportal/AtmoOrbDroid: Android app for use with AtmoOrb lamps
    Releases · ambilight-4-mediaportal/AtmoOrbDroid · GitHub (.apk install)

    Windows application to test and calibrate Orb colors (UDP multicast only)
    GitHub - RickDB/AtmoOrbNET: Windows application to control and test Orb lamps
    Releases · RickDB/AtmoOrbNET · GitHub (binary release)

    Credits

    @Lightning303 - AtmoLight color smoothing and AtmoLight AtmoOrb core code, probably other things as well that I forgot ;)

    Wolph - initial protocol sketch and performance improvements

    Philips Hue - for making pos hardware which drove me to this :p
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Videos

    Taken with early alpha build, will make new ones later.




    Pictures

    AtmoOrb

    252618_IMG_2450.jpg



    AtmoOrb and its bigger brother Hyperion on the back of the TV

    252613_Hyperion_Photon.jpg



    AtmoLight - AtmoOrb configuration tab

    AtmoLightAtmoOrb.PNG


    AtmoOrb - Android application (UDP multicast only)

    AtmoOrbDroid.png



    AtmoOrbNET - external Windows app to control and calibrate Orb lamps (UDP multicast only)

    AtmoOrbNet.png
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Not sure if that would be better as it requires the Particle library maintainer to update (example) code from Github manually, it does remove the copy/paste step from the tutorial however can leave the user with an outdated version in the future.
    AtmoOrb library with example code shortens the tutorial a bit however I'm not that thrilled about having multiple sources / maintainers for the code as it can confuse the user and create incompatibilities when we add new features.
     
    Last edited:

    wolph

    New Member
    September 17, 2015
    3
    1
    Home Country
    Netherlands Netherlands
    Ideally the code would get to the point that it's stable enough that, besides the first flash, the code never changes after the initial install.

    No need to manually update the Github code, we can just use a git submodule to link to a single repository.

    I'm planning to improve the code the coming months so that there is a bit of negotiation between the orb and the pc so we can easily check the version and such and warn about incompatibilities.
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Ideally the code would get to the point that it's stable enough that, besides the first flash, the code never changes after the initial install.

    No need to manually update the Github code, we can just use a git submodule to link to a single repository.

    Even though it's stable now it might be that changes are needed to accommodate new features so having it in one central place (github repo) is still the preferred way to do it as we can keep multiple sketches (Core / Photon / Photon 2.0) and link to tutorials / wiki etc..
    No need for multiple repo's as AtmoOrb is a mixed hardware solution already, we separate each device type by folder:

    https://github.com/ambilight-4-mediaportal/AtmoOrb

    Under Libraries there we have git submodules for CC3000 / FastLed / Neopixel which are used by other non-Particle devices.

    Particle build environment for now only allows for libraries and samples which is fine for things like NeoPixel / Internetbutton etc.. but not so much for project hosting which is what Github is meant for.

    I'm planning to improve the code the coming months so that there is a bit of negotiation between the orb and the pc so we can easily check the version and such and warn about incompatibilities.

    That would be nice, can do a pull request once that's done :)
    TCP and UDP sketches I would like to keep separate as the Particle TCP library has always been a bit unpredictable and to mix the two can affect stability, also keep in mind it also has to support the Particle Core and some functions might not be supported under it.
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Added new build AtmoLight_1.16.1.41 to the first post, this adds a config setting where you can optionally specify the led count (default is still 24).
    This is mostly for non-standard setups that have connected additional leds to the NeoPixel ring kit.
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    For those wanting to use the UDP IP option you will run into a bug where it will not connect at all, fixed that in the attached test version (1.17.0.1) and will be part of the next official release.
     

    Attachments

    • AtmoLight_1.17.0.1.mpe1
      579.9 KB

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Updated AtmoOrb UDP sketch to use the FastLED library as that has become available for Photon today which is better and nicer to work with.
    Also a new feature was added to allow you to override the lamps smoothing and show the color instantly (light shows etc..).

    There will be a new feature in the upcoming AtmoLight release allowing you to use its smoothing over the lamps, still testing and comparing at the moment.
     
    Last edited:

    pur_berger

    Super User
  • Team MediaPortal
  • Super User
  • May 14, 2007
    1,679
    309
    51
    Vienna
    Home Country
    Austria Austria
    Where do I get FastLED 3.1.4 from? The library only has 3.1.3 which ends up in a compiling error ... THX in advance
     

    Users who are viewing this thread

    Top Bottom