Make 16-Channel Constant Current LED Sink Driver for 6 digit 7 segment Clock

Hello everybody !

I am asking for your help with a project, I would like to integrate an Arduino to control an existing LED Clock 7Segments . The LED segments operate on 12 volts and are controlled by 3 16-Channel Constant Current LED Sink Driver controllers (JXI5020) (Work on 3.3v)

The clock at actually controlled by a AT32F421K8T7 controller, But i want to Bypass It.

Each controller manages the display of 2 digits.

But there you go, I can't find any library to manage these controllers.

Do you have any avenues for research or ideas?

There is the doc of the controllers : https://www.micros.com.pl/mediaserver/UIJXI5020gf_0001.pdf

There is some pics of the board :




Thanks a lot for your help !

Hia!

These controllers ( JXI5020) are shift-registered biased. They have a data in and a clock pin, every time you pulse the clock signal the chip will read the data pin, shift all the values over one(hence the shift) and kick the last value out.

This makes interfacing with them really easy, you probably dont need a library. Just disconnect the pins 2 and 3 (looks like you can pull R1 and R2 but double check) and solder in two leads from your micro controller.

Here is some code that should write something to the display

#define clk 12  //define the pins for clk and data here
#define data 10


void setup() {
  pinMode(clk, OUTPUT);
  pinMode(data, OUTPUT);

  digitalWrite(data, false);
  digitalWrite(clk, false);
}

void loop() {
  //will continuely update display alternating on/off segments
  digitalWrite(data, !digitalRead(data));//toggle data
  delay(1);

  digitalWrite(clk, true);//pulse clk
  delay(1);
  digitalWrite(clk, false);

  delay(250);//delay between updates
}

Thanks a lot for your answer !
In fact, the code you gave me causes all the segments to light up, which end up going out one by one. and the extinction delay between each segment changes when I change the delay (250).

Do you have an idea to send some numbers?

Glad that worked!

In order to write numbers you need to first figure out which output is connected to which segment of the display. Once you have that you can implements some code that looks like this:

#define clk 12  //define the pins for clk and data here
#define data 10


int number[] = { 1, 1, 1, 0, 1, 0, 0 };  //define diffrent numbers here

void pulseClk() {//toggles clk
  digitalWrite(clk, true);  //pulse clk
  delay(1);
  digitalWrite(clk, false);
}

void sendNumber(int segments[]) {//writes out the given number to the display
  for (int i = 0; i < 7; i++) {
    digitalWrite(data, segments[i]);
    pulseClk();
  }
}

void setup() {
  pinMode(clk, OUTPUT);
  pinMode(data, OUTPUT);

  digitalWrite(data, false);
  digitalWrite(clk, false);

  sendNumber(number);
}

void loop() {
}

If you change the 1s and 0s in the array you can get different segments to display

Great, it works! Thanks to your code, I was able to identify the different segments! I can display the numbers, however, the controller needs to manage 16 segments at the same time to display a correct number. Is there a function that would allow me to add the numbers to send them to the controller?

#define clk 12  //define the pins for clk and data here
#define data 10


int number0[] = { 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number1[] = { 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number2[] = { 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number3[] = { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number4[] = { 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  
int number5[] = { 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number6[] = { 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number7[] = { 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number8[] = { 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 
int number9[] = { 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };   //define diffrent numbers here

void pulseClk() {//toggles clk
  digitalWrite(clk, true);  //pulse clk
  //delay(1);  // I have remove this, beacause it's create a little
  digitalWrite(clk, false);
}

void sendNumber(int segments[]) {//writes out the given number to the display
  for (int i = 0; i < 16; i++) {
    digitalWrite(data, segments[i]);
    pulseClk();
  }
}

void setup() {
  pinMode(clk, OUTPUT);
  pinMode(data, OUTPUT);

  digitalWrite(data, false);
  digitalWrite(clk, false);

  sendNumber(number0);
  delay(500);
    sendNumber(number1);
  delay(500);
    sendNumber(number2);
  delay(500);
    sendNumber(number3);
  delay(500);
    sendNumber(number4);
  delay(500);
    sendNumber(number5);
  delay(500);
    sendNumber(number6);
  delay(500);
    sendNumber(number7);
  delay(500);
      sendNumber(number8);
  delay(500);
      sendNumber(number9);
  delay(500);
}

void loop() {
}

Excellent!

Unfortunately no, the way these work you cant update part of it at a time, you have to update the whole thing. This shouldn't be too much of a problem though, they should be fast enough that you cant notice the delay.

I see you modified the code to update the whole controller at once. You will have to change it to update only the 8 segments you need at a time, then feed in two number every time you update it. You will also probably need a 'blank' number with all 0s to turn off the numbers when you dont need them.

1 Like

Thanks a lot for your help !

1 Like

The part has a latch pin (LE, pin 4) and so should operate much like a 74HC595 (basically, 3-pin control) - this means no flashing while the new data is shifted in. Old data is output until LE is toggled then new data is presented immediately, no intermediate display.  Refer to the timing diagram on manual page 4.

See shiftOut() - Arduino Reference for an introduction to this idea.

As far as combining the numbers, this library "may" do a lot of the work for you:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.