PIC reset, power transmission question

Discussion in 'The Projects Forum' started by russpatterson, Mar 21, 2012.

  1. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    Hello,

    I recently made some LED lights for a friend. The lights do a slow fade between two colors and go on either side of a parking garage entry. See the attached pic for a wiring diagram.

    The issue is that it seems that sometimes one of the uC's reset in the first 300-500 milliseconds. Before they were installed I noticed that when the power supply was first switched on there was sometimes a little stutter. However, this is causing the lights not to be in synch. It's not a real big deal but I'd like for them to stay close to synchronized. I don't have any communication between the two LED lights so I need them to start at the same time.

    I was thinking of putting a 4700uF cap across the hot and ground at each of the lights. Good idea? Should I put a diode between the cap and the power supply as well?

    Any ideas are appreciated.

    [​IMG]
     
  2. DickCappels

    Moderator

    Aug 21, 2008
    2,656
    632
    Not quite sure what you mean by putting a capacitor between hot and ground at each of the lights. If that means putting a large capacitor across the LEDs, then be careful you don't destroy the LED drive circuitry.

    A good way to assure synchronization is to have one output on a "master" chip hold the other in reset for some period after the power is applied. Better yet, use one controller to switch both sets of LEDs.

    From your diagram, it is not apparent where the controllers are located. Maybe with that information and perhaps a more complete schematic, somebody can come up with a really good idea for synchronizing or at least guessing why they aren't synchronized already.
     
  3. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    Thanks for the reply. The LED controller (my PIC) and the drivers are located at each light, 50' apart. I would put the 4700uF cap across the hot and ground of the 16AWG wire that connects to the controller and drivers. I think what is happening is that there is some kind of 'bounce' when the power supply comes on. The lights pull the full 1.4 Amps at startup for a very short time before my PIC powers up and asserts the control line to the drivers to turn them off.

    On my bench the two lights were in synch without problems. If they startup at the same time, they will be in synch because they clocks run at the same speed. I realize there will be a certain amount of drift but for 12 hours that these lights run that drift should not be noticeable. I don't have a control line running the 50' between the lights, just the power line.
     
  4. DickCappels

    Moderator

    Aug 21, 2008
    2,656
    632
    If the PICs get their reset from the rising power supply, putting a large capacitor on the power supply line is likely to increase the risetime of the supply, thus magnifying any differences in the reset thresholds between the two chips. I think you have identified the problem: The LEDs draw max current at power-up before the PICs assert control. Perhaps the best solution is to have the LED drivers power up in the "off" state and not draw current until the PIC tells them to. It may take some rewiring, maybe even adding an inverter, but it would probably solve the problem -much better to solve the problem than to look for work-arounds that might work. If you would like help revising your driver design, you can post it here.
     
    russpatterson likes this.
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    It sounds like one PIC is more susceptible to the power supply "stutter" then the other side. Cheap fast way may be to add a relay at the power supply with normally closed contacts. Power on at the P/S would briefly turn the relay ON then after a short delay back OFF. This lets the "stutter" pass before passing the constant power, and done this way the relay spends most of it's life OFF.

    Out of curiosity, do the LEDs stay in synch if started that way? How long? Sounds like something that is run overnight, so if they start together will they still be together in the morning?
     
    russpatterson likes this.
  6. russpatterson

    Thread Starter Member

    Feb 1, 2010
    351
    16
    To keep the lights in synch, I depend on the clocks in the PICs to run at approximately the same speed. In my tests I found that the two will drift about 500ms over a 24 hour period. I'm sure that number can be different with different chips but the most important time is in the first 8 hours. At 3:00 AM nobody is noticing that kind of thing.

    Originally I wanted to put a radio in so that the 'master' light could indicate the start of the cycle to the 'slave' light. Only I had about a week to make these and didn't have time to integrate the radios.

    Good idea on inverting the control line for the drivers. I'm using Buck Puck drivers that turn the light LED off when +5V is applied to the control pin.
     
Loading...