(Topic ID: 233330)

Raspberry Pi & Python Backglass

By legtod2

5 years ago


Topic Heartbeat

Topic Stats

  • 11 posts
  • 4 Pinsiders participating
  • Latest reply 5 years ago by legtod2
  • Topic is favorited by 3 Pinsiders

You

Linked Games

No games have been linked to this topic.

    Topic Gallery

    View topic image gallery

    NewPrototype (resized).jpg
    #1 5 years 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 5 years ago

    Let us know when you have the vids posted.

    2 weeks later
    #3 5 years ago

    Here is the link to youtube ...

    #4 5 years 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 5 years ago

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

    NewPrototype (resized).jpgNewPrototype (resized).jpg
    #6 5 years 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 5 years 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 5 years ago

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

    #9 5 years 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.

    #10 5 years ago

    This looks super awesome! If you interested we can turn this into a platform for the Mission Pinball Framework (https://missionpinball.org/). We already support various platforms: http://docs.missionpinball.org/en/dev/hardware/index.html. Those are upstream inside MPF but there are also external platforms which life inside their own repo: https://github.com/missionpinball/mpf-demo-platform. Let me know if you are interested.

    #11 5 years ago

    Very flattering. I believe I need to educate myself on the mpf framework to a higher level then I currently understand.
    Your media console stuff is very cool, where my stuff is rather elementary.
    The one saving grace to my approach is the entire backglass and sound are on a tv screen, and pc speakers.
    This approach was born from my virtual pinball background.
    Also this approach works well with older style generation machines that have no dmd or electro mechanical score display.

    I have seen a few home brew style pinball machines that the builder excluded the backglass piece and just made the play field work.

    So this may help that type of builder.

    Reply

    Wanna join the discussion? Please sign in to reply to this topic.

    Hey there! Welcome to Pinside!

    Donate to Pinside

    Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


    This page was printed from https://pinside.com/pinball/forum/topic/raspberry-pi-amp-python-backglass?hl=jabdoa and we tried optimising it for printing. Some page elements may have been deliberately hidden.

    Scan the QR code on the left to jump to the URL this document was printed from.