Difference between revisions of "Projects/RFIDpop"

From ENTS
Jump to: navigation, search
(Useful Links)
(Useful Links)
 
(26 intermediate revisions by 4 users not shown)
Line 8: Line 8:
  
 
One major problem was that the coin mechanism would not accept newer loonies and toonies.  A replacement mechanism would be $200 or more.  A bit pricy for a starving hackerspace, so we are doing what all good hackers do, overengineer a solution with parts at hand.  In this case, utilize the door RFID tags the members have anyways and use them to debit from a pre paid pop account.
 
One major problem was that the coin mechanism would not accept newer loonies and toonies.  A replacement mechanism would be $200 or more.  A bit pricy for a starving hackerspace, so we are doing what all good hackers do, overengineer a solution with parts at hand.  In this case, utilize the door RFID tags the members have anyways and use them to debit from a pre paid pop account.
 +
 +
== Goal ==
 +
 +
With the participation and collaboration of the ents membership, bring the donated Pop machine back into service.
 +
 +
To provide a project for multiple members to collaborate together to create a near 0 administration pop machine/pop account tracking system.
 +
 +
To create a low hassle method of buying caffeine.
 +
 +
To promote more collaborative team building projects within the membership that cross disciplines and foster education and participation.
  
 
== Help Wanted ==  
 
== Help Wanted ==  
Line 18: Line 28:
 
We are looking for people with an interest in helping out with the following phases of the project. We will offer assistance and training for any piece involved.
 
We are looking for people with an interest in helping out with the following phases of the project. We will offer assistance and training for any piece involved.
  
Display Design - ART - Replace the coke sign with a plexiglass version, needs to be able to show a screen.
+
*Display Design - ART - Replace the coke sign with a plexiglass version, needs to be able to show a screen.
Screen Saver - Screen saver that would display fake ad's
+
*Screen Saver - Screen saver that would display fake ad's
Screen mount - Mount a monitor to the outer door
+
*Screen mount - Mount a monitor to the outer door
Outer Shell Design - self explanatory
+
*Outer Shell Design - self explanatory
PHP Web Interface - only needs to interface with Pay Pal and save transaction records in the database
+
*PHP Web Interface - only needs to interface with Pay Pal and save transaction records in the database
  
 
== Mechanics ==
 
== Mechanics ==
Line 28: Line 38:
 
The machine is a Vendo V384. [http://soda-machines.com/index.php?option=com_content&task=view&id=554&Itemid=14 Soda-Machines.com]
 
The machine is a Vendo V384. [http://soda-machines.com/index.php?option=com_content&task=view&id=554&Itemid=14 Soda-Machines.com]
  
Oricanus did much of the work to figure out the mechanics of the machine and how to bypass the coin mech to allow us to dispense product.  It's actually very easy.  On the connector to the coin mech, short pins 1-7 together (all the time) and then momentarily contact pins 1-3 and then make your selection.
+
Orcinus did much of the work to figure out the mechanics of the machine and how to bypass the coin mech to allow us to dispense product.  It's actually very easy.  On the connector to the coin mech, short pins 1-7 together (all the time) and then momentarily contact pins 1-3 and then make your selection.
  
The original coke sign is a plexiglass insert, easily replaced.  Behind it is a florecent ballast with a 120v supply line running to it.
+
The original coke sign is a plexiglass insert, easily replaced.  Behind it <strike>is</strike> was a florecent ballast with a 120v supply line running to it, now that line is powering the Pi and all the rest.
  
Photo of the internal electromechanical schematic:
+
As of 12/13/13:  
[[Media:RFIDpop_mech_schematic.jpg]]
+
* The mechanical components have been de-greased and lubricated.
 +
* Column #2 was fully rebuilt after it was found jammed.
 +
* All column dispensing mechanisms are working in an empty state (see to-do list).
 +
* 5 columns are >50% loaded and dispensing.
 +
* Proper loading configuration was figured out and instructions afixed inside
 +
* Plastic exit chute was found to be stuck shut from a long ago exploded can.  Removed and washed
 +
* Monitor has been mounted, though mounting scheme may change in the future
 +
* Pi and other components installed and a first run of RFID enabled dispensing is available
  
== Goal ==
+
To-Do:
 +
* <strike>Clean all surfaces, particularly the compressor compartment</strike>
 +
* Clean and measure outside surfaces for painting/decals
 +
* Paint trim areas and fix chipping of paint
 +
* Column #1 needs adjustment to sync up the gear works when loaded
 +
* Software currently crashing often.  Needs lots of work
 +
* Need a second relay to cut power to the credit relay after timeout
  
With the participation and collaboration of the ents membership, bring the donated Pop machine back into service.
+
== Photo's: ==
  
To provide a project for multiple members to collaborate together to create a near 0 administration pop machine/pop account tracking system.  
+
Photo of the internal electromechanical schematic:
 +
[[Media:RFIDpop_mech_schematic.jpg]]
  
To create a low hassle method of buying caffeine.
+
Photo of the Prototype system in it's first live test on the machine (it worked!)
 +
[[Media:Pop-Pi_first_test.jpg]]
  
To promote more collaborative team building projects within the membership that cross disciplines and foster education and participation.
+
Photo of the replacement Plexiglass sign in it's test fit (note the blue protective plastic is still in place)
 +
[[Media:Pop-Pi_Plex_Test_fit.jpg]]
 +
 
 +
Photo of Orcinus playing around
 +
[[Media:Pop-Pi_Orc_face.jpg]]
  
 
== Feature Roadmap ==
 
== Feature Roadmap ==
Line 223: Line 252:
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td></td><td>9</td><td>12</td><td>To S on Relay</td>
+
<td></td><td>9</td><td>10</td><td>To A1 on level shifter pass through to TX on RFID reader</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td></td><td>11</td><td>14</td><td></td>
+
<td></td><td>11</td><td>12</td><td>To A2 on level shifter pass through to Enable on RFID reader</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
<td></td><td>13</td><td>14</td><td></td>
+
<td></td><td>13</td><td>14</td><td>To S on Relay</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 250: Line 279:
 
</tr>
 
</tr>
 
</table>
 
</table>
 
 
  
 
== Database ==
 
== Database ==
Line 270: Line 297:
 
<td>RFID</td>
 
<td>RFID</td>
 
<td>varchar</td>
 
<td>varchar</td>
<td>hex value of the member's rfid</td>
+
<td>decimal value of the member's rfid</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 283: Line 310:
 
</tr>
 
</tr>
 
</table>
 
</table>
 
 
 
 
  
 
== Fritzing Schematic ==
 
== Fritzing Schematic ==
Line 294: Line 317:
  
  
 
+
* [[File:popPi.zip]] popPi Fritzing schematic
  
  
Line 316: Line 339:
 
On scan, Pi checks database for balance.  If sufficient balance, deduct $1 and dispense product.  If insufficent balance, then display an unhappy message .  Once product is dispensed display the username and balance remaining for 15 seconds.  When 'idle' the screen will goto a slide show of comical and ficticious beverages (Duff, Slurm, Nukacola, etc)
 
On scan, Pi checks database for balance.  If sufficient balance, deduct $1 and dispense product.  If insufficent balance, then display an unhappy message .  Once product is dispensed display the username and balance remaining for 15 seconds.  When 'idle' the screen will goto a slide show of comical and ficticious beverages (Duff, Slurm, Nukacola, etc)
  
Curent Status: In prototype.  RFID via GPIO working.  GPIO relay control working. Rough software proof of concept working.
+
Curent Status: In prototype:  Replacement plexiglass for front obtained, monitor stripped to bare minimum and test fit3d printed mount made for all computer hardware, first test on the actual pop machine with prototype Pi setup was a success! Now running with test code for dispensing.
 +
 
 +
<strike>RFID via GPIO working.  GPIO relay control working. Rough software proof of concept working.</strike>
  
 
To-Do:
 
To-Do:
*Clean machine mechanics.  Lube everything inside.  Test all mechanics
+
*<strike>Clean machine mechanics.  Lube everything inside.  Test all mechanics</strike> Done, see Mechanics section
*Paypal integration
+
*Paypal integration (Noel?)
*Web Front End for manual account balance adjustment
+
*Web Front End for manual account balance adjustment (Noel?)
*Custom graphics for sides, front
+
*Custom graphics for sides, front (Karley, others)
 
*Custom made circut boards for sturdy integration
 
*Custom made circut boards for sturdy integration
*3d print mounting brackets once layout confirmed
+
*<strike>3d print mounting brackets once layout confirmed</strike> Printed and installed
  
 
== V2 ==
 
== V2 ==
Line 336: Line 361:
 
*Ability to dispense products at different prices (water $.25, beer $5)
 
*Ability to dispense products at different prices (water $.25, beer $5)
 
*Consumption graphs
 
*Consumption graphs
 
+
*Twitter inegration (<foo> just bought a pop!)
  
 
== Useful Links ==
 
== Useful Links ==
Line 354: Line 379:
 
[https://developer.paypal.com/ https://developer.paypal.com/]
 
[https://developer.paypal.com/ https://developer.paypal.com/]
  
[http://www.learn2crack.com/2013/10/setup-apache-web-server-php-mysql-raspberry-pi.html
+
[http://www.learn2crack.com/2013/10/setup-apache-web-server-php-mysql-raspberry-pi.html http://www.learn2crack.com/2013/10/setup-apache-web-server-php-mysql-raspberry-pi.html]
http://www.learn2crack.com/2013/10/setup-apache-web-server-php-mysql-raspberry-pi.html]
+
 
 +
[http://www.adafruit.com/blog/2013/09/05/pool-table-accepts-bitcoin-with-help-from-raspberry-pi/ http://www.adafruit.com/blog/2013/09/05/pool-table-accepts-bitcoin-with-help-from-raspberry-pi/]
 +
 
 +
[http://www.vendoco.com/Documents/Super%20Stack%20Service_WHOLE.pdf http://www.vendoco.com/Documents/Super%20Stack%20Service_WHOLE.pdf]
 +
 
 +
[http://www.vendoco.com/Documents.aspx?ID=14 http://www.vendoco.com/Documents.aspx?ID=14]
 +
 
 +
[http://www.vendoco.com/Documents/Superstack%20Parts%20Manual.pdf http://www.vendoco.com/Documents/Superstack%20Parts%20Manual.pdf]
 +
 
 +
[http://soda-machines.com/discussions/index.php?PHPSESSID=iqh2425abe8gmpkv38e6j6i717&topic=13985.10 http://soda-machines.com/discussions/index.php?PHPSESSID=iqh2425abe8gmpkv38e6j6i717&topic=13985.10]
 +
 
 +
[http://alexba.in/blog/2013/01/07/use-your-raspberrypi-to-power-a-company-dashboard/ http://alexba.in/blog/2013/01/07/use-your-raspberrypi-to-power-a-company-dashboard/]
  
 
== Notes ==
 
== Notes ==
Line 363: Line 399:
 
There is lots of room to mount everything behind plexiglass on the outer door or against the inner door.  Approximatly 4" depth is available
 
There is lots of room to mount everything behind plexiglass on the outer door or against the inner door.  Approximatly 4" depth is available
  
Need to also write up how to properly load product or else bad things happen
+
<strike> Need to also write up how to properly load product or else bad things happen </strike> The mechanics need to be advanced via a couple dispense attempts while empty until the 'bar' is in it's high spot.  Cans are started loading on top of this bar, and not the dispensing 'hopper'area below.  Loading 8-10 cans, advancing two more cycles of dispensing will load the 'hopper' and it will be ready to go.  The machine will trigger 'empty' while there are still 6-8 cans in it.  This prevents having to go through this process again and leaves things 'primed' so one just has to stack more on top.  Do not empty the column completely unless absolutely nessecary.
 +
 
 +
[http://www.vendoco.com/Documents/Super%20Stack%20Service_WHOLE.pdf The service manual] on page 11 shows how to properly load up cans as described above, complete with pictures
 +
 
 +
A video of the loading procedure will be made and uploaded to ensure it is done properly in case others need to do so.
  
 
A large number of vending machines use the same interface for the 'credit' function.  This project can be easily adapted to other models of vending machines.  Could be useful for other hackerspaces.
 
A large number of vending machines use the same interface for the 'credit' function.  This project can be easily adapted to other models of vending machines.  Could be useful for other hackerspaces.

Latest revision as of 14:38, 13 December 2013

Contents

[edit] RFID Enabled Pop Machine AKA Project "Pop-pi"

[edit] History

After the kind donation of a 70'sish Coca-Cola Vending machine, we started tearing into it to get it working. While there were a few issues off the start, it's in good mechanical order and tests showed it's power consumption was >50% less than the existing smaller pop machine in the space.

One major problem was that the coin mechanism would not accept newer loonies and toonies. A replacement mechanism would be $200 or more. A bit pricy for a starving hackerspace, so we are doing what all good hackers do, overengineer a solution with parts at hand. In this case, utilize the door RFID tags the members have anyways and use them to debit from a pre paid pop account.

[edit] Goal

With the participation and collaboration of the ents membership, bring the donated Pop machine back into service.

To provide a project for multiple members to collaborate together to create a near 0 administration pop machine/pop account tracking system.

To create a low hassle method of buying caffeine.

To promote more collaborative team building projects within the membership that cross disciplines and foster education and participation.

[edit] Help Wanted

Want to help out? Interested in learning something new and expanding your skill set? Have a cool idea you want to include into the project?

Join the Pop-PI project! Do you know PHP, would you like to learn PHP?

We are looking for people with an interest in helping out with the following phases of the project. We will offer assistance and training for any piece involved.

  • Display Design - ART - Replace the coke sign with a plexiglass version, needs to be able to show a screen.
  • Screen Saver - Screen saver that would display fake ad's
  • Screen mount - Mount a monitor to the outer door
  • Outer Shell Design - self explanatory
  • PHP Web Interface - only needs to interface with Pay Pal and save transaction records in the database

[edit] Mechanics

The machine is a Vendo V384. Soda-Machines.com

Orcinus did much of the work to figure out the mechanics of the machine and how to bypass the coin mech to allow us to dispense product. It's actually very easy. On the connector to the coin mech, short pins 1-7 together (all the time) and then momentarily contact pins 1-3 and then make your selection.

The original coke sign is a plexiglass insert, easily replaced. Behind it is was a florecent ballast with a 120v supply line running to it, now that line is powering the Pi and all the rest.

As of 12/13/13:

  • The mechanical components have been de-greased and lubricated.
  • Column #2 was fully rebuilt after it was found jammed.
  • All column dispensing mechanisms are working in an empty state (see to-do list).
  • 5 columns are >50% loaded and dispensing.
  • Proper loading configuration was figured out and instructions afixed inside
  • Plastic exit chute was found to be stuck shut from a long ago exploded can. Removed and washed
  • Monitor has been mounted, though mounting scheme may change in the future
  • Pi and other components installed and a first run of RFID enabled dispensing is available

To-Do:

  • Clean all surfaces, particularly the compressor compartment
  • Clean and measure outside surfaces for painting/decals
  • Paint trim areas and fix chipping of paint
  • Column #1 needs adjustment to sync up the gear works when loaded
  • Software currently crashing often. Needs lots of work
  • Need a second relay to cut power to the credit relay after timeout

[edit] Photo's:

Photo of the internal electromechanical schematic: Media:RFIDpop_mech_schematic.jpg

Photo of the Prototype system in it's first live test on the machine (it worked!) Media:Pop-Pi_first_test.jpg

Photo of the replacement Plexiglass sign in it's test fit (note the blue protective plastic is still in place) Media:Pop-Pi_Plex_Test_fit.jpg

Photo of Orcinus playing around Media:Pop-Pi_Orc_face.jpg

[edit] Feature Roadmap

Planned and Implemented features, if you would like to participate or learn about any of the features contact the people who are associated with the feature or talk to one of us.


Feature Description Version Complete
Read RFID Ability to read members's RFID tag 1 Yes Render, Colin
Credit Vending Machine Ability to credit the vending machine to allow the dispencing of caffeene 1 Yes
Track Member Account Ability to track member's pop account balance 1 Yes Colin
Deduct From Member Account Ability to deduct a credit from a members's account balance 1 Yes Colin
Email Balance to Member Ability to email a balance to a member's account from pop.pi@ents.ca 2 No Render, Colin
Member Account Top Up Ability to top up a members account. 2 No Colin
Pay Pal Top Up Ability to top up a members account from paypal payment TBD No
Video Display Balance Video display member balance information 3 No
Video Advertizing Make use of the video monitor for displaying ad's 4 No
Mounting Brackets 3D Printed Mounting Brackets Modeled to hold the PI and Relay 2 No
RFID Mounting 3D Printed Mounting Brackets Modeled to hold the RFID where the Change was inserted. 3 No
Bitcoin Payments Have the ability to take bitcoin payments. TBD No
Speaker Feedback Make use of the audio jack on the pi to output auditory feedback on payment.</br>

Sounds to be determined. (Lottery Machine noises, Portal Sounds)

TBD No
Motion Detector Make use of a motion detector as a type of Occupancy sensor for the display screen as well as feedback on when to enable/disable the rfid reader. TBD No

API to interface to paypapal.

3D Printed mount for the RFID reader.

Pop Level Management.

Include a web cam to be hosted on live hacker spaces. "Live from the pop machine!"

[edit] PI Pinout Assignments

In Progress.

Assignment Pin Pin Assignment
3v3 to LV on Logic Converter125V to HV on logic converter
345V to + on Relay
56
78GND to Logic Converter
910To A1 on level shifter pass through to TX on RFID reader
1112To A2 on level shifter pass through to Enable on RFID reader
1314To S on Relay
1516
1718
1920
2122
2324
2526

[edit] Database

Table: MemberAccount

Column DataType Description
Id int auto increment id for the account table
RFID varchar decimal value of the member's rfid
Account int account balance
Email varchar used to email users when their account is low

[edit] Fritzing Schematic

Fritzing can be found at http://fritzing.org/download/




https://github.com/adafruit/Fritzing-Library

[edit] V1

Version 1 is to basically setup the nessecary hardware to replace the coin mech and to use the RFID tags to debit from an account with little or no modification to the existing electro mechanical dispensing system. Various options were considered but parts on hand and flexibility came together in the following:

  • Raspberry Pi running Raspian 2013-09-25 (Render)
  • Parallax Serial RFID Reader (Render)
  • TTL level shifter for 5v RFID reader to talk to 3.3v Pi serial gpio pins (Colin)
  • Solid state relay board (on order)
  • HDMI to DVI Adapter (Render)
  • Random LCD monitor from around the space
  • Powered USB hub (Render)


Current goals: Users provide cash or paypal to director who adds to account for thier tag via web interface or 'credit' tags on the pi.

On scan, Pi checks database for balance. If sufficient balance, deduct $1 and dispense product. If insufficent balance, then display an unhappy message . Once product is dispensed display the username and balance remaining for 15 seconds. When 'idle' the screen will goto a slide show of comical and ficticious beverages (Duff, Slurm, Nukacola, etc)

Curent Status: In prototype: Replacement plexiglass for front obtained, monitor stripped to bare minimum and test fit. 3d printed mount made for all computer hardware, first test on the actual pop machine with prototype Pi setup was a success! Now running with test code for dispensing.

RFID via GPIO working. GPIO relay control working. Rough software proof of concept working.

To-Do:

  • Clean machine mechanics. Lube everything inside. Test all mechanics Done, see Mechanics section
  • Paypal integration (Noel?)
  • Web Front End for manual account balance adjustment (Noel?)
  • Custom graphics for sides, front (Karley, others)
  • Custom made circut boards for sturdy integration
  • 3d print mounting brackets once layout confirmed Printed and installed

[edit] V2

Feature requests/ideas:

  • Product remaining display
  • Tie in with mastercontrol
  • Ability to paypal monies directly to the pi to increase balance (or user added code via web interface)
  • Random dispense mode (slot machine)
  • Ability to dispense products at different prices (water $.25, beer $5)
  • Consumption graphs
  • Twitter inegration (<foo> just bought a pop!)

[edit] Useful Links

http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/

http://soda-machines.com/index.php?option=com_content&task=view&id=554&Itemid=14

http://stackoverflow.com/questions/372885/how-do-i-connect-to-a-mysql-database-in-python

http://www.sundh.com/blog/2013/09/connect-parallax-rfid-to-raspberry-pi/

http://zetcode.com/db/mysqlpython/

http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/217-getting-started-with-raspberry-pi-gpio-and-python

https://developer.paypal.com/

http://www.learn2crack.com/2013/10/setup-apache-web-server-php-mysql-raspberry-pi.html

http://www.adafruit.com/blog/2013/09/05/pool-table-accepts-bitcoin-with-help-from-raspberry-pi/

http://www.vendoco.com/Documents/Super%20Stack%20Service_WHOLE.pdf

http://www.vendoco.com/Documents.aspx?ID=14

http://www.vendoco.com/Documents/Superstack%20Parts%20Manual.pdf

http://soda-machines.com/discussions/index.php?PHPSESSID=iqh2425abe8gmpkv38e6j6i717&topic=13985.10

http://alexba.in/blog/2013/01/07/use-your-raspberrypi-to-power-a-company-dashboard/

[edit] Notes

Power is no problem. The existing light ballast for the original backlight is 120v line that is perfectly placed to power everything.

There is lots of room to mount everything behind plexiglass on the outer door or against the inner door. Approximatly 4" depth is available

Need to also write up how to properly load product or else bad things happen The mechanics need to be advanced via a couple dispense attempts while empty until the 'bar' is in it's high spot. Cans are started loading on top of this bar, and not the dispensing 'hopper'area below. Loading 8-10 cans, advancing two more cycles of dispensing will load the 'hopper' and it will be ready to go. The machine will trigger 'empty' while there are still 6-8 cans in it. This prevents having to go through this process again and leaves things 'primed' so one just has to stack more on top. Do not empty the column completely unless absolutely nessecary.

The service manual on page 11 shows how to properly load up cans as described above, complete with pictures

A video of the loading procedure will be made and uploaded to ensure it is done properly in case others need to do so.

A large number of vending machines use the same interface for the 'credit' function. This project can be easily adapted to other models of vending machines. Could be useful for other hackerspaces.

[edit] Code Repository

Code is GPLv2 and available on Github at https://github.com/renderlab/ENTS-Pop-Pi

Personal tools
Namespaces

Variants
Actions
Navigation
Members
Toolbox