Makers create a vending machine capable of accepting RFID payments, while tweeting funny updates.
As you’ve seen in previously featured projects on Bits & Pieces, we love ourselves some connected tweeting vending machines. Added to the growing list is a recent IoT contraption from Makers Kristian Sloth Lauszus and Sigurd Jervelund Hansen. After the duo was able to get hold of an old vending machine, which featured a non-working MCU on its main board, they quickly decided to mod it into an RFID-enabled dispenser that could also tweet funny updates about it.
The system is driven by a pair of Arduino Pro Mini units (ATmega328) and and an Electric Imp. Aside from reusing some shift registers, relays and voltage regulators from its original main board, the Makers embedded a Pro Mini onto the board to handle the reading as well as illuminate its buttons, control its 7-segment LED display, interpreting the output from the coin validator and return money if the user requests it by pressing a dedicated button. Meanwhile, a second ATmega328 based ‘duino was tasked with reading the contactless cards using a MIFARE RC522 reader, which stored a tag ID in its EEPROM and checked to see if there was a remaining balance. The two microcontrollers were simply connected via UART and communicated via Serial.
“If I would have to do it again I would properly use a larger microcontroller like the ATmega1284P which is also used on the Balanduino. The reason why we did not use this chip to begin with, was because the RFID/NFC capability was added later on and we ran out of I/O pins on the first Arduino Pro Mini,” Lauszus explains.
To bring this idea to life, the team had to first reverse engineer the machine’s original coin validate to determine how it detected and counted coins. Once figured out, they built a custom driver board to drive the solenoids. On top of that, the team also made the device social-savvy.
The duo began by connecting a Raspberry Pi to the Arduino via Bluetooth, but as the SD card on the Raspberry Pi kept getting corrupt, decided to use an Electric Imp instead. For those unfamiliar with the MCU, it features a 32-bit ARM Cortex M3 core with a Wi-Fi module built into a SD card form-factor.
How it works is relatively simple. The Arduino sends out a status update every minute, while the Electric Imp shares a post if there are any updates. For example, if a beverage was dispensed, then the Imp will send a tweet to let the world know. Moreover, the gadget also tweets if any of the slots are jammed or empty, along with tagging the individual responsible for restocking the machine.
Enjoy this mod? You may love a pair of other DIY projects as well. For one, a UK-based group from the Nottingham Hackspace recently rigged its snack dispensary into a tweeting vending machine that kept its members accountable for what they eat. The team was able to get a second-hand machine off eBay and fitted it with an Arduino. Meanwhile, another Maker developed an innovative way to monitor how often his colleagues were consuming coffee with an ATmega168 based gizmo. This could then single out those caffeine fiends responsible for restocking the coffee supply at the end of the week.


