Rope Light - Chaser Controller

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
Hello,

I'm back again, I'm designing a simple rope light chaser controller and wanted to post my progress so far.

Attached is a schematic of the design, I'm just about to move onto the breadboarding phase.

Once I've completed the breadboarding and verified the design, I will design a PCB for the circuit.

It has 3 channels and swiches between them in sequence. If auto direction change is enabled, it periodically changes direction too and there is a switch so that you can manually change the direction, if desired.

Each channel can draw up to 500mA.

Let me know what you think or if there are any suggestions? Apologies for the messy schematic.

Kind Regards

Edward
 

Attachments

Last edited:

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
@Bernard It's not too complex and I should be able to get it onto a relaively small PCB. Probably aiming for something that is no bigger than 90mm x 120mm if I can, as there is a nice case that it will fit in if I can make it that size :)
 

Sensacell

Joined Jun 19, 2012
3,447
The relay to change the direction seems like an awkward and expensive solution, both in terms of component cost and board size.
 

Bernard

Joined Aug 7, 2008
5,784
The manual SW, SW3, reverse is wasted effort unless the automatic reverser is also disabled.
The electro magnetic relay can be replaced with a 4066 digital switch & one stage of ULN2003.
 

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
The relay to change the direction seems like an awkward and expensive solution, both in terms of component cost and board size.
I know what you mean, I just couldn't think of an easier way of doing it. I did originally consider using more of the outputs of the 4017 and getting it to chase with a couple of diodes, but this results in a chase which bounced, rather than one way for a period of time and then the other for a period of time.

The manual SW, SW3, reverse is wasted effort unless the automatic reverser is also disabled.
The electro magnetic relay can be replaced with a 4066 digital switch & one stage of ULN2003.
@Bernard, the manual switch, SW3 does seem like wasted effort, but I included it for when the automatic reversing circuit is disabled. The idea being than SW1 and VR1 are the same component and SW2 and VR2 are also the same component. One of them turns the circuit on and sets the speed of the chase, then the other turns on the automatic reversing circuit and sets the length of time before it reverses.

I've never come across the 4066 before, but it certainly seems like a nice solution and it's significantly cheaper than a DPDT relay... infact its 10 times cheaper! I'm a little unsure as to how/why it needs connecing to one of the stages of the ULN2003 though?
 
Last edited:

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
Scratch the last comment about why I needed to use one of the stages on the ULN2003. I now realise that I essentially have two 'inputs' to the bilateral switch when it is wired up as a DPDT and need to use an inverter to drive the two 'inputs'.

I've attached an updated schematic, but wasn't sure if the 1k pull-up resisor R6 was correct? Or if it should be a different value? It simulates as I expect it to. Without the pull-up resistor, it doesn't switch properly.
 

Attachments

Last edited:

Sensacell

Joined Jun 19, 2012
3,447
Nice- much better.

Look carefully at the specs for the 4066 input thresholds- the LOW output of the ULN2003 is not going to be 0 volts, because it's a darlington output.

The easy fix is just to use an NPN transistor as the inverter, if the threshold is too close.
 

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
Look carefully at the specs for the 4066 input thresholds- the LOW output of the ULN2003 is not going to be 0 volts, because it's a darlington output.

The easy fix is just to use an NPN transistor as the inverter, if the threshold is too close.
@Sensacell, please would you mind having a look at this datasheet for some that I've ordered? I can't seem to work out what the control input voltage/specifications are: http://docs-europe.electrocomponents.com/webdocs/14f5/0900766b814f59cc.pdf

I get confused when the terms: Vss, Vdd and the likes are used! I know for a fact that 12V is within the supply voltage rating, but I don't know whether the control pins, 5, 6, 12 and 13 are correct.

I look forward to hearing from you.

Kind Regards

Edward
 
Last edited:

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
@Sensacell, thank you, it mentioned on page 2 about the control input voltage being: VSS − 0.5 to VDD + 0.5 and that 'Exceeding any of the absolute maximum ratings, even briefly, lead to deterioration in IC performance or even destruction.' it was that bit that was confusing me. Because then on page 3 it mentions that the typical control high voltage at 25C is 5.5 and typical control low voltage at 25C is 4.5.
 

Bernard

Joined Aug 7, 2008
5,784
For me I just means keep input signals between 0 V & Vdd, 0 to3 V for low, 7 to 12 V for high.
R6 can be any thing from 1k to 1M, I'd use anything from 10k to 100k, more likely 9k1 because of
no. on hand.
 

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
For me I just means keep input signals between 0 V & Vdd, 0 to3 V for low, 7 to 12 V for high.
R6 can be any thing from 1k to 1M, I'd use anything from 10k to 100k, more likely 9k1 because of
no. on hand.
@Bernard, thank you, I think I will put a 10K resistor in there. I've not had chance to breadboard it yet and I'm waiting on an order of some bilateral switches, but when they arrive, I will be sure to test it, before I start the PCB design.
 

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
Since you have spare IC4's, I would parallel two for each channel. Note that specs. show readings only up to 350 mA..
Hi @Bernard, the darlington array that I have at the moment says 'Collector Current - Continuous: 500mA' on page 2 of the attached PDF, so this should suffice with just one, rather than two in parallel?

I'm more than happy to wire them in parallel if you think that's the best approach? I assume I would be commoning pins 1+2 and also 15+16 to use as one driver, etc. Leaving pins 7 and 10 for the driver which I'm using as an inverter?

I've attached an updated schematic.

Kind Regards

Edward
 

Attachments

dannyf

Joined Sep 13, 2015
2,197
wouldn't it be easier if it is done with a mcu?

even if you go down the path of discrete logic, using relays seems counter-intuitive.
 

Thread Starter

edwardholmes91

Joined Feb 25, 2013
210
wouldn't it be easier if it is done with a mcu?

even if you go down the path of discrete logic, using relays seems counter-intuitive.
@dannyf The component count using a microcontroller would certainly be much smaller, but I'd still need driver circuitry and I find it takes some of the fun out of it :)

I'm not using the relay anymore, my latest designs include the use of a bilateral switch, wired as a DPDT switch.
 

dannyf

Joined Sep 13, 2015
2,197
another approach you may want to take is to use an oscillator + binary counter to count the steps, and then decode them.

so two bits will generate four outcomes: 0, 1, 2, 3. outcome 1 will turn on the first led / 3rd led, 2 2nd led / 2nd led, and 3 1st/3rd led, .... another signal can decide whether led 1 is connected to outcome 1 or outcome 3, ...
 

Bernard

Joined Aug 7, 2008
5,784
Same result at the cost of one more IC. But if more than 10 outputs are needed then could use a 74HC154 for 16 outputs. Looks like schematic on post # 15 is good to go.
 

dannyf

Joined Sep 13, 2015
2,197
but I'd still need driver circuitry and I find it takes some of the fun out of it :)
it depends on your definition of fun, :)

I wrote the following years ago to demonstrate how easy it is to output variable patterns - for chase lights or christmas lights. I stripped out the user-defined portion and just put in a simple chaser routine.

Code:
//chaser lights - support up to 32 leds and user defined patterns
//simplified: no user defined patterns

//hardware configuration
#define DLY_PIN         0                //analog input pin for delay adjustment
#define LED_DIR         9                //digital input pin for chasing direction
#define PIN_NUM            5                //number of chaser leds - up to 32
#define DLY_STARTUP        1                //start-up delays, in ms
//end hardware configuration

//global defines
#define LED_TOP         (1ul<<((PIN_NUM)-1))
#define LED_BOTTOM      (1ul<<0)

//global variables
const uint8_t led_pins[PIN_NUM]={
    4, 5, 6, 7, 8
};

//reset the pins
//turn all pins on at power-on - self-test
void chaser_init(uint16_t dly) {
  uint8_t i;

  digitalWrite(LED_DIR, HIGH); pinMode(LED_DIR, INPUT);        //direction pin as input, pull-up enabled
  //set up the output pins
  for (i=0; i<PIN_NUM; i++) {
    digitalWrite(led_pins[i], HIGH);     //turn an led on
    pinMode(led_pins[i], OUTPUT);         //turn the pin to output
    delay(DLY_STARTUP);                 //waste some time
    digitalWrite(led_pins[i], LOW);    //turn the led off
    }
}

//display chaser
//can handle up to 32 leds 
//dly: delays in ms
void chaser_display0(uint32_t dly) {
  static uint32_t time_next=0;                //next time display to be updated, in ms
  static uint16_t led_pattern = LED_BOTTOM;    //led pattern
  uint8_t i;                                //led index
  //test for overflow
  if (time_next < millis()) {
    time_next += dly;                            //update the next time for the display to be updated
   
    //update display
    for (i=0; i<PIN_NUM; i++) {digitalWrite(led_pins[i], (led_pattern & (1ul<<i))?HIGH:LOW);}
   
    //update the pattern based on the state of the direction pin
    if (digitalRead(LED_DIR) == HIGH) led_pattern = (led_pattern == LED_TOP)?(LED_BOTTOM):(led_pattern << 1);
    else led_pattern = (led_pattern == LED_BOTTOM)?(LED_TOP):(led_pattern>>1);
  }
}
void setup() {
  // put your setup code here, to run once:
  chaser_init(10);                          //duration is 10ms
}

void loop() {
  uint16_t led_dly;
  // put your main code here, to run repeatedly:
  led_dly = 50 + analogRead(DLY_PIN) / 5;    //use a pot on DLY_PIN to adjust delay speed
  chaser_display0(led_dly);
}
it is user-configurable to support up to 32 unique lights / leds. I added the speed adjustment function and direction controls -> you could randomize it if you wish.

The simulation below shows the code controlling 5 lights.

the leds are on PD4..7 and PB0; the direction control is on PB1 (digital) and the voltage on PC0 controls how fast the leds run around.

You will still need to have the driver circuitry but the rest is all contained in the mcu / software.

For this type of mixed signal, low speed and flexible logic, mcus excel.chaser-ledx5.PNG
 
Top