1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

BarMixVah Plus

Discussion in 'Projects' started by mark tomlinson, Aug 21, 2014.

  1. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Source now staged:

    https://github.com/marktoml/BarBot

    It is more or less the same as pictured, some minor tweaks.
    Is working fine at this stage, if you run into issues log them on github and I'll fix

    Things we have on the 'plate' for this:
    1)enhance the UI as discussed for more control/options
    2) put the recipes in a SQL db on the Pi (one of the small ones like SQLLite)
    3) allow drinks to be 'queued' then an entire order can be dispensed
    4) add a turn-table for dispensing multiple drinks (with sensors to know when a glass is present and empty or not)
    5) Android phone app to control it (already started spelunking with that)
    6) lastly an Alexa skill to control it (because telling Alexa to have the BarBot pour me a drink from anywhere is cool)
     
    Geof likes this.
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    An example properties file is included that demos the recipe list. Eventually I will move this to an actual db, but for now it functions. The format is this:

    motor2pin=GPIO 22
    motor5pin=GPIO 25
    motor1pin=GPIO 21
    motor4pin=GPIO 24
    motor3pin=GPIO 23
    ingrediant1=Scotch
    ingrediant2=Soda
    ingrediant3=Gin
    ingrediant4=Vodka
    ingrediant5=Tonic
    recipe1=Scotch N Soda:Scotch;1.5:Soda;1.5
    recipe2=Vodka N Tonic:Vodka;1.5:Tonic;1.5
    recipe3:Gin N Tomic:Gin;1.5:Tonic;1.5


    The motor pin definitions are needed to know which GPIO pin the motor is attached to.
    The ingrediant list matches the motor number (so ingredient 1 is on motor 1).

    The recipes are just sequentially numbered and broken down like this:

    NAME:Ingredient1;ounces:Ingredient2;ounces

    You can carry on with as many ingredients as you have motors to support.
    NAME is what shows up in the list box on the UI.

    The program matches the ingredient on the recipe to the ingredient on the list of available ones (so spelling matters) :)
     
    Geof likes this.
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    When you deploy this to the Pi the properties file needs to be in the "default" directory.
    Some experimentation may be needed :)

    That may be the "home" directory for the user (/home/pi) if you have it auto-launch at boot time or the home directory for the project if you are debugging it (for example -- /home/pi/NetBeansProjects/BarBot)

    Naturally if you have questions, ping me. I am getting ready to expand the hardware for grins (7 motors). Sadly we can't go unlimited as the screen eats up some of the GPIO port which leaves only about 15 motor pins available.
     
    #183 mark tomlinson, Feb 23, 2017
    Last edited: Feb 23, 2017
    Geof likes this.
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Committed a small fix where we were calling the Motor I/O via Pi4J synchronously rather than async. SO while your ingredients COULD be mixed at the same time, they were not. This made mixing a given drink a lot longer that needed*.

    The threads now run in parallel (or as parallel as java supports).

    (change pushed to github)


    *totally NOT what you want.
     
    #184 mark tomlinson, Mar 5, 2017
    Last edited: Mar 5, 2017
    Geof likes this.
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    There have been a few recent bug fixes and I still have a couple of rare/odd ones being chased. I will update everything in the GITHUB site rather than keep this one up-to-date.
     
  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    For completeness this is the circuit between the Pi and the motor
    Sorry, resistor values a bit obscure (blame Eagle) 2.2 kohms and 470 ohm
    We also added a diode on the output to the motor just so visually you can see each one is "on"

    I was concerned since the Pi uses CMOS (3.3v) logic, but the way the TIP120 is used in this there is more than enough for it to trigger (roughly 2v is enough forward bias to get it wide open collector-emitter). So a non-issue.

    TIP120.jpg

    Other parts here:

    [​IMG]
    20pcs 1N4007 1A 1000V Through Hole Axial Rectifier Blocking Diode

    Sold by: uxcell Product question? Ask Seller
    $5.70

    [​IMG]
    E-Projects 100EP514470R 470 Ohm Resistors, 1/4 W, 5% (Pack of 100)

    Sold by: E-Projects, LLC
    $5.16

    [​IMG]
    TIP120 NPN Power Darlington Transistors TO-220 10 Pack

    Sold by: ELITE.CITI
    $7.99

    [​IMG]
    E-Projects 100EP5142K20 2.2kOhm Resistors, 1/4 W, 5% (Pack of 100)

    Sold by: E-Projects, LLC
    $5.16

    Peristaltic pumps:
    https://www.amazon.com/gp/product/B00F9MXFFQ

    And we just used breadboard to build it on (a little hot glue when done to keep everything in place)
     
    #186 mark tomlinson, Mar 18, 2017
    Last edited: Apr 6, 2017
  7. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Today I would like to make a brief apology :)
    I was adding two more motors/ingredients to the rig and when I went to modify the code I realized that my son had used 4 different variables that were all named some flavor of "motor" -- not confusing at all. So, added the motors and code to support them and cleaned it up a bit before checking it back in....
     
    Geof likes this.
  8. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    I love Firefly.
     
    mark tomlinson likes this.
  10. Ryan TeGantvoort

    Ryan TeGantvoort Active Member

    Joined:
    Mar 11, 2016
    Messages:
    343
    Likes Received:
    172
    What about the ice? Still have to do that manually!? Something to add to your list....drop 2 or 3 cubes lol!
     
  11. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Aw, now see ... you just made me have to go back and mess with it again ;)
     
    Ryan TeGantvoort likes this.
  12. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    NOW I has a back up :)
    I also gave up trying to flip the screen and the touch screen and just have it mounted the other way. Not a big deal.


    While adding a IceMaker is an idea, I can add an Alex skillset for this and have it mix drinks on-demand via the Echo. THAT is on the list ...

    "Alexa, POUR ME A DOUBLE..."
     
  13. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    config.txt

    display_rotate = n
    0 = Default
    1 = 90°
    2 = 180°
    3 = 270°
    0x10000 = flip horizontally
    0x20000 = flip vertically​
     
  14. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    That flips the screen but not the touch screen part of it.
    So then the touch is 180 degrees away from where you want it.
     
  15. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    /etc/modules

    Change swap_xy=0 to swap_xy=1
     
    Geof likes this.
  16. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Cool, I will give that a whirl, thanks!
     
    Geof likes this.
  17. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
  18. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    pi@BARBOT-PI:/etc $ xinput --list
    ⎡ Virtual core pointer id=2 [master pointer (3)]
    ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
    ⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)]
    ⎜ ↳ MemsArt MA144 RF Controller id=8 [slave pointer (2)]
    ⎜ ↳ MemsArt MA144 RF Controller id=9 [slave pointer (2)]
    ⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ MemsArt MA144 RF Controller id=7 [slave keyboard (3)]

    So that driver is not responding to the axis swap commands. I will need to dig into it a bit further. Reverted it all back for now.
     
  19. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Sorry, didn't read all of the pages here... but wondering if you've gotten to the point of dispensing yet?

    You could make peristaltic pumps which don't touch the ingredients themselves. I've often thought to designing one now that I have a 3D printer for the cams.

    Whoa. Look at the prices for these things... https://partyrobotics.com/collections/products
     
    #199 OutsourcedGuru, Jul 11, 2017
    Last edited: Jul 11, 2017
  20. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,967
    Likes Received:
    7,344
    Yep, it works as-is. Only discussing the screen orientation now.
    Pumps are not touching the beverages... only the tubing.
     

Share This Page