Arduino Uno controlling a 7-Segment LED board

First off, I am a newbie to the Arduino. I purchased an Arduino Uno kit, a couple of LED boards, and have went through a few basic tutorials. I am not proficient in C+ programming, but understand some programming.

LED Board: Sure Electronics DE-DP22811. Here is a PDF that shows the board and some sample code: http://www.sure-electronics.net/download/DE-DP22811_Ver1.0_EN.pdf

The connectors on J1 don't really match what I find on the Arduino, but I did find a short video that shows it working, however there is no code or wiring instructions to help. So.. I am asking here.

Based upon the image above, how would I connect this to the Arduino board, and what changes in the sample code (provided in the PDF above) would need to be made to get this to work?

My goal is to create a portable scoreboard using two of these LED boards connected to the Arduino that would show a separate numeric value (0-99) based upon four button inputs.

Thanks for looking!

You need to connect pin 1 to a 12V supply and have the ground of the supply connected to the arduino ground and pins 3, 4 , 5 ,6 & 8 on that connector. Then pin 7 should be connected to s PWM enabled pin on the Arduino.
Finally pin 9 to an arduino pin you call data and pin 10 to a pin you call clock, then follow the shift out tutorial.

With the pin 7 being the latch, and ignore the 1uF capacitor that tutorial uses ( it is a big error ).
Note that you might have to invert the logic sense of the latch. That is where the sketch says make it high, you make it low and the other way round.

OK..

So I have it connected as such:

LCD Board J1:
Pin 1: 12V
Pin 3, 4, 5, 6, 8: GND provided by the 12V power. All these pins are strapped to PIN GND on the Arduino
Pin 7: to PIN 3 on Arduino (LATCH)
Pin 9: to PIN 9 on Arduino (CLOCK)
Pin 10: to PIN 10 on Arduino (DATA)

I programmed the code below figuring the value 24 is the value for a '0' using the Common Anode required values. But the LCD display just flickers and then turns off. If I were to remove the GND to the Arduino board, the display comes back on but still just flickers. See the video I posted at the bottom of this reply.

I am lost, and hoping to get on track. At this moment I am just trying to control each individual LED using a number from 0-9.

Thanks!!


void setup(){

  • pinMode(3, OUTPUT);//Latch*
  • pinMode(9, OUTPUT);//Clock*
  • pinMode(10, OUTPUT);//Data*
    digitalWrite(3, LOW);
    }
    void loop(){
  • digitalWrite(3, LOW);*
  • shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)*
  • shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)*
  • shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)*
  • shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)*
  • digitalWrite(3, HIGH);*
  • delay(5);*
    }

But the LCD display just flickers and then turns off

Then invert the way the latch pulses like I said.

void loop(){
  digitalWrite(3, HIGH);
  shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)
  shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)
  shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)
  shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)
  digitalWrite(3, LOW);
  delay(5);
}

If I were to remove the GND to the Arduino board,

Then any results you get are totally meaningless and you risk damaging your arduino.
Do not ever remove the ground from a setup.

Please read the how to use the forum sticky post for how to post code correctly.

Arduino Reference shows that the shiftOut function is arranged
shiftOut(dataPin, clockPin, bitOrder, value)

In your sketch you declared"

  • pinMode(9, OUTPUT);//Clock*
  • pinMode(10, OUTPUT);//Data*
    and then you have
    shiftOut(9, 10,MSBFIRST, 24);//(datapin, clockpin, data)
const byte Datapin = 9;
const byte Clock = 10;
const byte Dim = 3;

void setup()
{
  pinMode(Datapin,OUTPUT); // Data
  pinMode(Clock,OUTPUT); // Clock
  digitalWrite(3,LOW);
}

void loop(){
  digitalWrite(3, LOW);
  shiftOut(Datapin,Clock,MSBFIRST, 6);//(datapin, clockpin, data) 
  shiftOut(Datapin,Clock,MSBFIRST, 91);//(datapin, clockpin, data)
  shiftOut(Datapin,Clock,MSBFIRST, 79);//(datapin, clockpin, data)
  shiftOut(Datapin,Clock,MSBFIRST, 102);//(datapin, clockpin, data)
  digitalWrite(3, HIGH);
  delay(5000);

  digitalWrite(3, LOW);
  shiftOut(Datapin,Clock,MSBFIRST,102);//(datapin, clockpin, data) 
  shiftOut(Datapin,Clock,MSBFIRST, 79);//(datapin, clockpin, data)
  shiftOut(Datapin,Clock,MSBFIRST, 91);//(datapin, clockpin, data)
  shiftOut(Datapin,Clock,MSBFIRST,6);//(datapin, clockpin, data)
  digitalWrite(3, HIGH);
  delay(5000);
}

Make sure you get the Clock and Data routed proper.
I didn't read up on how that "DIM" pin is supposed to go.

alias to Datapin, then utilized

Just a point. Why have you used 4 shift out calls for only two digits?

Wow! Thanks Grumpy_Mike!! You put me in the right direction! The Latch was reversed. The ground was needed and the display no longer flickers.

The code was changed to allow ease of figuring out the LED values and to correct the data and clock pin assignments. I found the first bit sent will stay on the first LED. Since my LED board has 4 panels, I needed four separate shiftout assignments to control all the LEDs.

As for the data in each LED, I was using values from a different device to create the numbers. On this LED board, the value for each LED segment was figured out by trial and error:


const int ledClockPin = 10;
const int ledDataPin = 9;
const int ledLatchPin = 3;
char bitSent = 'MSBFIRST';
int numbers[11] = {126, 12, 182, 158, 204, 218, 250, 14, 254, 222, 0}; //0 will turn off the display

void setup(){
pinMode(ledLatchPin, OUTPUT);//Latch
pinMode(ledClockPin, OUTPUT);//Clock
pinMode(ledDataPin, OUTPUT);//Data
digitalWrite(ledLatchPin, HIGH);
}

void loop(){
digitalWrite(ledLatchPin, HIGH);
shiftOut(ledDataPin, ledClockPin, bitSent, numbers[3]);//(datapin, clockpin, data)
shiftOut(ledDataPin, ledClockPin, bitSent, numbers[2]);//(datapin, clockpin, data)
shiftOut(ledDataPin, ledClockPin, bitSent, numbers[1]);//(datapin, clockpin, data)
shiftOut(ledDataPin, ledClockPin, bitSent, numbers[0]);//(datapin, clockpin, data)
digitalWrite(ledLatchPin, LOW);
delay(10);
}


As for the 2-panel versus 4-panel LEDs; in my final project I will be using two separate 2-panel LEDs. But at this time I only have one 4-panel LED in my possession, and I thought I would start on that.

Thank you for all your help!!

AzBrewsky:
As for the data in each LED, I was using values from a different device to create the numbers. On this LED board, the value for each LED segment was figured out by trial and error:

Take a look at page 4, Table 2-1, of the PDF.

The values in that table doesn't seem to convert correctly.

Example: 0x01 = 2, but 0x02 != 4, etc.. Am I doing my conversions wrong? A good example is the decimal point. I found it is lit with a value of 1, but it shows the hex as 0x80.

but it shows the hex as 0x80

Then you should be sending LSBITFIRST to match those numbers to what you have. Anyway it matters not as you have done the reversing in the bit pattern you devised.

Thanks, took me quite some time to figure this out. I worked with the DE-DP001 board from Sure Electronics. For someone that wants to get this board started I used the following code (counts from 1 to 9999):

const int ledClockPin = 10;
const int ledDataPin = 9;
const int ledLatchPin = 3;
char bitSent = 'LSBFIRST';
int numbers[11] = {126, 12, 182, 158, 204, 218, 250, 14, 254, 222, 0}; //0 will turn off the display

void setup(){
 pinMode(ledLatchPin, OUTPUT);//Latch
 pinMode(ledClockPin, OUTPUT);//Clock
 pinMode(ledDataPin, OUTPUT);//Data
digitalWrite(ledLatchPin, HIGH);
}

void loop(){
int i;
int j;
int k;
int l;

for(i=0;i<=9;++i){
 for(j=0;j<=9;++j){
   for(k=0;k<=9;++k){
     for(l=0;l<=9;++l){
     digitalWrite(ledLatchPin, HIGH);
     shiftOut(ledDataPin, ledClockPin, bitSent, numbers[l]);//(datapin, clockpin, data)
     shiftOut(ledDataPin, ledClockPin, bitSent, numbers[k]);//(datapin, clockpin, data)
     shiftOut(ledDataPin, ledClockPin, bitSent, numbers[j]);//(datapin, clockpin, data)
     shiftOut(ledDataPin, ledClockPin, bitSent, numbers[i]);//(datapin, clockpin, data)
     digitalWrite(ledLatchPin, LOW);
     delay(1000);
}
}
}
}
}

The physical connections used:
Connected the 9 pins adapter to the LED board (at jumper 1) and connected the following pins:
Data to Arduino 9
Dimm to Arduino 3
Power to Arduino Power (5v)
CLK to Arduino 10
All grounds via breadboard to Arduino GND
(1 power left open)

Now going to investigate how to connect to Homeseer to display actual information...

Good for you!

Now read the instructions, go back to your post, select "modify" and mark up your code properly.