The trigger for this project was Andy Robb's article in the MERG journal (June 2020 edition). In it Andy describes using an UNO with a OLED display to produce an electronic station display board.
Having tried out Andy's version I started thinking about expanding the idea and have come up the following list of possibilities:
1.
Replace my card index train sequence with an electronic version.
2.
Have the train sequence synchronised with the on platform
displays.
3. Display an analogue clock on the station display
and have it display the train times.
4. Store the position
reached in the sequence so that it starts where it left off on power
up.
To make the project of greater potential interest to other modellers the following additions could be considered:
5.
Additional displays where the operators are not located at the same
control point and on exhibition layouts use a display to tell viewer
what's going on.
6. Implement a fast clock.
7. Rather than
coding the text to display into the Arduino code write the software
so the information to display can be read from a basic text file
stored on an SD card. This could be further refined to allow file
selection at startup so that different sequences can be run and even
add LCD configuration data so the code could be used without
knowledge of how to write the LCD configuration code in C.
At this point (11/9/20) I have succeeded in getting dual displays working and displaying different text on both. They are connected using the I2C bus using different addresses. I have not tried using the OLED display used in Andy's project with mine as they use different driver libraries and I wanted to be sure they worked individually before attempting to use the 2 libraries on the same UNO. I have found articles on reading and writing to SD cards and sending text to the Arduino serial monitor. However to use multiple LCD displays some form of command structure is going to be need to route the text to the intended display.
For the analogue clock I found that a someone called Rudy has published several Arduino railway related projects, they can be found at: https://rudysarduinoprojects.wordpress.com/ one of which is an very similar project to Andy's with an analogue clock.
If anyone else is interested in developing this idea or has ideas for additional features then let me know.
Mark Bradley
Very interesting project Mark. Message and sequence storage might be challenging given the limited program memory. MEGA is a possibility but I have just ordered a Raspberry Pi 4 . Rudy does a great set of introductory Arduino videos which I'll put up in another post
ReplyDeleteBeware Project Creep! How about a station announcer linked in to your sequence ? well you did mention Swiss stations had an audible tone on train approaching.
ReplyDeleteI'd consider having a file for each 'Card' rather than one big file, just a thought. Your code could then bring in one cards worth at update time, do stuff, then advance the card number for the next 'read'. Storing the current 'card' number would tell your code where it left off.
Storing your data in an SD card means you could take the card out and update on a PC so I'm envisioning lots of small files perhaps with comma separated values (CSV) in a fixed format. Say card#,LCD_0_line1_data,LCD_0_line_2data,foo,bar,LCD_1_line1_data,LCD_1_line2_data,foo,bar,nada,nada,END
One big file could have each card on a line of a spreadsheet and export it as a CSV file to the SD, this might be more difficult to handle in the Arduino code. Then again it could be easier.
Very interested to see how this advances.
Hi Andy, I have done a bit more work on the project and have set up a repository at:
Deletehttps://bitbucket.org/Mark4664/mergarduino/commits/86072fa9d1ab479482cf42a4d6f9a85253a3d618
No new code yet but I have put up a an outline and specification including a possible file structure. Code wise I have had a look at storing the instances of the LCD in an array so that the same functions / methods can be used for all the displays, have it working but not posted it yet.
Can you put an image in the blog showing the contents of a typical index card
DeleteThis link will take you to an article on connecting and using SD cards;
ReplyDeletehttps://create.arduino.cc/projecthub/electropeak/sd-card-module-with-arduino-how-to-read-write-data-37f390
Miss read the last comment , have got SD cards on the brain at the moment. A card or record could contain something along these lines;
ReplyDelete@ //Record start marker
{} Text block marker. No need to specify which display. 1st Block goes to display 1, 2nd block to 2 etc.
In the example below display 1 is for the main control panel, 2 faces the public or is located on the station and 3 is for the fiddle yard operator.
@
{Passenger train fiddle road 6
to platform 2 and stop}
{Arrivals:
07:30 All stations from Bristol}
{Put class 323 rail-car set on road 6}
@
{Passenger train platform 2
departs to road 1 in fiddle}
{Departure 07:32
All stations to Weston-super-mare}
{} // Empty text block leaves a display unchanged.
{}
Have reverse engineered the button arrangement and got code working with one LCD.
ReplyDeleteCoded for a 128x32 OLED as the auxiliary display. Will post that code version in repository (If I can figure out how and have the necessary privileges).
Waiting for SD card reader!
Now have 3 displays working with data read from a SD card displayed, different out put on each display. Code can be viewed at;
ReplyDeletehttps://bitbucket.org/Mark4664/mergarduino/src/master/LCD_I2C_TripleDisplay_SDcard_v1/