πŸ’¬ MySensors singleLED




  • Hero Member

    Very cool. I especially like your case design.

    What are the part numbers for the SMD JST header thing and the corresponding adapter plug? I'm not sure where to find those.



  • Hello NeverDie,
    nice that you're interested in my project. I've also planned some other MySensors devices like an easy-to-use Raspberry Pi Gateway or battery-powered temperature and windows sensors.

    To your questions:

    I have written instructions on how to solder the adapter cables for ISP and Serial programming. They can be found on my website (https://thdev.org/?Projects___misc___micro_JST). There is a link in the building instructions, too.

    I've purchased the 8pin connectors and cables from AliExpress. Here are the links to the offers. I have bad experience putting these in the BOM since AliExpress offers often expire quickly but these are still online.
    https://www.aliexpress.com/item/10PCS-1-25mm-Connector-Horizontal-Type-Straight-Pin-Female-JST-Socket-2-3-4-5-6/32787273682.html
    https://www.aliexpress.com/item/10-Set-1-25mm-Pitch-Male-Connector-Wire-15CM-Long-28AWG-2-3-4-5-6/32787305004.html
    If these should expire, just search for "jst 1.25", "smd jst 1.25mm" or similar.

    Hope that I could answer your questions
    ThetaDev



  • Hello! I really like your job! I've been building it and working it nicely. I had so many questions about how to change the code so that two or more separately controllable LED strips can be operated with multiple pushbuttons. So double the original program.
    Excuse me for weird English, I do not really know English.
    Thank you very much for your help!



  • @krisztian
    Hi krisztian,
    the singleLED board - as its name suggests - features only one LED output. If you want to have a setup with multiple LED strips you need to design a board with multiple outputs. I have already designed a board with 4 outputs, but I haven't built it.

    In terms of software you need to register multiple sensors in your program like this:

    #define numCh 4 //the number of outputs
    
    const byte ledPins[] = {9,6,5,3};
    byte ledLevel[numCh];
    boolean ledDimWay[numCh];
    
    //in the setup function request the dim levels from the gateway
    for(byte i=0; i<numCh; i++) request(i, V_DIMMER);
    
    //in the presentation function register multiple lights
    for(byte i=0; i<numCh; i++) present(i, S_DIMMER);
    
    //if you receive a signal, you need to check for the sensor id
    setLED(message.sensor, requestedLevel);
    
    //to set the LED level (function: setLED) you need to use the sensor id to determine brightness and pin
    //Fade LED to set level
      int delta = (level - ledLevel[child]) < 0 ? -1 : 1;
    //Write to LED
    analogWrite(ledPins[child], map(ledLevel[child],0,100,0,255));
    

    I will probably publish the whole code once I have built and tested the 4LED controller (i call it "MySensors rainbowLED")

    Hope I could help you
    ThetaDev


Log in to reply
 

Suggested Topics

19
Online

11.4k
Users

11.1k
Topics

112.7k
Posts