Geoff Bunza geoffb

Model animation—bringing models to life—adds enormously to the interest and enjoyment of any layout or individual model!  Recently a fellow modeler (Rick Wade https://forum.mrhmag.com/post/my-operating-ho-scale-tv-on-my-richlawn-rr-layout-12199201) dreamed about building a working HO scale TV—and I wondered—is that possible?  Then I found Harry’s TV shop and stopped wondering…

fkowalick

Error messages

Jim,

At Geoff's suggestion I downloaded 1.6.4 of the IDE and it has no provision for copying error messages.  I noted, however, that when I was using 1.6.12 and tried to copy the error messages I was getting clicking on the copy button did absolutely nothing.  It was not like clicking copy and paste to save the message on the desktop or another place.  And if simply clicking on the copy button sent a copy of the message somewhere I have not been able to locate it on my computer.

Reply 0
Brent Ciccone Brentglen

I Said it Before - Bad Cable

A new cable from a known good source like adafruit or sparkfun doesn't cost that much. I still suspect that to be the problem.

Reply 0
Jim at BSME

Error messages

Clicking the copy error message button in the IDE copies it to the internal windows clipboard buffer, which then can be pasted into any text editing window like the post comment window of these forums. Could be pasted to a notepad window or word document as well. If you don't see any paste option by right clicking where you want to paste you could try the keyboard sequence Ctrl-V.

You might be able to copy the messages another way by clicking in the error message window (you won't see a cursor) type Ctrl-A to select all the text, type Ctrl-C to copy and then paste with Ctrl-V in here. Sometimes that pops-up another window that you then can right click and paste as plain text into.

Reply 0
lceggering

Hardware diagram

I found the software but not the hardware hookup diagram.

Forgive me if I missed it. I just want to do it correctly.

 

Thanks Larry Eggering

Reply 0
Geoff Bunza geoffb

@Larry E re: Hook Up

Hi Larry,

The hardware hook up was described on Page 4 of this entry. Here it is again for your convienience:

Arduino    Program
Pro           Sketch
Mini Pin    Pin Name    SD Card    Display    Description

D4            SD_CS        CS              --            SD Card Chip Select

D8             dc                --               DC          Data/Command Select
D9             rst                                 RES        Reset
D10           cs                                  CS          Display Chip Select
D11           mosi           MOSI           SDA        Serial In
D12                             MISO                          Serial Out
D13           sclk            SCK             SCL        Serial Clock

VCC        +5 Volt          VCC             5V           5 Volt Power  +  (positive) Connection
GND        Ground         GND            GND        Ground - 5 Volt Power  -(negative) Connection

 

ay_board.jpg 

Back of Display Module

rd_board.jpg 

Back of SD Memory Card Reader Module

This should make it more clear. Remember to use the zipped sketches and libraries.

You could conceivably apply this to other scales, although the pixel/dot  resolution may become a bit problematic. Also, for those who really want to travel to the hairy edge with this, there are faster Arduino versions out there, and there is a controller called a Teensy 3.1 that runs about 4 or more time faster than the Pro Mini. It's based on a different processor, but uses an Arduino look alike development environment (IDE) and many Arduino iibraries have successfully been moved onto it. I tried it with Harry's "video" and it radically sped it up to the point where you might me able to do near video (motion) quality! It was impressive.

Have fun! 
Best regards,
Geoff Bunza
Reply 0
Arjay1127

I just finished building one

I just finished building one of these for my local train club. Everyone is amazed that this could even be done!

Obviously I'm not done with the building yet, but getting ths part operational was a huge step. I couldn't find the SSD1332 display at first, so I tried it with a SSD1331.  Unfortunately the coding for that screen is completely different, and my attempts to rewrite the code to make use of it were less than successful.  Fortunately a seller appeared on ebay with a batch of SSD1332's for sale.

Thanks, Geoff! 

Reply 0
Geoff Bunza geoffb

@Arjay re: New TV

Hi Arjay,

Great to see your success wowing your club !

Did you use the SSD1332 library I provided in the download or one you got some where off the net? I ask because it looks as though your TV was running a bit slow. I modified the SSD1332 library to run faster. If you aren't using it you might try incorporating it and the others in the download and see if the "video" runs a bitt smoother.
Great job! Have fun! 
Best regards,
Geoff Bunza
Reply 0
Arjay1127

Geoff, I did notice the slow

Geoff,

I did notice the slow frame rate myself.  I used both the Adafruit_GFZ and SSD1332 libraries that were included in the download, so I'm not quite sure what's going on there.  Possibly a slow load from the SSD?  Or perhaps all clones of Arduino Pro Minis are not created equal!  

I'm giving serious consideration to trying this again with the Teensy 3.2 board instead, considering the 72MHz clock speed as opposed to 16MHz for the Arduino.

 

Thanks for the input, and the inspiration for this and other Arduino projects...I also adapted your grade crossing sketch for a working Wig-Wag.

Reply 0
Arjay1127

The "Eureka" moment happened

The "Eureka" moment happened a few minutes ago when I tested the circuit on battery power.

Apparently running the board and the screen and the SD card reader at the same time off of the FTDI power slows things down significantly.  When run off of a 9v battery, it ran at the same speed yours does.

Thanks again, Geoff!

Reply 0
Geoff Bunza geoffb

Hurray Arjay !!

Hi Arjay,

Congrats on your success! 

Power to Pro Minis and their associated devices can be a tricky thing, particularly if there are issues with instantaneous peak current demands. You will often see "odd" behavior that you cannot account for-- glitches at odd times, blinking, slow response, etc. are just a few. I had one such problem early on using Pro Minis that drove me nuts for 3 days! I try several things when odd things happen: substitute another power source like the battery you used or a high quality independent supply (often a "wall wort" power adapter does not qualify as such). Try placing a large (220uf or larger, the larger the better-- I keep a 1000uf 35V cap on my bench) capacitor across the power (plus and minus) terminal as it connects to your Pro Mini or Arduino or Teensy. And stop powering other devices (like SD Card readers and displays) directly from the +5V regulator on the Arduino-- isolate the power to the Arduino as much as possible. If the problems go away, you are a big step closer to a solution. Way back when this is how I first got to identify the incredible power draw a single 9G servo could take during ""normal" operation!
 
If you do try the teensy, you will be surprised at the "smoothness" of the video. It is clearly a step up. Another modeler used the teensy with a larger screen for an O scale TV, depending on the upgraded speed to transfer the larger number of "pixels" to "paint" the larger screen.
 
It is enormously satisfying to me to see other modelers take some of my work and make other, better models than I am able to make myself.
 
Have fun! 
Best regards,
Geoff
Reply 0
Arjay1127

Power supplies and such

Geoff,

Once the circuit and building are installed, power won't be a problem...we're using a pair of computer power supplies to run an accessory bus around the layout.  Since this seems to run just fine off of a 9v battery, I'm figuring with a couple of capacitors to filter the power going in, it should do nicely on the ~10.5v bus.

I did discover the issue with powering servos and other devices from the 5v supply on the board...my first test of the wig-wag, it was quite sluggish, so I rigged up a separate power board for the servo and IR sensors using a 7805 regulator.  Works like a charm now!

Reply 0
Jim at BSME

Wig-Wag

@Arjay, care to do a separate new blog about your wig-wag signal build or have you already somewhere else? I would be interested in a couple pictures to see how you did the mechanics of getting the wig-wag working. Of course if you are working on an article for MRH I'll wait for that.

Thanks,

Reply 0
Arjay1127

Jim, I'd be happy to do so! 

Jim,

I'd be happy to do so!  I don't have photos right now, but I can take some when I get home this evening since I have the mechanism sitting on my workbench (aka coffee table) right now for an upgrade to add sound.

Reply 0
Brent Ciccone Brentglen

Video Problem

Hello,

Been hiding in the basement to avoid the cold weather! So I built up one of these TV displays, works great using the good Professors video. I actually surprised myself because it worked the first time! That never happens when I build something!

Now I am trying to update the video that is displayed with my own video, but can't get it to work with my files. I used VLC to extract the frames as 38 X 38 bmp files. When I play these I get vertical lines across the image. something isn't in synch here but I am not sure what. I will attach an example of the frame that I extracted. Seems to be the same as the originals, but I am not sure where the problem lies.

I looked through the sketch, but I don't really understand it all!

I am wanting to play some updated 1970's style TV programs, - Star Trek to start with.

W1.bmp 

Reply 0
Geoff Bunza geoffb

@Brent re: Where few modelers have gone before!

Hi Brent,

Congrats on your success!
 
I didn't use VLC so that may be the source of the problem. Can you upload the edited video you want converted (one please) and I'll see what happens if I convert it.
 
Have fun! 
Best regards,
Geoff
Reply 0
Brent Ciccone Brentglen

Video

Thanks Geoff, That video is rather large to upload, its off a Star Trek DVD.

I have played around some more, first I tried to replicate the way you created it, I did use VLC, but I changed it to extract the frames as jpg instead of bmp files at the same size you used. I then used the ImageMagic software and the exact same settings as you did. This worked!

Since that worked I decided to try to sort out where the issue was. This time I extracted the frames using VLC again but with jpg's at 38 X 38 pixels. I then converted those to bmp using Irfanview, that also worked. So the issues seems to be the bmp files that VLC creates. I did notice that the bmp files created by VLC were 32 bit depth, I converted them down to 24, but it still doesn't like them. I also had troubles with some bmp files of a TV station logo I got off the Internet, it doesn't like those either even after converting them to the correct size.

I now have it working, but have another problem, it is running slowly. I have a large number of files on the SD disk, something like 4,000 of them. I changed one part of the sketch to read files from 1000 to 10,000 that really slowed it down, so I changed it to 1000 to 2000  and just now to 1500 but it is still slow, faster than before but still slow. Maybe the issue is reading the disk with so many files on it? I wonder if a full formatting of the disk might help, I did a quick reformat a couple iterations ago, maybe it needs a full format? or is it just too many files to go through?

Unfortunately, even a short segment of video generates a lot of files, and I am only taking every 5th frame, which makes it a bit jerky, but I can live with that.

Will continue experimenting...

Reply 0
Brent Ciccone Brentglen

Update

OK, I did a full reformat on the SD disk, I also was able to reduce the number of frames displaying down to 2,000. It is running much better now.

I can probably do some more editing of the video. Sitting here watching on that little screen without any sound I can see that certain types of video are going to work better. The start of the show with the name of the show displaying is good, some recognizable scenes like of the Enterprise and the bridge are good, but scenes where people are standing around talking don't work very well without any sound, scenes with motion and action work the best, maybe that is why cartoons look good on the little screen. 

It could still be a bit faster, but this might be as good as I can expect from an arduino, might think about getting a Teensy. A little editing and some other action footage and it will probably be OK as is.

Thanks for your help Geoff, and especially thanks for developing this and sharing it with us.

 

Reply 0
Geoff Bunza geoffb

@Brent re: "Video" playback speed

Hi Brent,

'Sounds like you have made good progress.

Every single time I reloaded my SD memory card I reformatted it, so there were no file table fragments for the software to deal with. A 16MHz Pro Mini can put out some nice video... but just barely. Make sure you use the display libraries I provided because they were tweaked to speed them up specifically for this application. I don't think the issue is entirely the number of files on the SD card but the organization/disorganization. Some consideration should also be given to the type and quality of the SD card itself. There are more variations of speed and quality available now that could affect the video readout too.
Quote:
I can see that certain types of video are going to work better.
Yes, absolutely. The last "channel" in my video was displaying a bugs bunny cartoon, which I thought would have been the "best" show on the screen... but I was most disappointed with it! The Disney Wonderful World of Color far exceeded my expectations-- I thought it would be un-viewable... but not so! I think some experimentation and editing would show the way better than other guesses. If you go with a more "modern" show, don't forget to modernize your cabinetry too! 
 
I think I reported my good results before, using a Teensy 3.2 -- much smoother video for sure.
These are being built in greater numbers than I had originally anticipated. The impact to the "viewing" public has been reported to be tremendous -- great stuff! and you are most welcome!
 
Have fun!  Happy New Year too! 
Best regards,
Geoff Bunza
Reply 0
Brent Ciccone Brentglen

Finished!

I finally got it finished and installed. Took me longer to build the building around it than it did to make the TV!

I went out and got a higher speed SD card, with that it works great, no problem with the playback speed. I also have around 3600 frames and could keep going if I wanted to.

Here is a link to a quick cell phone video I did, ignore the sound...

 

Thanks again Geoff for creating this and sharing it with us!

 

Reply 0
Geoff Bunza geoffb

@Brent Beam Me Up Scottie !

Hi Brent,

Star Trek ! You have updated your TV quite well ! and it look great. Congrats.

The length of "TV viewing" as you likely already know, is now dependent entirely on the size of the micro SD memory card you use. I understand that the max number of file entries in a FAT32 files system is 268,435,437. That would be enough TV for an op session! (If you could fit it).

Have fun! 
Best regards,
Geoff
Reply 0
Dwayne de Lung

Thank you for providing the

Thank you for providing the detailed info on this project. It may be an 'old' project for some but wanting to do a similar display as 'Harry's' television shop this article was indispensable in helping me get started. (The good thing is that the Arduino parts are cheaper now than they were!)

Reply 0
Geoff Bunza geoffb

@Dwayne

Hi Dwayne,

"Glad to hear you're enjoying this! Are you going to use your own programming? I'm surprised at how many people are modeling their own Harry's TV Shop, and the number seems to be growing. It is amazing that the parts costs have dropped.

If you are interested in a bigger screen for a larger scale or for a "Drive In Theater" display, take a look at fellow modeler Richard Kamm's project here:  http://sueline.kamm.us/news/march3rd-jumbotronfromgeoffbunza
which uses a different screen but can actually play a video (it needs to be processed too).
 
Have fun! 
Best regards,
Geoff Bunza
Reply 0
Dwayne de Lung

Thanks for the response &

Thanks for the response & I'll probably use your file to get started. Everything is on order for the Harry's version & it should be a fun project to learn Arduino tech on.

While a JumboTron isn't in the cards for me that display would be a GREAT way to animate the inside of a building say through a visible inner doorway or opening... so, imagine a lobby area for, oh... 'a bowling alley' with static decoration & figures near the windows but with people visibly bowling in the lanes 'in back'! Bowling alley is just an example but you get my idea. By recessing the screen a bit 'in the back' the brightness/contrast etc issues that would look toy-like closer to the window would be muted and appear like the lighting in that back room. Activities could be anything... factory work, repair shop, bar, pool hall, strip club, anything. 

Edit: Yikes. Accidental brainstorm! (Smell the ozone? ) I searched for that other display on Amazon and found a TON of different sized devices... all of which are basically 'ready to go' for a rear room animation tool. Here's my initial search results and I have a feeling that if this works out well I'll be doing several buildings with these!

Mach Speed Eclipse Replay search which yielded many different video players: http://amzn.to/2CriPmP
/>
I also just happened to think of something else... smartphones. Those old, crappy phones that our kids think are obsolete (ie: made last week) would be awesome if there is room in the building. All but the very cheapest are Wi-Fi capable, blue-tooth capable, AND can play very high quality video plus have SD slots for TONS of storage and even new are cheap as dirt.

I guess the hardest part would be rigging them to auto-boot to video etc as it might be problematic reaching controls etc inside a building.


 

Reply 0
Geoff Bunza geoffb

@Dwayne re: Scary Imagination

Now Dwayne... I think you are going to scare some readers here with these wild flights of imagination !! but I love the smell of ozone in the morning (paraphrased from Apocalypse Now).

I think your idea is spot on for the other displays. I used the little display to create these virtual rooms:

You can also use  larger video displays across several windows, or even 2 floors by carefully editing independent videos for each half or quadrant of the screen. Depending on your era, Drive In Theaters or jumbo video billboards are other options.
 
It's great to see someone start with this and explore more modeling opportunities. I bet you will come up with some terrific displays.
 
Have fun! 
Best regards,
Geoff

 

Reply 0
Wilson

Outstanding

Standing Ovation Sir! Well Done!

Reply 0
Reply