Go Down

Topic: Controlling multiple 7 segment displays (Read 253 times) previous topic - next topic

harisudharsan

Hi All,


I am trying to create a digital clock with ability to display Time (HH:MM:SS), Temperature (##), Humidity (##) , day of week (one LED),  month and year in DD:MM:YYYY.

I am planning to use the below sensors. (Please let me know if in case there is a better option)

DHT22 - Temperature and Humidity (Prefered this over SHT11 due to its accuracy)
DS3231 - RTC (Prefered this over DS1307 due to its accuracy).

Here comes my main question... So for displaying purpose totally it comes to 18 7 segment displays. and 1 LED for displaying the day of the week.

(Plus, ofcourse the 4 pairs of LED for displaying the ":" .. Which is not an issue at the moment)

I have browsed through numerous videos. I see only way to control 1 - 4  7 seg display (By multiplexing/charliplexing). But i am not sure if we can control 18 7 segment displays.   Please let me know if this is achievable ?? Have any one tried this before ? ..

I am tring to achieve this with 1 arduino.. I hope the number of input ports for the sensors should be available. But i am not sure about the output ports.

With Regards,
S.Sudharsan


CrossRoads

Easy way is with 3 MAX7219 chips, each driving up to 8 common cathode displays (24 total, or 18 and lots of individual/pairs of LEDs for : and whatever). Each has 8 data registers, you send the data to each register.
The 3 can be daisychained, or each written to individually, with SPI.transfer - SCK, MOSI, CS, CS1, CS2 if using three chip selects. Quite easy to use with no need to get bogged down in a library.
Displays can be single digit, dual digit, quad digit.  All anode get connected in parallel for a group of up to 8 digits,  each digit has its own common cathode. The MAX7219 can decode 0-9, H,E,L,P with  built in decoding, or you can use No Decode mode and make your own fonts: 0-9, -, A,b,c,C,d,E,F,g,h,H,i,J,L,n,o,O,P,S,u,U,etc.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

#2
Aug 20, 2015, 06:45 pm Last Edit: Aug 20, 2015, 06:50 pm by CrossRoads
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

harisudharsan

Thanks CrossRoad.. !!

I think you have answered almost of my question.. Thanks for the extra tips !! :)

At this point I am eagerly awaiting for my gear. Let me try what ever you have said..and circle back in case of any problem

Thanks & Regards,
S.Sudharsan

harisudharsan

#4
Aug 23, 2015, 05:55 pm Last Edit: Aug 23, 2015, 10:00 pm by harisudharsan Reason: Adding some more questions
Friends,

I got a bit confused today by a video. (may be my bad interpretation of it)

First let me tell you what I am trying to achieve.  I am buying an arduino with the intention of using it as a programmer to program other chips. (bought a PIC16F873A (28 pin) ). My intention is to program this chip and permanently solder it to the circuit. Then will use a fresh PIC16F873A to burn a different program for different purpose.

So now my questions areā€¦

1.   I see videos mentioning to use AVR. Does AVR and PIC are completely different.? I see them constantly mentioning that AVR is from Amtel and PIC is from MicroChip. So does that mean Arduino cannot be used to program a PIC microcontroller ??

2.   What is the difference between an Arduino and a PIC KIT 2 ?

3.   Does bootloader necessarily have to be flashed into an PIC to make it usable ? if NO, then what is the advantages of flashing a boot loader and not ?

4.   When I am still waiting for my gear to arrive, I am expecting that the arduino that I am buying is going to have the arduino boot loader flashed. But wanted to know if there is a way to verify if it is flashed properly ?

5.   Once ISP sketch is flashed into arduino, how to revert back ? (Meaning, using the arduino as a programmer, how to use it as a old arduino to interface with various shields.)


Thanks in advance !

harisudharsan

I have 2 more questions..

6.   If I am multiplexing ~20 7 segment displays, will it incur flickering or dullness ?

7.   Does multiplexer and shift registers are same or they are different ??


Can somebody kindly clarify my questions ?

Regards,
S.Sudharsan

PaulRB

#6
Sep 01, 2015, 06:19 pm Last Edit: Sep 01, 2015, 06:23 pm by PaulRB
1.   I see videos mentioning to use AVR. Does AVR and PIC are completely different.?
Yes, they are different.

I see them constantly mentioning that AVR is from Amtel and PIC is from MicroChip. So does that mean Arduino cannot be used to program a PIC microcontroller ??
Correct, it cannot be used. Theoretically, a person who was highly expert in both AVR and PIC could achieve this, but I'm not sure why they would want to.

3.   Does bootloader necessarily have to be flashed into an PIC to make it usable ? if NO, then what is the advantages of flashing a boot loader and not ?
I don't know about PIC bootloaders, but I can answer the same question for AVR/Arduino. No, you can program an AVR chip that has no bootloader. You must use a separate programmer for this such as USBasp or another Arduino running the ArduinoISP sketch. The advantage of having a bootloader is that you do not need a separate programmer, you can use an ordinary USB-TTL adaptor, which you will probably need anyway to communicate with the chip when you have uploaded the program. Most Arduino have a USB-TTL converter built-in. Some do not, such as Pro Micro.

4.   When I am still waiting for my gear to arrive, I am expecting that the arduino that I am buying is going to have the arduino boot loader flashed. But wanted to know if there is a way to verify if it is flashed properly ?
Try uploading a simple sketch like "Blink". If you cannot upload, the bootloader may not have been properly flashed.

5.   Once ISP sketch is flashed into arduino, how to revert back ? (Meaning, using the arduino as a programmer, how to use it as a old arduino to interface with various shields.)
If you mean the ArduinoISP sketch, remove the reset-blocking capacitor and upload your new sketch.

6.   If I am multiplexing ~20 7 segment displays, will it incur flickering or dullness ?
If you design and code it correctly, it will not be dull or flicker. If you do not design and code it correctly....

7.   Does multiplexer and shift registers are same or they are different ??
They are different. For example on a multiplexer, only one output at a time will be active. On a shift register, any combination of outputs can be active. However, some circuits could be designed with either type of chip to perform some (but not all) functions.

Paul

harisudharsan

Hi Paul,

Thank you very much for the reply !

Can you kindly provide more info / a comprehensive link on how to multiplex multiple 7 seg displays ?

In all the examples i see, they do it with only 1 7seg displays. I am unable to figure out how to do the same thing in case of multiple 7 segment.


Thanks in advance and Regards,
S. Sudharsan

PaulRB

Can you kindly provide more info / a comprehensive link on how to multiplex multiple 7 seg displays ?
I would give the same advice as Crossroads gave to you. Use several max7219 chips. You seemed happy with that advice before. Is there a now a reason that you cannot use these chips?

Aadarsh

Hi harisudharsan

I'll suggest a book that is available in India

"The AVR Microcontroller and Embedded system" by Muhammad ali Mazidi,Sarmad Naimi,Sepehr Naimi released by Pearson.In that book a separate chapter for interfacing MAX7221 with AVR microcontroller is explained nicely.I learn my AVR assembly and everythink form that book.If you find time try to refer this book.You will understand the concept clearly.

I think that in ebay it costs about 125 rupees but If you visit in richie street(Mount road,Chennai),you will surely get this chip and also will be cheaper that 125 rupees.Either you buy a MAX7221 or MAX 7219.It's okay.


harisudharsan

Hi Paul,

I am still happy with that advise. I was looking for some connection diagram to connect multiple 7 seg displays.

Now, in my today's search in my local market I found that MAX7219 is not available.  

On my quick google ing, I have seen many people trying out similar thing with 74HC595.  But unfortunately 74LS595 is only available to me.  Looks like there is a speed lag in LS  (Low speed).

So now I am confused between MAX7219 vs 74HC595 vs 74LS595  . Which would be a better option ?

I see all 3 of them are available online. But it is gonna take some time for shipment too. Can you kindly let me know if it would be really worthy waiting the time ? or the difference between them is not significant ?

I understand that the programming part will have to change depending on what chip i opt to use.

Regards,
S.Sudharsan

PaulRB

Get the max7219.

74ls/hc595 can be used (both are much faster than needed for displays) but neither chip is a good choice for displays because their current capabilities are low, especially if you are multiplexing. These chips are general purpose logic chips and were not designed for displays. If you used them, you would need more components like series resistors for the segments and transistors for the digit connections on the displays. Also your code becomes much more complicated because the Arduino must perform the multiplexing.

By contrast, max7219/7221 was designed especially for displays so has a higher current capability, minimises the number of extra components needed and keeps your sketch simple by performing the multiplexing so that the Arduino does not have to do this.

harisudharsan

Hi Paul,

Thanks for your Inputs and your patience to answer my question !!  :)

In the below link, it is mentioned that the length of wire should not go beyond 10cm as it might cause error. Is that because of the internal resistance offered by the wire ??

http://playground.arduino.cc/Main/MAX72XXHardware

And I assume the difference between 7219 and 7221 is   ONLY   the EM interference it is going to cause in case of the audio ckts. ? . I do not have to worry about it if the project i am working is not a audio based project or any thing that involves sensitive decices ??    Please let me know if it is not.

Thanks in advance,
S. Sudharsan

PaulRB

You can use either max7219 or 7221, it does not matter. 7219 are more common and usually cheaper.

Its not the resistance of the wires but their capacitance. The link you posted does not say you cannot go beyond 10cm, it says that it is possible there could be some problems. You must experiment to find out. Begin with sort wires, then increase the length until you reach your desired length or problems begin. If you have problems, you can try 2 techniques. One technique is to slow down the data rate. The second is to add line driver chips. How long do your wires need to be?

Go Up