Go Down

Topic: Connect 50-60 7seg LED displays (Read 235 times) previous topic - next topic

mickey599

Hi to all,
My colleagues asked me to check out some old equipment that was not working, so I went to check it out. A story is bit sad, guy who was maintain it died and company that manufactured also does not exist.
It it's a "long shelf with partitions" with 50 or more, 4-digit LED displays daisy-chained with ethernet cable. Inside is Intel 8051 and MAX3080 as RS 485 + other stuff.

It is very old equipment that is failing over and over, so they asked me weather I can build it from scratch. Problem is (for now) that they cannot change software on PC that communicates with master RS485 and slaves so no change in protocol. I must adopt.

I quickly bought Arduino pro mini (minimal size so it can fit in old housing), 4-digit 7 segment LED (ones with 2+2 wire interface) and RS 485 transceiver board. I was probing protocol and found out that master sends 6 char ASCII string containing ID and 3-digit number that it needs to display. Address is stored in old 27c256 and communication speed is 2400 baud sooo slow…

I made simple sketch that is working for now so that is not issue.
Problems appear in 3 things, long length of ethernet cable that uses it as POE, problems with ethernet connectors, dirt (and condensation moisture in ethernet connectors?) translated that problems to voltage drops and communication problems, so a lot of time they display rubbish and sometimes fail to start at all or at worst they do not change value that master is sending from time to time.

And now questions part:
  1. Since I am building it from scratch would it be wise to stick to RS 485 and only to change connector type, let say to terminal block for RS485, and to use separate cable for power.
What would be your choice for addressing, 8 pin DIP switch or to write address directly in memory?

  2. In future time they will change software and it will be made using protocol I will suggest, so for now I can only think of modbus, only because it has CRC and display (slave) can send feedback so master can check weather data displayed is correct. I don't see much of modbus examples, so I am bit worried because I am unfamiliar with it.

 3. What speed could be recommended as "safe"?
 
 4. And finally, for power, they used 7805 as power regulator, I would prefer a switching one and that is not my field at all so, if you have some ideas, I would like to hear them.

Since this is my first post, sorry in advance if I made some mistakes.
Thanks in advance for all readers/helpers and sorry again for long post.


DrDiettrich

An interesting project :-)

A simple approach would consist of one or more daisy-chains of shift registers or SPI port expanders, to eliminate addressing issues.

Speed, drivers, power and other items depend heavily on your actual environment. I'm old school and would use a linear regulator as supply for each cluster of digits - if accurate voltage is ever required. At slow speed line drivers may be omitted, else RS-485 or similar is a good choice.

zwieblum

+1 for shift registers, that's the easiest way.

lastchancename

...or MAX7219 or similar.
One chip, and a decoupling cap for each 8 digits... away you go.

It may be more effective to spin your own PCB, but if the eBay specials are ok,  you can be up & running tomorrow.
Experienced responders have a nose for laziness, (they were beginners once)... Sure, there are trolls, chest-beaters, and pretenders - but the help you'll get here is about as good as it gets - if you try to help youself!.

david_2018

Quote
1. Since I am building it from scratch would it be wise to stick to RS 485 and only to change connector type, let say to terminal block for RS485, and to use separate cable for power.
What would be your choice for addressing, 8 pin DIP switch or to write address directly in memory?
DIP header pins and shorting  jumpers - doesn't take much space on board, easy to use, cheap.

Quote
2. In future time they will change software and it will be made using protocol I will suggest, so for now I can only think of modbus, only because it has CRC and display (slave) can send feedback so master can check weather data displayed is correct. I don't see much of modbus examples, so I am bit worried because I am unfamiliar with it.

 3. What speed could be recommended as "safe"?
 
Why wait for the future update of the software.  Use an arduino as a master module to receive all the RS485 communications, then implement your own protocol from that arduino to the individual displays.  Any future changes to the software would then only require an update of the master arduino.  As for the speed, how often do the displays need to change, and how many would be changing within a short period of time?  No need to go any faster than necessary, particularly if operating in a potentially electrically noisy environment. 

I would probably look into using wireless for communications, either nRF24L01 or wifi (esp8266 based board or similar), although I'm not familiar enough with those to know if a 50-node network is practical.  Then the only wiring needed would be for power, and no need for a common power supply or wiring between all the modules.  If it could be done with the esp8266-based boards, and you use the 4-pin display modules with built-in tm1637 drivers, that would make for a very compact design.

Quote
4. And finally, for power, they used 7805 as power regulator, I would prefer a switching one and that is not my field at all so, if you have some ideas, I would like to hear them.
My only comment is to find a reliable off-the-shelf regulator, the general opinion I've seen on here is that attempting to design your own switching regulator is well beyond the skill level of most people (and certainly well beyond anything I would ever attempt).   

TheMemberFormerlyKnownAsAWOL

...or MAX7219 or similar.
One chip, and a decoupling cap for each 8 digits... away you go.
Amen.

DrDiettrich

Hex or BCD rotary switches also are small and nice for address selection.

mickey599

Hi to all again, thanks for suggestions.
I read again my post and I see maybe I didn't explain it right. (sorry, english is not my native language)

Every 4*7segment LED, let say one unit, has its own 8051+eprom+MAX3080 + 2 ethernet connectors. And i forgot to mention one big thing, at one end there is only USB to RS485 where software on NCR POS + that converter act as master and rest of them act as slaves.

And this morning i went there and once more to check some things out. I have wide-band SDR radio so I scanned 2.4 ; 5.6GHz and ~440MHz and those frequencies are soo polluted that I think ESP32/8266 or similar RF equipment will not work reliably. I see at least 20+ different SSID at 2.4 band only. A lot of companies and warehouses around, every one have at least several AP's to cover large area.

I already bought tm1637 driver so that is ok, and I am going to buy today one of those ready PCB's with LM2596 for power supply, I was experimenting this morning with 7805 and found that that is maybe root of current problems, in every ethernet connector I have around 0,2V drop and input at one end is 12V so those units in middle does not get enough voltage (they get around 6V on input)

So solution for now is to crank power supply to 14,5V (it has little potentiometer on it) but first few in chain 7805 get extremely hot so I will try to avoid that by implementing ready switcher PS solution.


All display's refresh values about 100 times a day, then worker needs to place part according to numbers displayed, I saw that speed was not issue so I will leave it maybe on 9600.

david_2018 said why wait software change, well simply, tight budget. A large portion of software will need to be replaced and that costs, so for now it is delayed for next year or two.

I like idea of that rotary switch, I will stick to that or jumpers or DIP's whatever comes out cheaper.

Still learning about modbus and I think I will keep current protocol for now, maybe implement some error check control to avoid communication problems.

Environment is extremely "noisy" and maybe that is problem with signal lines, on some parts of that shelf, along with utp cable is 220V power cable, powering lights and other stuff. I will try to separate them where space allows, to see is it going to be any better, or if someone has better idea (some shielding?) I would like to hear it.

lastchancename

About time for a block diagram that includes 3 nodes
Experienced responders have a nose for laziness, (they were beginners once)... Sure, there are trolls, chest-beaters, and pretenders - but the help you'll get here is about as good as it gets - if you try to help youself!.

wvmarle

Topography matters: how far apart are those 4-digit displays? Controlling two (or more) displays from a single controller only makes sense if they're close enough to one another.

I'm also thinking in lines of one master Arduino; lots of display slaves. The slaves could be wireless (depending on your topology again: distance & whatever is in the way) or RS485 would do nicely for long distance wired. I do assume speed is not an issue, as in displays don't update very frequently.

My take:
- master Arduino, check. That's where you connect to your PC. It seems your PC's output is USB, which then gets converted to RS485 for the existing slaves. Omit that RS485 conversion - read the USB directly.
Ideally your master would have a second Serial port; so a Mega board would be an intersting option (or the Mega32U based ones?), otherwise use SoftwareSerial.
- slaves for each set of digits, communicating over RS485.

Display slaves built around an ATtiny84a: MAX485 for RS485 communication; TM1637 driver for the display. Address stored in EEPROM or use the remaining seven I/O pins to set an address 0-128 (physical DIP switches or solder jumpers - you will set it only once normally).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

zwieblum

... wehere "arduino" does not necessarily mean "Uno". You could use ESP8266 etc. if wireless is needed

david_2018

david_2018 said why wait software change, well simply, tight budget. A large portion of software will need to be replaced and that costs, so for now it is delayed for next year or two.
I was not referring to changing the software now, I was suggesting that you use an arduino to receive all the communications from the software, then convert it to your own format for driving the individual displays.  As far as the software is concerned, there would be no changes to its output, or any feedback it gets from the displays, but you would be free to implement your own interface between the master arduino and the individual displays.  That would of course require that all the displays be changed, instead of going the route of building an arduino-based display that would be a drop-in replacement for the current display.

wvmarle

... wehere "arduino" does not necessarily mean "Uno". You could use ESP8266 etc. if wireless is needed
Only if that wireless is WiFi - for NRF24 as suggested before or other protocols I'd probably be looking at an Arduino, most likely a Nano or Micro.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

mickey599

Hi to all,
I was pretty much busy these days (also had big problems with pc so couldn't write back)
Anyway, as far as block diagram I am terrible at it, but I will try my best to "describe" current setup
PC -> USBtoRS485 -> Display1 -> Display2……->Display 70

A "display" as I called it here is one complete unit, I will attach picture of one that is now in use.


Units are about 1 and somewhere 1,5 meters apart from each other and as I mentioned before, daisy chained by 2 ethernet port (I will upload picture with part of current setup too)


I came to next conclusions; it is totally fine to "build" 70 pcs of Arduino pro mini + TM1637 4digit display + RS485 to TTL and power supply board with LM2596. Also because of poor wireless performance inside object itself, I will stick to RS485.

I like idea of using MEGA as master and use 2 serial ports I will consider that as david_2018 and wvmarle suggested.

In next few days I will spend time PCB prototyping and experimenting with libraries and hardware to see what best option is, both for programing and cost of buliding my own PCB or use existing boards and just connect them.


One more thing need to ask. I ran in small problem, when data was coming on serial port and Arduino lost power for one second, when I restored power it didn't boot. I think I read long ago somewhere that you can't send data on serial while booting because that small amount of time is reserved for programing. Is there any way to overcome this?

Thanks for everyone involved in helping me.

wvmarle

I haven't heard about it but it does make sense, but only for Serial, not for the Serial1-3 ports the Mega has.

You may set up your Mega without bootloader, then you have to use the ISP header instead - no more easy USB programming. ISP can be done through another Arduino or a USBAsp adapter (lots of tutorials out there, do a Google search). Best leave that for when you're done with your debugging :-)

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up