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. Hardware
  3. edited: 4 diy dimmer module. should i make icsp or serial programming connections, both?

edited: 4 diy dimmer module. should i make icsp or serial programming connections, both?

Scheduled Pinned Locked Moved Hardware
4 Posts 2 Posters 439 Views 2 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.
  • JoeridemanJ Offline
    JoeridemanJ Offline
    Joerideman
    wrote on last edited by Joerideman
    #1

    I am building a 4 ch. pwm led dimmer. It's predessor used the PWM outputs from the arduino pro mini, but when ever I am filming or taking a picture I can not dim the light's and when I want to use it as a nightlight I realise there are only 256 steps. Which is not enough.

    The PCA9685 is capable of 4096 steps and 1600Hz. Which is not perfect but a huge step forward.

    I am not using the arduino pro mini board anymore for the first time. I want to use the bare chip. There is a lot of room on the pcb, but I have yet to do a connector or pads for programming. I ask you to check my scematic and advice one icsp & serial programming connections.

    The layout is somewhat similer to the previous version. The tracks that are now under the NRFmodule will be replaced somewhere else. It wil be a double layered board so there a no problems routing. This was sort of my quick and dirty routing.

    1_1570372430146_20191006-schema.PNG 0_1570372430144_20191006-board.PNG

    MGHaffM 1 Reply Last reply
    0
    • JoeridemanJ Joerideman

      I am building a 4 ch. pwm led dimmer. It's predessor used the PWM outputs from the arduino pro mini, but when ever I am filming or taking a picture I can not dim the light's and when I want to use it as a nightlight I realise there are only 256 steps. Which is not enough.

      The PCA9685 is capable of 4096 steps and 1600Hz. Which is not perfect but a huge step forward.

      I am not using the arduino pro mini board anymore for the first time. I want to use the bare chip. There is a lot of room on the pcb, but I have yet to do a connector or pads for programming. I ask you to check my scematic and advice one icsp & serial programming connections.

      The layout is somewhat similer to the previous version. The tracks that are now under the NRFmodule will be replaced somewhere else. It wil be a double layered board so there a no problems routing. This was sort of my quick and dirty routing.

      1_1570372430146_20191006-schema.PNG 0_1570372430144_20191006-board.PNG

      MGHaffM Offline
      MGHaffM Offline
      MGHaff
      wrote on last edited by
      #2

      @joerideman what code are you using to run the 9685 chip? I'm looking to build a multi rgb strip controller but having problems finding mysensors code to use as an example to talk to the 9685. Any help is greatly appreciated! thanks.

      1 Reply Last reply
      0
      • JoeridemanJ Offline
        JoeridemanJ Offline
        Joerideman
        wrote on last edited by Joerideman
        #3

        I am using an adafruit library to communicate with the ic.

        I am not cascading them, so I have no idea how to do that part. But controller 1 of them is easy. And when I have my pcb's design finished and ordered and all the parts at home, I will come up with a protocol of how the lights should respond to mysensor messages.

        /*************************************************** 
          This is an example for our Adafruit 16-channel PWM & Servo driver
          GPIO test - this will set a pin high/low
        
          Pick one up today in the adafruit shop!
          ------> http://www.adafruit.com/products/815
        
          These drivers use I2C to communicate, 2 pins are required to  
          interface.
        
          Adafruit invests time and resources providing this open source code, 
          please support Adafruit and open-source hardware by purchasing 
          products from Adafruit!
        
          Written by Limor Fried/Ladyada for Adafruit Industries.  
          BSD license, all text above must be included in any redistribution
         ****************************************************/
        
        #include <Wire.h>
        #include <Adafruit_PWMServoDriver.h>
        
        // called this way, it uses the default address 0x40
        //Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
        // you can also call it with a different address you want
        Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x41);
        // you can also call it with a different address and I2C interface
        //Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(0x40, &Wire);
        
        void setup() {
          Serial.begin(9600);
          Serial.println("GPIO test!");
        
          pwm.begin();
          pwm.setPWMFreq(1600);  // Set to whatever you like, we don't use it in this demo!
        
          // if you want to really speed stuff up, you can go into 'fast 400khz I2C' mode
          // some i2c devices dont like this so much so if you're sharing the bus, watch
          // out for this!
          Wire.setClock(400000);
        }
        
        void loop() {
        
        delay(1000);
          // Drive each pin in a 'wave'
          for (uint16_t waarde=0; waarde <4000; waarde++) {
            pwm.setPin(0,waarde);       // turns pin fully on
            delay(5);
          }
          delay(500);
            for (uint16_t waarde=4000; waarde >0; waarde--) {
            pwm.setPin(0,waarde);       // turns pin fully on
            delay(5);
          }
        }```
        1 Reply Last reply
        0
        • MGHaffM Offline
          MGHaffM Offline
          MGHaff
          wrote on last edited by
          #4

          Thanks, I guess what i am trying to find out is how i get my sensors code to use the Adafruit_PWMServoDriver code to do the same as you than. I would like to control 5 sets of RGB strips by 5 separate V_RGB faders in domoticz using my sensors. But i cant figure out how to get mysensors to tell the PCA9685 chip how to controll the channels.

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


          15

          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