matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

40 LCDs and Raspberry pi

Sat Oct 19, 2013 12:20 pm

Hello people,

First I hope here is the right place to post and if you have some new ideas or advices feel free to write.

So my project is to make a system that use 40 graphical displays and post something different on each of them, numbers, text, graphs on a big info panel. For the displays I've chose to use EA eDIP160-7 (http://www.lcd-module.com/fileadmin/eng ... 160-7e.pdf) because they have a lot of useful functions and a Raspberry Pi because I have to use a data base and a small web server.

The displays can be used with I2C, SPI, RS232, RS485 and USB. The first three interfaces are not so good because of the distance ( max distance between Pi and the display 2 maybe 3 meters) and the addressing problem of each display because I want to make it as cheap and simple I can. The RS485 look like is perfect for my project but from what I've read and correct me if I'm wrong, is quite complicated on Raspberry Pi: hardwere because I have to make or buy an adaptor and software because I want to use Python as a programming language which dosen't have a good library for this interface. With usb I've never worked (as interface) so I don't know to many about it so I am asking you if is possible to connect all of the displays and to be able to access all of them independent ( by the way, I've borrowed an FTDI adaptor from a friend of mine so, can I use it?)?

If you have some ideas fell free to share them with me and the community of course.

Best regards!

Dutch_Master
Posts: 360
Joined: Sat Jul 27, 2013 11:36 am

Re: 40 LCDs and Raspberry pi

Sat Oct 19, 2013 2:54 pm

RS232 is just fine, it can be used for 10+ meters distance. Just make sure you use real RS232, not TTL-RS232.

ramstrong
Posts: 36
Joined: Thu Aug 15, 2013 11:14 pm
Contact: Website

Re: 40 LCDs and Raspberry pi

Sat Oct 19, 2013 4:01 pm

This may not be what you want to hear but if indeed you want 40 different displays, wouldn't it be easier to just set up a Master-Slave network configuration and attach a Raspberry Pi to each displays? Even something simple like an intranet web server should work fine, and trivial to set up.
Raspberry Pi Journal: http://simpletongeek.blogspot.com/p/raspberry-pi-journal-directory_4.html

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: 40 LCDs and Raspberry pi

Sat Oct 19, 2013 6:06 pm

Hi

Have a look at a 3 to 8 line decoder (like LS138 but beware of the 3V3 vs 5V problem). Using one '138 and the three address lines of the modules you would be able to select 32 displays, using two '138s and 7 GPIOs you should be able to address 64 displays.

Once the display is selected you need to send data to it, personally I would test 3V3 level signalling before going to RS232 which looks like it might required 41 level-converters, and anyway RS232 is not supposed to do multi-drop.

matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

Re: 40 LCDs and Raspberry pi

Mon Oct 21, 2013 12:01 pm

Thanks for your reply guys. Wouldn't be easyer to use an usb-rs485 adapter to avoid any addressing and wiring problem?

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: 40 LCDs and Raspberry pi

Wed Oct 30, 2013 4:43 pm

Hi

RS485 does support multi-drop but can the screens handle the addressing? Looks like they're limited to 8.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: 40 LCDs and Raspberry pi

Wed Oct 30, 2013 6:23 pm

Hi,

I believe RS-485 is the only bus which makes sense in your scenario.

However, even with RS-485, there are several traps which you need to be aware of... for example, the SN75176 chip proposed in datasheet is NOT suitable for you. The main reason is that this listed driver supports bus with max 32 similar drivers attached, where you'd have 40 + 1 of them. True, most likely, everything would work fine, but in some cases (eg. during summer time at higher temperatures), some of displays might not receive valid data due to signal levels out of specifications...
[joke mode on] It's now not about ignorance anymore, but are you brave enough to take this risk of using improper chip ? ;-)))) [joke mode off]
matei_vidican wrote:Wouldn't be easyer to use an usb-rs485 adapter to avoid any addressing and wiring problem?
Yes, could be... but check what driver chip does this adapter use.

Another important parameter is the speed of your bus. According to the datasheet, it would be 115k2 baud or lower. Therefore, I highly recommend that you pick a driver chip with Slew-Rate Limited feature. It drastically improves communication robustness. (This is important, because displays use just 1-byte packet checksum).

These are just two "entry" facts you need to keep in mind...


I already implemented some solutions containing RS-485 communication on RasPi, but implemented in C, so if you have any additional question, feel free to ask...

Best regards, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

Re: 40 LCDs and Raspberry pi

Thu Nov 07, 2013 1:11 pm

grahamed wrote:Hi

RS485 does support multi-drop but can the screens handle the addressing? Looks like they're limited to 8.
They are limited to 8 hardware addresses but is possible to use software addresses, until 255.

matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

Re: 40 LCDs and Raspberry pi

Thu Nov 07, 2013 1:25 pm

First of all thank you Ivan for your post.
FLYFISH TECHNOLOGIES wrote:Hi,

I believe RS-485 is the only bus which makes sense in your scenario.

However, even with RS-485, there are several traps which you need to be aware of... for example, the SN75176 chip proposed in datasheet is NOT suitable for you. The main reason is that this listed driver supports bus with max 32 similar drivers attached, where you'd have 40 + 1 of them. True, most likely, everything would work fine, but in some cases (eg. during summer time at higher temperatures), some of displays might not receive valid data due to signal levels out of specifications...
.
Could you recommend me a better chip for the driver but to be in the same price range or similar?
matei_vidican wrote:
Wouldn't be easyer to use an usb-rs485 adapter to avoid any addressing and wiring problem?
Yes, could be... but check what driver chip does this adapter use.
I will use this adaptor: http://www.ftdichip.com/Support/Documen ... -PLUS1.pdf which uses a FT232R and from what I've read the driver is working on Raspberry Pi.

Regarding the code in c for the moment is not a problem because i am doing the hardware part, but if i will have some problems I will contact you.

For the moment thank you all.

Best regards,
Matei VIDICAN

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: 40 LCDs and Raspberry pi

Thu Nov 07, 2013 3:36 pm

Hello Matei,
matei_vidican wrote:
FLYFISH TECHNOLOGIES wrote:the SN75176 chip proposed in datasheet is NOT suitable for you.
Could you recommend me a better chip for the driver but to be in the same price range or similar?
I will use this adaptor: http://www.ftdichip.com/Support/Documen ... -PLUS1.pdf which uses a FT232R and from what I've read the driver is working on Raspberry Pi.
In the PDF from link above, you can take a look on the figure 1.1 - the SOIC-8 chip above FTDI chip is RS485 driver.
I cannot clearly see its label, but this definitelly is half-duplex RS485 driver. The good news (and the reason why I'm so positive that this is RS485 driver chip) is that many variations of driver chips have this same pinouts.

If I were you, I'd open your adaptor, take a look at this chip's label and verify its datasheet against features. If not met (already fails to my criteria because datasheet states speeds up to 3Mbps), then I'd desolder this present chip and replace it with proper one.
The mentioned figure from PDF doesn't show bottom side of the PCB, so I'm not sure if any 5V->3.3V voltage regulator exists for supplying these chips (Q1 is "suspicious", but seems more likely to be the driver's power supply on/off switch). Therefore, I'm not sure if optimal replacement chip is 5V or 3.3V version... but this is not a problem to find out... when you'll have naked adaptor in your hands, measure a voltage between pins 5 (GND) and 8 (Vcc) on this SOIC-8 driver chip. If voltage is 5V, then I'd take SN65HVD3082ED as a replacement. Else, in case of 3.3V, my selection would be SN65HVD72.
They both allows up to 256 nodes on the bus, they are very robust due to ~200k bauds limit and fit perfectly as a replacement on this FTDI board, without any additional modification needed.


Best regards, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

Re: 40 LCDs and Raspberry pi

Fri Nov 08, 2013 9:46 pm

Hello Ivan,


For the moment I don't have the adaptor i think just next week I'll have it. Regarding the level shifter for each display, should I use the same type as the ones that you recommended for the adaptor?.


Best regards,
Matei Vidican

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: 40 LCDs and Raspberry pi

Sat Nov 09, 2013 12:35 am

Matei,
matei_vidican wrote:should I use the same type as the ones that you recommended for the adaptor?
Yes, I would use the same type because of their higher input impedance - they sink lower input current, so sender can drive 40 of them on the bus well.
You can use 3.3V or 5V supply voltage for LCDs, so pick one of two proposed chips according to this power supply selection.

I'm not sure how deep is your knowledge on this field, so the text below could be redundant... or usable just for other readers...
In the LCD's schematics for RS-485 interface (page 5 in PDF from your initial message) there are three resistors listed. Do not place them on every LCD !
A pair of 10k resistors takes care about idle bus voltage levels, when there is no active sender on the RS-485 bus. You have to use just one pair of them on the bus.
The third, 1k resistor, is a bus terminator. You could use two of them, one on each very end of the RS-485 bus wires pair. This termination is optional, depends also on your wire length. If you have short distances (30 or 50 meters, or so), then you can also forget this termination resistors due to already mentioned Slew-Rate feature of proposed chips.

Speaking about termination and reflections and wirings... you should avoid "star" wiring (junction of more branches) of RS-485 bus. Make sure that the LCDs will be connected in series on the RS-485 bus.


Best regards, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

matei_vidican
Posts: 9
Joined: Sat Oct 19, 2013 8:33 am

Re: 40 LCDs and Raspberry pi

Mon Nov 11, 2013 10:37 pm

Hello people,

I'm understanding what I have to do as hardware, now I have a big question, how can i control everything from a web page, because i intend to use a database? If you can recommend something to read it would be perfect. I would like to do something like activating/deactivating different displays to have a list with the active ones, print something on them, stuff like this. The idea is that i don't know how to you connect lets say the webpage with the hardware.

Best regards,
Matei Vidican

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: 40 LCDs and Raspberry pi

Mon Nov 11, 2013 11:49 pm

Hi Matei,
matei_vidican wrote:I'm understanding what I have to do as hardware, now I have a big question, how can i control everything from a web page, because i intend to use a database?
If you can recommend something to read it would be perfect.
Hmmm... Currently, I don't have enough information of your requirements to be sure that my text below is optimal for you...

Let me start with the fact, that I'm currently working on a project where RasPi drives various RS-485 devices, data is (mainly) stored in database and everything is controlled via web. So, I believe that I can give you some competent answers... ;-)

The "technology" behind this mentioned project on RasPi is Apache server with PHP web pages, MySQL database and few utilities written in C for background & communication tasks.
First three selections are probably quite obvious, where selection of C language might not be, because a lot of people like python scripting instead... Well, python is easier to learn/program, but when performance is a factor, C should always be (at least) seriously considered.

matei_vidican wrote:I would like to do something like activating/deactivating different displays to have a list with the active ones, print something on them, stuff like this.
Well, are you sure that you need a database at all ? ;-)

If yes, then let me write just one non-obvious suggestion - you need to spend some time also thinking about nature of data. In the mentioned system, there is a lot of dynamic data next to very static one. Therefore, to save SD card, tables containing static data are stored on SD card, where tables containing dynamic (runtime) data are stored in RAM... ok, there is also a "black hole" table with some triggers, but let's forget about it here... ;-)

matei_vidican wrote:The idea is that i don't know how to you connect lets say the webpage with the hardware.
PHP writes to MySQL, program written in C reads this data from MySQL and drives LCDs.
This is one possibility, which can work well...

(Applicable also here): If you have more specific quesitons, feel free to ask...
You can ask also for a quote. :lol:


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Return to “Automation, sensing and robotics”