Raspberry Pi & Python Backglass

(Topic ID: 233330)

Raspberry Pi & Python Backglass

By legtod2

16 days ago

Topic Stats

  • 9 posts
  • 3 Pinsiders participating
  • Latest reply 2 days ago by legtod2
  • Topic is favorited by 3 Pinsiders


Linked Games

No games have been linked to this topic.

    Topic Gallery

    One image has been uploaded to this topic. (View topic image gallery).

    NewPrototype (resized).jpg

    #1 16 days ago

    Some of us got our start in building virtual pinball machines before getting into building Homebrew pinball machines.
    In the virtual pinball world, pc's drive TV screens emulating tables via pinmame and other software. A series of modules can also drive solenoids and shakers to emulate the real pinball experience.

    One such piece is the back glass. This component consists of the scoring display (7 Segment, DMD, etc), lamps, flashers, and sound.

    In the home brew world, beginners may choose to employ simple solutions such as 2 or 4 line LCD displays and push the score and ball & credit via it.
    Lets face it when your learning the craft you take baby steps to learn.

    I took a different route in my learning experience. I used a raspberry pi and python to replicate a back glass of my game.

    Let me walk you thru it.

    The Raspberry pi is receiving state information via serial data from an arduino mega (Score, Credit, Ball, Back glass lamps state, Sound events).
    The pi reads the data via the python program and paints the data onto the back glass screen or plays the desired sound event.

    This inexpensive method allow the budding Home brew builder the opportunity to explore building a simple backglass environment.
    It addresses sound, score display, lamp wiring and attract issues. Plus adding future animation displays and events to the backglass over time.

    Rest assured there are other ways to do this thing. You may choose to use a separate wave trigger board for sound events, and 6 7 segment displays for the 4 score displays and credit and ball display, or maybe use a DMD display, and have multiple wires to your backglass lamps. This is a daunting task for beginner homebrew folks. Perhaps for this very reason you see that beginning projects don't even have a backglass connected.

    I will post a youtube video of the backglass and share the python code, which I have running on my raspberry pi 3.
    Basically is python 2.7 and pygame talking serial to the arduino.

    Hopefully by sharing this, beginning home brew builders have an alternative choice to constructing back glasses.

    After they become proficient, they can continue the journey to building the next best home brew.

    #2 16 days ago

    Let us know when you have the vids posted.

    2 weeks later
    #3 2 days ago

    Here is the link to youtube ...

    #4 2 days ago

    The prototype board has the following items (looking left to right)
    1) Four lamps connected to a 6volt battery box
    2) Arduino Uno (Switch matrix)
    3) LCD 20 x 4 display (Provide multi line updates, score, status, events, etc) from mega
    4) Arduino Mega Master control - Connects serial to Uno's and raspberrypi or pc
    5) Arduino Uno (Lamp driver)
    6) Zero Crossing detector (Below Lamp driver uno)
    7) Bally Lamp driver (AS-2518-23)

    The Arduino mega is talking serial to the Raspberry Pi or PC to communicate messages to the python backglass.
    The serial messages gives score, credits, balls, sound message number for the display or replay of sound.

    #5 2 days ago

    I realize the video is a bit bouncy so it is a quick picture of the board.

    NewPrototype (resized).jpg
    #6 2 days ago

    Message type examples coming from Arduino Mega to python backglass program...

    Prefix + Message
    Prefix_Player#+ Score (Player#)
    Sound_Event + Sound_id
    Prefix_Credit + Credit
    Prefix_Ball + Ball
    Prefix_Lamp + LampId + LampState (For virtual Backglass lamps only)
    Prefix_Event# + Event# (Shutdown PC, Diagnostic Mode, Coin door open, Attract mode, etc)

    #7 2 days ago

    The python program simply draws layers using pygame.
    Basically there is the picture of the game backglass (whichever one you want to use).
    Some 7 Segment fonts for the score and digit displays.
    Some pixel x and y co-ordinate for where things need to be displayed.
    Some layers on the screen to give the virtual lamps turning on and off.
    Serial communication parser to receive the arduino mega messages and display stuff or play the correct sound message id.

    #8 2 days ago

    I wish i had better knowledge of how you do this. Looks cool and like a lot of fun to build.

    #9 2 days ago

    My ideal endpoint would be to mimic what Virtual Pinball backglass program does (directb2s).
    Basically pinmame and pinball X are sending data for the backglass to be emulated.
    It is far more sophisticated then my little python. It can emulated DMD, lamps, and other animation far better than me.

    For my own educational purposes it fits the bill for this homebrew build project.

    Going forward this backglass project will be re-used on my Williams Phoenix hybrid.

    Promoted items from the Pinside Marketplace
    From: $ 180.00
    $ 69.99
    Playfield - Toys/Add-ons
    Lighted Pinball Mods
    $ 7,199.00
    Pinball Machine
    Operation Pinball
    $ 29.99
    Cabinet - Sound/Speakers
    Lighted Pinball Mods
    $ 7.00
    Playfield - Toys/Add-ons
    Pinball Z
    $ 39.95
    Playfield - Toys/Add-ons
    $ 69.99
    Playfield - Toys/Add-ons
    Lighted Pinball Mods
    £ 58.00
    Cabinet - Decals
    Sillyoldelf Mods
    $ 99.00
    Playfield - Toys/Add-ons
    $ 27.99
    $ 18.00
    Cabinet - Decals
    Top-Notch Target Shields
    From: $ 99.99
    Cabinet - Other
    Lighted Pinball Mods
    $ 99.99
    Playfield - Toys/Add-ons
    Lighted Pinball Mods
    $ 14.95
    $ 129.95
    Playfield - Toys/Add-ons
    $ 68.00
    $ 49.99
    Playfield - Toys/Add-ons
    Lighted Pinball Mods
    $ 11.95
    Playfield - Toys/Add-ons
    $ 229.99
    Lighting - Other
    Lighted Pinball Mods
    $ 38.75
    Playfield - Toys/Add-ons
    The MOD Couple
    $ 144.00
    Lighting - Backbox
    The MOD Couple
    From: $ 23.00
    Playfield - Toys/Add-ons
    ModFather Pinball Mods

    Hey there! Got a moment?

    Great to see you're enjoying Pinside! Did you know Pinside is able to run thanks to donations from our visitors? Please donate to Pinside, support the site and get anext to your username to show for it! Donate to Pinside