Page 3 of 10 FirstFirst 12345 ... LastLast
Results 21 to 30 of 92

Thread: Single channel AC dimmer

  1. #21
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Well the slow boat finally arrived and I have setup this module with a wemos pro mini and serial sample code from the manufacturers git-lib .
    I connected the 200W led flood and have had success in dimming this blinding beast .

    That said, there was /is a host of issues to overcome along the way.

    First the AC module git-library code for the esp8266 is broken and requires an edit to establish a connection.
    Once that was corrected , the serial code itself has an issue with their usage of delay() rather than delayMicroseconds().
    Now that I resolved these 2 issues , voila dimming is achieved .
    However , dimming is limited in its range and some flicker is noticeable .
    I am not sure how to best address the limited dimming value range or the flicker yet .

    The good news is that I a have at least confirmed that these 200W AC floods are dimmable .

    Always more to learn .

  2. #22
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Some more progress with this controller and using a esp web server but still limited range . I conclude it is not up to the task of AC leds .
    So I dove right in to the next step with the Flood lamp ->
    Measured voltage at DB207S rectifier =35V
    There are 2*DB207S side by side and both outputs measure the same
    .
    If I apply 36Vdc @ these measured points will I be cooking or smiling ?
    all advice welcome .

    Last edited by angus40; 06-11-2021 at 10:54 PM.

  3. #23
    Join Date
    May 2007
    Posts
    5,556
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Just out of curiosity, were you programming that wemos pro mini in entirely in micropython?

    As to what would happen if you applied 36 vdc, I have no idea what would happen, especially since I don't know what you're measuring and how you're measuring it.
    Phil

  4. #24
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Quote Originally Posted by P. Short View Post
    Just out of curiosity, were you programming that wemos pro mini in entirely in micropython?

    As to what would happen if you applied 36 vdc, I have no idea what would happen, especially since I don't know what you're measuring and how you're measuring it.
    I did not use Micropy .I used the Arduino RBDlib - code from the supplier of the board and a simple web server .

    I applied 110V AC and measured the output (+/-) of each bridge rectifier .
    I am assuming the 2*DB207S are 1/2 wave rectifiers and supplying 36Vdc to 1/2 of the leds each for 100W a piece.
    This would make sense as the 100W RGB floods I have are 36Vdc also .

    I just wanted to confirm that I am correct in applying 36Vdc at the + and - side of the rectifier as a test . No AC applied of course .

    Here is the code I used for the Wemos .
    Thank you for taking a look see !

    Code:
    #include <ESP8266WiFi.h>
    #include <ESPAsyncTCP.h>
    #include <ESPAsyncWebServer.h>
    #include <RBDdimmer.h>//
    // Replace with your network credentials
    const char* ssid = "Server";  //REPLACE_WITH_YOUR_SSID
    const char* password = "password"; //REPLACE_WITH_YOUR_PASSWORD
    
    //const int output = 2;
    #define outputPin  D6
    #define zerocross  D1 // for boards with CHANGEABLE input pins
    
    dimmerLamp dimmer(outputPin, zerocross); //initialise port for dimmer for ESP8266, ESP32, Arduino due boards
    
    String sliderValue = "0";
    
    const char* PARAM_INPUT = "value";
    
    // Create AsyncWebServer object on port 80
    AsyncWebServer server(80);
    
    const char index_html[] PROGMEM = R"rawliteral(
    <!DOCTYPE HTML><html>
    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>ESP Web Server</title>
      <style>
        html {font-family: Arial; display: inline-block; text-align: center;}
        h2 {font-size: 2.3rem;}
        p {font-size: 1.9rem;}
        body {max-width: 400px; margin:0px auto; padding-bottom: 25px;}
        .slider { -webkit-appearance: none; margin: 14px; width: 360px; height: 25px; background: #FFD65C;
          outline: none; -webkit-transition: .2s; transition: opacity .2s;}
        .slider::-webkit-slider-thumb {-webkit-appearance: none; appearance: none; width: 35px; height: 35px; background: #003249; cursor: pointer;}
        .slider::-moz-range-thumb { width: 35px; height: 35px; background: #003249; cursor: pointer; } 
      </style>
    </head>
    <body>
      <h2>ESP Web Server</h2>
      <p><span id="textSliderValue">%SLIDERVALUE%</span></p>
      <p><input type="range" onchange="updateSliderPWM(this)" id="pwmSlider" min="-1" max="99" value="%SLIDERVALUE%" step="1" class="slider"></p>
    <script>
    function updateSliderPWM(element) {
      var sliderValue = document.getElementById("pwmSlider").value;
      document.getElementById("textSliderValue").innerHTML = sliderValue;
      console.log(sliderValue);
      var xhr = new XMLHttpRequest();
      xhr.open("GET", "/slider?value="+sliderValue, true);
      xhr.send();
    }
    </script>
    </body>
    </html>
    )rawliteral";
    
    // Replaces placeholder with button section in your web page
    String processor(const String& var){
      //Serial.println(var);
      if (var == "SLIDERVALUE"){
        return sliderValue;
      }
      return String();
    }
    
    void setup(){
      // Serial port for debugging purposes
      Serial.begin(115200);
    
      //analogWrite(output, sliderValue.toInt());
    
      // Connect to Wi-Fi
      WiFi.begin(ssid, password);
      while (WiFi.status() != WL_CONNECTED) {
        delay(1000);
        Serial.println("Connecting to WiFi..");
      }
      dimmer.begin(NORMAL_MODE, ON); //dimmer initialisation: name.begin(MODE, STATE)
    
      // Print ESP Local IP Address
      Serial.println(WiFi.localIP());
    
      // Route for root / web page
      server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
        request->send_P(200, "text/html", index_html, processor);
      });
    
      // Send a GET request to <ESP_IP>/slider?value=<inputMessage>
      server.on("/slider", HTTP_GET, [] (AsyncWebServerRequest *request) {
        String inputMessage;
        // GET input1 value on <ESP_IP>/slider?value=<inputMessage>
        if (request->hasParam(PARAM_INPUT)) {
          inputMessage = request->getParam(PARAM_INPUT)->value();
          sliderValue = inputMessage;
          //analogWrite(output, sliderValue.toInt());
          dimmer.setPower(sliderValue.toInt()); // setPower(0-100%);
    
        }
        else {
          inputMessage = "No message sent";
        }
        Serial.println(inputMessage);
        request->send(200, "text/plain", "OK");
      });
      
      // Start server
      server.begin();
    }
      
    void loop() {
      
    }

  5. #25
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Here is a pic of where i believe adding DC to test .



    200w- flood.jpg

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

    Default Re: Single channel AC dimmer

    Hi, can you do a close up of the various clumps of components?

  7. #27
    Join Date
    May 2007
    Posts
    5,556
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    At the risk of being pedantic, the DB207S is a full-wave bridge rectifier, not a half-wave.

    What puzzles me is the 36V that you observed. Absent something to reduce the voltage, I would have expected a much larger voltage on the output of the bridge if it's input was 110 VAC. So I'm wondering how you measured the voltage - was it with a digital voltmeter? And was it set to measure AC or DC?

    Since I don't understand the circuitry, I would not directly apply 36VDC to the DB207S outputs right away without something to limit the current. There is certain to already be something limit the current, but the low output voltage from the bridge makes me concerned that the limiter is on the input side of the bridge, where it would be totally ineffective if you applied power to the output side of the bridge. So, I'd put a resistor in series with the PS (starting perhaps with about 1K and working downwards in value if that's too dim or nothing comes on.

    Or maybe your question was rhetorical - in that case, just go for it with the power supply and see what happens. And, of course, what Barnaby said.
    Phil

  8. #28
    Join Date
    May 2007
    Posts
    5,556
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    By the way, why do you want to apply 36V to the guts of the device? Is it just tinkering, or do you have some plan behind not using the 110VAC power input?
    Phil

  9. #29
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Thanks Phil

    I believe that I phrased the rectifiers incorrectly . Being that there are 2 rectifiers and 4 led arrays , that 1 rectifier was for 1/2 of the total or 2 arrays .

    Each array has it's own CSD4N60 TO-252 N-channel 4A---600V insulated gate MOSFET .

    Applying 36Vdc did nothing .

  10. #30
    Join Date
    Dec 2011
    Posts
    7,079
    Post Thanks / Like

    Default Re: Single channel AC dimmer

    Quote Originally Posted by Barnabybear View Post
    Hi, can you do a close up of the various clumps of components?
    Hi
    Here is a cluster shot .

    cluster jpg.jpg
    Last edited by angus40; 06-12-2021 at 05:03 PM.

Page 3 of 10 FirstFirst 12345 ... 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
  •