Maker Pro
Maker Pro

design score broad for a game

I am currently doing micro controller based score broad.
here is the schematic

Capture.JPG

I am going to use large displays.
so I want to use mosfets.
any one know IC that contains 8 mosfets?
also I need another copy of this circuit for other side( for 2 teams-need 2)
so is switching cost effective?
please suggest me a good IC to use here rather than several mosfets

thanks
 

KrisBlueNZ

Sadly passed away in 2015
I suggest you use N-channel MOSFETs driving common anode displays. This allows you to power the displays from a higher DC voltage than the rest of the circuit, which may be necessary if the large displays contain several LEDs in series for each segment. Also, N-channel MOSFETs have better specifications per dollar.

I've looked on Digi-Key for you. Most of the MOSFET "arrays" you can get are dual. There's only one quad, and it's available in THT, but I wouldn't recommend it as it's obviously a niche item, and in any case it's far more expensive than four MOSFETs. For your viewing endurement, it is http://www.digikey.com/product-detail/en/ALD210800APCL/1014-1216-ND/3897259.

Apart from that, Digi-Key's offerings are all dual MOSFETs in 6-pin and 8-pin SMT packages. Your cheapest option is the Diodes Inc DMN6040SSD: http://www.digikey.com/product-detail/en/DMN6040SSD-13/DMN6040SSD-13DICT-ND/3481122. It's much more than you need, but at USD 0.46 for 1-up quantity, it's the cheapest option that I consider suitable.

Edit: Harald's suggestion, the ULN2803, is a good one as well.

You should also consider the integrated LED driver ICs which include shift registers and cathode drivers. A good option here is the TLC5916/5917 which is available in THT and has eight outputs, controlled by a shift register accessed through a serial interface. They can be cascaded, and this greatly reduces the I/O requirement for your MCU. They do current regulation too, so you don't need series resistors.

If you can work with SMT, Digi-Key have a much wider range, including devices with 16 outputs instead of 8. Check out this filter: http://www.digikey.com/product-search/en?FV=fff40027,fff802d4,15c0007,15c0015,15c0016,15c0017,15c001b,15c0026,15c0030,15c0033,112800b6,112800ca,112800cd,112800d2,112800d8,112800dc,112800ea,112800ec,112800f1,112800f8,112800fe,1128012d,11280158,11280160,11280167,1128016d,11280175,11280176,11280177,11280178,11280186&ColumnSort=1000011&stock=1&quantity=1&pageSize=500

Not all of these will be suitable. You need to download the data sheets and check them out. I downloaded the data sheet for the first one and discovered that it can only drive LEDs from a 5V rail. That's not suitable if you have multiple LEDs per segment in series. There may be other characteristics of those devices that may make some of them unsuitable too. Check the data sheets carefully.

Unless you're making a batch of these displays, the cost of getting them sent from the USA will probably dwarf the unit cost, and you might be better off to use something that's available locally.
 
thanks you for all this.
I need comments about my programming part.
can I upload it here or need to use micro controller section.
I like to share it .
thanks
 

Harald Kapp

Moderator
Moderator
I will move this thread to the mcrocontrollers forum, then you can post your code within this thread.

Harald
 
/*
**** PIC 16F877 FOR NET BALL SCORE BOARD CONTROL SYSTEM ***



LIMITATIONS
* Maximum number - 99
* No of LED - 5


*/
#include <16f877.h>// including the header file of the microcontroller
#fuses XT,NOWDT,NOPROTECT
#USE delay(clock=4000000)

#define SevenSeg1_A pin_C0 // Define pins of the seven segment display.
#define SevenSeg1_B pin_C1
#define SevenSeg1_C pin_C2
#define SevenSeg1_D pin_C3
#define SevenSeg1_E pin_C4
#define SevenSeg1_F pin_C5
#define SevenSeg1_G pin_C6


#define SevenSeg2_A pin_D0
#define SevenSeg2_B pin_D1
#define SevenSeg2_C pin_D2
#define SevenSeg2_D pin_D3
#define SevenSeg2_E pin_D4
#define SevenSeg2_F pin_D5
#define SevenSeg2_G pin_D6


#define ScoreUp pin_B1
#define ScoreDown pin_B2
#define ScoreReset pin_B3

#define LedUp pin_B4
#define LedDown pin_B5
#define LedReset pin_B6

#define Led1 pin_A0
#define Led2 pin_A1
#define Led3 pin_A2
#define Led4 pin_A3
#define Led5 pin_A5

int Dfirst=0;
int Dsec=0;
int blb=0;

int PrbtnSUp=0;
int PrbtnSDown=0;
int prBlbUp =0;
int prBlbDown =0;

void display(int SevenSegmentIndex , int number);
void saveToEEPROM(int num1 , int num2 , int numBubls);

void loadEEPROM();
void SDown(){
if (Dsec == 0){
Dsec=9;
if(Dfirst == 0){
Dfirst =9;
}
else
{
Dfirst -=1;
}
}
else
{
Dsec -=1;
}
}
void Sup(){
Dsec +=1;
if (Dsec == 10){
Dsec=0;
Dfirst +=1;
}

if (Dfirst ==10){
Dfirst=0;
}
}

void main(){
Dfirst = read_eeprom(0); // loading initial data from the eeprom
Dsec = read_eeprom(1);
blb = read_eeprom(2);

while(1){
if (input(ScoreUp) != PrbtnSUp ){ // check wether score up button pressd ?
PrbtnSUp = input(ScoreUp);
if( PrbtnSUp == 1){
Sup();
}
}

if (input(ScoreDown) != PrbtnSDown ){ // check wether score down button pressd ?
PrbtnSDown = input(ScoreDown);
if(PrbtnSDown == 1){
SDown();
}
}

if (input(ScoreReset) == 1){ // reset
Dfirst =0;
Dsec=0;
}



/// check for LED bulbs
if (input(LedUp) != prBlbUp ){
prBlbUp = input(LedUp);
if( prBlbUp == 1 && blb <5){
blb++;
}
}

if (input(LedDown) != prBlbDown ){
prBlbDown = input(LedDown);
if( prBlbDown == 1 && blb >0){
blb--;
}
}

if (input(LedReset) ==1){
blb=0;
}


// outputs
if (blb==1){
output_high(Led1);
output_low(Led2);
output_low(Led3);
output_low(Led4);
output_low(Led5);
}
else if (blb==2){
output_high(Led1);
output_high(Led2);
output_low(Led3);
output_low(Led4);
output_low(Led5);
}
else if (blb==3){
output_high(Led1);
output_high(Led2);
output_high(Led3);
output_low(Led4);
output_low(Led5);
}
else if (blb==4){
output_high(Led1);
output_high(Led2);
output_high(Led3);
output_high(Led4);
output_low(Led5);
}
else if (blb==5){
output_high(Led1);
output_high(Led2);
output_high(Led3);
output_high(Led4);
output_high(Led5);
}
else if (blb==0){
output_low(Led1);
output_low(Led2);
output_low(Led3);
output_low(Led4);
output_low(Led5);
}

display(1, Dfirst);
display(2,Dsec);
delay_ms(10);


// save in eeprom
write_eeprom(0, Dfirst);
write_eeprom(1, Dsec);
write_eeprom(2, blb);
}

}

// METHODS
void display(int SevenSegmentIndex , int number){
// This method get the ID of the seven segment and display the number which comes in
if (SevenSegmentIndex == 1){
// Seven Segment1
if (number ==0){
// display '1'
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_high(SevenSeg1_E);
output_high(SevenSeg1_F);
output_low(SevenSeg1_G);

}
else if (number ==1){
// display '1'
output_low(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_low(SevenSeg1_D);
output_low(SevenSeg1_E);
output_low(SevenSeg1_F);
output_low(SevenSeg1_G);

}
else if(number ==2){
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_low(SevenSeg1_C);
output_high(SevenSeg1_D);
output_high(SevenSeg1_E);
output_low(SevenSeg1_F);
output_high(SevenSeg1_G);
}
else if (number ==3){
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_low(SevenSeg1_E);
output_low(SevenSeg1_F);
output_high(SevenSeg1_G);

}
else if (number ==4){
output_low(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_low(SevenSeg1_D);
output_low(SevenSeg1_E);
output_high(SevenSeg1_F);
output_high(SevenSeg1_G);

}
else if (number ==5){
output_high(SevenSeg1_A);
output_low(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_low(SevenSeg1_E);
output_high(SevenSeg1_F);
output_high(SevenSeg1_G);

}
else if (number ==6){
output_high(SevenSeg1_A);
output_low(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_high(SevenSeg1_E);
output_high(SevenSeg1_F);
output_high(SevenSeg1_G);

}
else if (number ==7){
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_low(SevenSeg1_D);
output_low(SevenSeg1_E);
output_low(SevenSeg1_F);
output_low(SevenSeg1_G);

}
else if (number ==8){
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_high(SevenSeg1_E);
output_high(SevenSeg1_F);
output_high(SevenSeg1_G);

}
else if (number ==9){
output_high(SevenSeg1_A);
output_high(SevenSeg1_B);
output_high(SevenSeg1_C);
output_high(SevenSeg1_D);
output_low(SevenSeg1_E);
output_high(SevenSeg1_F);
output_high(SevenSeg1_G);

}


}
else{
// Seven Segment2
if (number ==0){
// display '1'
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_high(SevenSeg2_E);
output_high(SevenSeg2_F);
output_low(SevenSeg2_G);

}
else if (number ==1){
// display '1'
output_low(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_low(SevenSeg2_D);
output_low(SevenSeg2_E);
output_low(SevenSeg2_F);
output_low(SevenSeg2_G);

}
else if(number ==2){
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_low(SevenSeg2_C);
output_high(SevenSeg2_D);
output_high(SevenSeg2_E);
output_low(SevenSeg2_F);
output_high(SevenSeg2_G);
}
else if (number ==3){
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_low(SevenSeg2_E);
output_low(SevenSeg2_F);
output_high(SevenSeg2_G);

}
else if (number ==4){
output_low(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_low(SevenSeg2_D);
output_low(SevenSeg2_E);
output_high(SevenSeg2_F);
output_high(SevenSeg2_G);

}
else if (number ==5){
output_high(SevenSeg2_A);
output_low(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_low(SevenSeg2_E);
output_high(SevenSeg2_F);
output_high(SevenSeg2_G);

}
else if (number ==6){
output_high(SevenSeg2_A);
output_low(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_high(SevenSeg2_E);
output_high(SevenSeg2_F);
output_high(SevenSeg2_G);

}
else if (number ==7){
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_low(SevenSeg2_D);
output_low(SevenSeg2_E);
output_low(SevenSeg2_F);
output_low(SevenSeg2_G);

}
else if (number ==8){
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_high(SevenSeg2_E);
output_high(SevenSeg2_F);
output_high(SevenSeg2_G);

}
else if (number ==9){
output_high(SevenSeg2_A);
output_high(SevenSeg2_B);
output_high(SevenSeg2_C);
output_high(SevenSeg2_D);
output_low(SevenSeg2_E);
output_high(SevenSeg2_F);
output_high(SevenSeg2_G);

}
}

}
 
here is my code.
I need same circuit to drive another 2 displays ( same function-for the team B)
so I have idea to switch between them which can't catch by human eye.

my question is how can I do it?
1.) I know to do it in circuit using mosfets. but how can I do it in program?

2.) do I need to add function for switch debouching? or another method using capacitors

3.) is there any week point in my program

thanks
 
trswipnp.gif

this is the circuit I am going to use as switcher .
BC327 is the transistor,

this is my switching circuit
Capture2.JPG
is there an bug?
 
Which one? the first diagram is correct, the second one is not. You have reversed the emitter and collector.

And, once you have turned it back around, you cannot drive this switching transistor directly from the microprocessor because it takes 12V to turn it off. You need a level shifter in between.

Bob
 
why you say base cannot be connect directly to micro controller?
I think I can off the transistor by giving 5V to base.
I understand that I have done mistake in circuit( reversed emitter and collector)
 
Nope. A PNP transistor is turned on when the base is about 0.6V less then the emitter, opposite of an NPN. Since the emitter is at 12V, any voltage less than 11.4V will have the transistor on. Putting 5V on it (through a resistor of course) will have it on.

Personally, I would have stuck with common cathode displays. Then you can use an NPN or N channel MOSFET to turn it on and off and drive it directly from the microcontroller.

Bob
 
yes. i understood that.
as the level shifter I hope to use LM324 op amp.(as comparator)
Then that can give 12V or 0V according to the 0 to 5v output of micro controller.
is my idea good?
 
It would work, but is overkill. A single transistor would work. Also note that an LM324 can only go to 2V less than the + power rail, so you would need 14V in to get 12V out.

Bob
 
ohh.
so it is not good choice.
is there any mosfet that work as relay.
I need 500mA current through the drain.
so any mosfet do you know which suits for this job
 
Each channel of ULN2804A can sink 500 mA. Use ULN2804A. If you want I can design a circuit for you. It will have 4 digits, 2 digits for one player. I can write a c code for you using mikroC PRO PIC Compiler. I will use multiplexing for the displays.
 
jayanthd, why have you dragged up all of these ancient threads? Have you not looked at their dates? In most cases, you're replying to problems that were solved long ago and to people who don't even frequent the forums any more.
 
Ok. Old Steve. I am new to this forum and I didn't see the dates of those threads. I will look at the dates of the threads in future before replying to it.
 
Ok. Old Steve. I am new to this forum and I didn't see the dates of those threads. I will look at the dates of the threads in future before replying to it.
Yes, it's generally a good idea. ;)
I thought that perhaps you had a vested interest in mikroC, too, since you mention it so often.
 
I thought that perhaps you had a vested interest in mikroC, too, since you mention it so often.

I just love mikroC Compilers. I use them for my professional work. I work in a company and we use microchip and mikroElektronika Compilers and softwares. I mainly use mikroC PRO Compilers and hence I can only provide mikroC PRO, XC8, C18, Hi-Tech PICC and PICC18 codes. At out company we also use CodeVisionAVR, Atmel Studio for AVR programming.

An out of topic question Old Steve. I have done some PIC and AVR projects. In which section can I post them ?
 
Top