Page 1 of 5 123 ... LastLast
Results 1 to 10 of 41

Thread: Potential E1.31 / WiFi mod for dumb strips & floods.

  1. #1
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,411
    Post Thanks / Like

    Default Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi all, hope you’ve had a good Christmas and wish you all health and happiness for the new year.
    This on the face of it is the most useless hack of the year, but it’s a proof of concept that could be quite useful to some people. It combines work from ‘ukewarrior’ (RGB LED hack) and ‘sporadic’ (software).

    Someone gave me a colour changing light bulb (with IR remote) for Christmas and said “I bet you can do something with that” http://www.ecolight.pl/media/wysiwyg/E27.pdf the last one.

    So in true DIYC style I fitted in a lamp, played with the remote for 2 minutes and headed for the internet. It appears that there are various hacks for them most using Arduinos to send or simulate the IR commands that are limited to 16 different colour / levels. Something more drastic was called for, out with the knife and off with the top.
    IMG_0606.jpg
    Back to the internet to find out what was on the board, the important bits:
    A HT68F002 http://img.ozdisan.com/ETicaret_Dosy...62_2776624.pdf
    And some Si2302DS http://www.vishay.com/docs/70628/70628.pdf
    We have something to play with and its 5v. I’m sure that if I could have been bothered to read the 177 pages and done some research on the HT68F002 I could have done something cool with it. But I couldn’t be bothered, so out with the knife cut the legs off and de-solder the feet. Solder some cat5 onto GND and the 3 output pads to the FETs (R,G and B) and into my parts box for a ESP8266-01 (you might have guessed from my posts I like these), 2 off 10K SMT resistors and 2 off 1n4005s (bought a lot others will work).

    Rebuilding:
    The ESP8266 is a 3.3V device but is quite tolerant, so I put the two diodes together from the 5V supply on the board to the ESP Vcc, given that the diodes will each drop 0.7V that should give me 3.6V at the ESP.
    Ground from the ESP to Ground on the board.
    GPIO 0 on the ESP to the Red FET on the board. Also GPIO 0 on the ESP to Vcc via a 10k resistor.
    GPIO 2 on the ESP to the Green FET on the board. Also GPIO 2 on the ESP to Vcc via a 10k resistor.
    GPIO 3 on the ESP to the Blue FET on the board.

    Now I hear some of you shout – The ESP8266-01 only has 2 GPIOs 0 & 2. That’s sort of correct it only has 2 labelled as GPIOs, Tx and Rx are also GPIOs (1 & 3 respectively) you have to change them from their boot configuration using ‘pinMode(<PIN>, FUNCTION_<FUNCTION>);’ all the functions can be found here http://www.esp8266.com/wiki/doku.php...in_allocations
    Anyway we need ‘pinMode(3, FUNCTION_3);’ to set Rx as a GPIO. I chose to sacrifice Rx so that I could still have Tx available for a serial connection to find out the IP address acquired and to debug. That sorted, what happens if we want to re-flash the ESP? In flash mode all pins are returned to their boot state, so Rx will still be Rx, plus you can now OTA update.

    We need some code:
    This is based on ‘sporadic’ ESP8266_Test.ino https://github.com/forkineye/E131/bl...P8266_Test.ino
    To get any sort of decent control we are going to need 3 channels of PWM that can respond to 0 to 255 as commands. Fortunately the ESP is capable of PWM, the down side is that its rubbish at it. Every time you change the PWM ratio you have to stop and restart the output for it to take effect, with one exception – ‘analogWrite(<output>, <value>)'. The ESP doesn’t have a digital to analog converter, it uses a high frequency square wave output and relies on circuit capacitance to convert this to an analog signal. As this is PWM there is no reason why it shouldn't work with FETs and LEDs particularly as the parameters for an analogWrite with the ESP are 0 to 255 (don’t you just love this ?).
    Finally to the sketch:
    Code:
    /*
    * ESP8266_Test.ino - Simple sketch to listen for E1.31 data on an ESP8266 
    *                    and print some statistics.
    *
    * Project: E131 - E.131 (sACN) library for Arduino
    * Copyright (c) 2015 Shelby Merrick
    * http://www.forkineye.com
    *
    *  This program is provided free for you to use in any way that you wish,
    *  subject to the laws and regulations where you are using it.  Due diligence
    *  is strongly suggested before using this code.  Please give credit where due.
    *
    *  The Author makes no warranty of any kind, express or implied, with regard
    *  to this program or the documentation contained in this document.  The
    *  Author shall not be liable in any event for incidental or consequential
    *  damages in connection with, or arising out of, the furnishing, performance
    *  or use of these programs.
    *
    */
    
    #include <ESP8266WiFi.h>
    #include <E131.h>
    
    const char ssid[] = "YOUR_SSID";         /* Replace with your SSID */
    const char passphrase[] = "YOUR_PASSWORD";   /* Replace with your WPA2 passphrase */
    const int universe = 1;   /* Replace with your universe number */
    const int channel = 1;   /* Replace with your channel number */
    
    E131 e131;
    
    void setup() {
        // prepare GPIOs
        pinMode(0, OUTPUT);
        analogWrite(0, 0);
        pinMode(2, OUTPUT);
        analogWrite(2, 0);
        pinMode(3, FUNCTION_3);
        pinMode(3, OUTPUT);
        analogWrite(3, 0);
    
        Serial.begin(115200);
        delay(10);
    
        /* Choose one to begin listening for E1.31 data */
        e131.begin(ssid, passphrase);               /* via Unicast on the default port */
        //e131.beginMulticast(ssid, passphrase, universe); /* via Multicast for Universe 1 */
    }
    
    void loop() {
        /* Parse a packet */
        uint16_t num_channels = e131.parsePacket();
        
        /* Process channel data if we have it */
        if (num_channels) {
            Serial.print("Universe ");
            Serial.print(e131.universe);
            Serial.print(" / ");
            Serial.print(num_channels);
            Serial.print(" Channels | Packets: ");
            Serial.print(e131.stats.num_packets);
            Serial.print(" / Sequence Errors: ");
            Serial.print(e131.stats.sequence_errors);
            Serial.print(" / CH");
            Serial.print(channel +0);
            Serial.print(": ");
            Serial.print(e131.data[channel -1]);
            Serial.print(" / CH");
            Serial.print(channel +1);
            Serial.print(": ");
            Serial.print(e131.data[channel -0]);
            Serial.print(" / CH");
            Serial.print(channel +2);
            Serial.print(": ");
            Serial.println(e131.data[channel +1]);
            //output
            analogWrite(0, e131.data[channel -1]); 
            analogWrite(2, e131.data[channel +0]); 
            analogWrite(3, e131.data[channel +1]);         
        }
    }
    IMG_0607.jpg
    The end result, 256 dimmable on all 3 colours, full mixing and WiFi controlable, with one down side, on power up the one colour of the device lights up untill a WiFi connection is found. It's a coding issue that is simple to sort (WiFi connection is called before the outputs are declared and set to 0), but was quite usefull for testing as when the bulb went dark I knew it had connected. It might even be a feature, for the first 2 mins at power up, Yellow connecting, Green connected and Red failed to connect. You could power up your display and watch the colour cycle through to all green before all going off.

    I said at the start, this was only a proof of concept but is working really well and has demonstrated:
    You can use more than two GPIOs, in practice 3, theory 4.
    analogWrite works as PWM, they go off at Zero and everything.
    On this unit the FETs seemed happy with the voltage and frequency supplied by the ESP.

    In theory other dumb RGB strip, DC SSR or my next development, an RGB flood could be converted to E1.31 / WiFi provided you have access to the FETs.

    Again thanks to ‘ukewarrior’ & ‘sporadic’ for doing most of the work and enabling me to have lots of fun.
    Last edited by Barnabybear; 12-29-2015 at 08:54 AM.

  2. Thanks ImissNixon, KickenWing3000, angus40, frederic, Rew723 thanked for this post
    Likes ImissNixon, angus40, frederic liked this post
  3. #2
    Join Date
    Nov 2012
    Location
    Southern California, USA
    Posts
    84
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Wow! Fun read! Looking forward to what else you come up with. Love those ESPs. Thinking I should have 50 lying around just for fun ideas.

  4. #3
    Join Date
    Oct 2014
    Location
    Cleethorpes, England
    Posts
    44
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi I have 4 of them just waiting for a genius to come with something like this
    Keep it up geniuses and thank you

  5. #4
    Join Date
    Oct 2015
    Posts
    47
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi Barnaby.
    A little help with this sketch please.
    I want to use a wemos running 2 rgb strips. Should I start with flashing espixelstick and overwrite with your sketch?


    Verzonden vanaf mijn iPhone met Tapatalk

  6. #5
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,411
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi, no do not use the espixelstick code. That code is only for pixels, renard or DMX use the code below. This will give you 6 outputs, D1, D2, D5, D6, D7 & D8, these can be used to drive the red green and blue of each strip. I would not connect any leds at this time, if you get it wrong you will damage the Wemos outputs.

    Set the SSID and Password and flash the code to the Wemos.
    Open a serial screen at 115200.
    Then download da_E131 Test source from the link below.
    Set universe to start 1 end 1.
    Set channel start 1 end 6.
    Set frame delay to 1000.
    Set IP Host / Port to Multicast.
    Now when you move the RGB sliders the serial values should change as well.
    If you put a volt meter on the output it should move between 3.3V for 255 and 0V for 0.

    Once that works we can look at connecting some leds without blowing up the outputs. You can try setting up Vixen or xlights to send out the E1.31 data if you want (having more than one data source open at one time will cause you problems).


    http://www.da-share.com/software/da_e131/

    Code:
    // Wemos D1 Mini E1.31 - 6 channel dumb RGB led sketch.
    
    #include <ESP8266WiFi.h>
    #include <E131.h> // Copyright (c) 2015 Shelby Merrick http://www.forkineye.com
    
    // ***** USER SETUP STUFF *****
    const char ssid[] = "<YOUR_SSID>";  // replace with your SSID.
    const char passphrase[] = "<YOUR_PASSWORD>"; // replace with your PASSWORD.
    const int universe = 1; // this sets the universe number you are using.
    
    // this sets the channel number used by the output.
    const int channel_1_red = 1; // the channel number to link to output 1 red.
    const int channel_1_green = 2; // the channel number to link to output 1 green.
    const int channel_1_blue = 3; // the channel number to link to output 1 blue.
    const int channel_2_red = 4; // the channel number to link to output 2 red.
    const int channel_2_green = 5; // the channel number to link to output 2 green.
    const int channel_2_blue = 6; // the channel number to link to output 2 blue.
    
    // this sets the pin numbers to use as outputs.
    const int output_1_red = 4; // the pin to use as output 1 red (D2).
    const int output_1_green = 5; // the pin to use as output 1 green (D1).
    const int output_1_blue = 12; // the pin to use as output 1 blue (D6).
    const int output_2_red = 13; // the pin to use as output 1 red (D7).
    const int output_2_green = 14; // the pin to use as output 1 green (D5).
    const int output_2_blue = 15; // the pin to use as output 1 blue (D8).
    
    
    E131 e131;
    
    void setup() {
      Serial.begin(115200);
    
      // set the pins chosen above as outputs.
      pinMode(output_1_red, OUTPUT);
      pinMode(output_1_green, OUTPUT);
      pinMode(output_1_blue, OUTPUT);
      pinMode(output_2_red, OUTPUT);
      pinMode(output_2_green, OUTPUT);
      pinMode(output_2_blue, OUTPUT);
    
      // set the pins chosen above to low / off.
      analogWrite(output_1_red, 0);
      analogWrite(output_1_green, 0);
      analogWrite(output_1_blue, 0);
      analogWrite(output_2_red, 0);
      analogWrite(output_2_green, 0);
      analogWrite(output_2_blue, 0);
    
      /* Choose one to begin listening for E1.31 data */
     //e131.begin(ssid, passphrase);               /* via Unicast on the default port */
       e131.beginMulticast(ssid, passphrase, universe); /* via Multicast for Universe 1 */
    }
    
    void loop() {
      /* Parse a packet */
      uint16_t num_channels = e131.parsePacket();
    
      /* Process channel data if we have it */
      if (num_channels) {
      Serial.println("we have data");
    
        Serial.println(e131.data[channel_1_red -1]);
        Serial.println(e131.data[channel_1_green -1]);
        Serial.println(e131.data[channel_1_blue -1]);
        Serial.println(e131.data[channel_2_red -1]);    
        Serial.println(e131.data[channel_2_green -1]);
        Serial.println(e131.data[channel_2_blue -1]);
      
      // set the outputs to the data value.
      analogWrite(output_1_red, e131.data[channel_1_red -1] );
      analogWrite(output_1_green, e131.data[channel_1_green -1] );
      analogWrite(output_1_blue, e131.data[channel_1_blue -1] );
      analogWrite(output_2_red, e131.data[channel_2_red -1] );
      analogWrite(output_2_green, e131.data[channel_2_green -1] );
      analogWrite(output_2_blue, e131.data[channel_2_blue -1] );
    
      }
    }

  7. #6
    Join Date
    Oct 2015
    Posts
    47
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi,

    I tried to setup the Wemos, I do get proper output in the serial monitor:
    we have data
    175
    107
    207
    175
    107
    207
    I wired everything as described in this page using irf540N mosfets.
    https://learn.adafruit.com/rgb-led-strips/usage

    But the output to the RGB strip is too low; measured by multimeter.
    0v - RED - OFF
    0.82V - RED - ON

    Double checked the pinout, but this seems fine:
    http://escapequotes.net/esp8266-wemo...ns-and-diagram

    How can I spice up the output off the GPIO?
    #analogWrite(output_1_red, e131.data[channel_1_red -1] );

  8. #7
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,411
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Hi, that’s good news. The first thing that comes to mind is that the IFR540N may be the issue. These FETs are great with 5V systems but are really close to their lower limits in 3.3V systems.

    If you look at the data sheet https://www.infineon.com/dgdl/irf540...5355e396cb199f
    Page 2; Electrical characteristics; VGS(th); this is the voltage difference between the Gate (Wemos) and the Source (Ground) and is 2V to 4V. What the manufacturer is saying is that the FET (depending on its construction) needs a voltage of between 2V and 4V in order to switch on. As the Wemos is a 3.3V device it is more down to the batch of FETs than circuit design. Some may switch fully on at 2.8V where as some may need 3.8V.

    I would do a simple test to check the FETs you have. Remove the Wemos from the circuit (we don’t want to damage it) and use 1.5V batteries in its place.
    3x 1.5V batteries (4.5V) will fully switch on the FET and prove the circuit works.
    2x 1.5V batteries (3.0V) may switch on the FET but not fully and the LEDs will be dimmer and the FET may run much warmer than with 3 batteries. If this is the case you will have to look at a different FET.

    If you look at the one they use in that example
    https://cdn-shop.adafruit.com/datash...rlb8721pbf.pdf
    Page 2; Electrical characteristics; VGS(th); this is the voltage difference between the Gate (Wemos) and the Source (Ground) and is 1.35V to 2.35V. This will fully switch on with the 3.3V of the Wemos outputs.

    If this is the case and you have already purchased FETs that you don't think you'll use for anyting else there are some tricks we can use. Let me know how you get on.
    Last edited by Barnabybear; 09-29-2017 at 03:26 AM.

  9. #8
    Join Date
    Oct 2015
    Posts
    47
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Quote Originally Posted by Barnabybear View Post
    Hi, thatís good news. The first thing that comes to mind is that the IFR540N may be the issue. These FETs are great with 5V systems but are really close to their lower limits in 3.3V systems.

    If you look at the data sheet https://www.infineon.com/dgdl/irf540...5355e396cb199f
    Page 2; Electrical characteristics; VGS(th); this is the voltage difference between the Gate (Wemos) and the Source (Ground) and is 2V to 4V. What the manufacturer is saying is that the FET (depending on its construction) needs a voltage of between 2V and 4V in order to switch on. As the Wemos is a 3.3V device it is more down to the batch of FETs than circuit design. Some may switch fully on at 2.8V where as some may need 3.8V.

    I would do a simple test to check the FETs you have. Remove the Wemos from the circuit (we donít want to damage it) and use 1.5V batteries in its place.
    3x 1.5V batteries (4.5V) will fully switch on the FET and prove the circuit works.
    2x 1.5V batteries (3.0V) may switch on the FET but not fully and the LEDs will be dimmer and the FET may run much warmer than with 3 batteries. If this is the case you will have to look at a different FET.

    If you look at the one they use in that example
    https://cdn-shop.adafruit.com/datash...rlb8721pbf.pdf
    Page 2; Electrical characteristics; VGS(th); this is the voltage difference between the Gate (Wemos) and the Source (Ground) and is 1.35V to 2.35V. This will fully switch on with the 3.3V of the Wemos outputs.

    If this is the case and you have already purchased FETs that you don't think you'll use for anyting else there are some tricks we can use. Let me know how you get on.
    Hi.
    Sorry for the confussion.
    When I measure voltage I did measure it directly on the gpio pin out. So wemos is limiting output of the analog output somehow.


    Verzonden vanaf mijn iPhone met Tapatalk

  10. #9
    Join Date
    Oct 2015
    Posts
    47
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Quote Originally Posted by martijnkooi View Post
    Hi.
    Sorry for the confussion.
    When I measure voltage I did measure it directly on the gpio pin out. So wemos is limiting output of the analog output somehow.


    Verzonden vanaf mijn iPhone met Tapatalk
    On second thought the issue might be with the analog write. When the output is sent its just treated as output value. Shouldnít this be:
    5v/255*output ??


    Verzonden vanaf mijn iPhone met Tapatalk

  11. #10
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,411
    Post Thanks / Like

    Default Re: Potential E1.31 / WiFi mod for dumb strips & floods.

    Quote Originally Posted by martijnkooi View Post
    How can I spice up the output off the GPIO?
    #analogWrite(output_1_red, e131.data[channel_1_red -1] );
    Hi, sorry - my bad. Arduinos only have a 8 bit analog output (0 to 255) the ESPs / Wemos are 10bit (0 to 1023). An easy fix *4.
    Code:
    analogWrite(output_1_red, e131.data[channel_1_red -1] );
    
    analogWrite(output_1_red, (e131.data[channel_1_red -1] *4));
    I must go back and try that bulb again - I never realy did anything with it as it wasn't very bright - it looks like it was me that wasn't very bright.
    Last edited by Barnabybear; 09-29-2017 at 05:43 AM.

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •