Posts | Comments

Planet Arduino

Archive for the ‘candy’ Category

There are some debates that split the world down the middle. Serious stuff: M&Ms, or Smarties*? Yes, the two chocolate beans may bear a superficial resemblance to each other, but you’re either a Smartie lover, or an M&M lover. No compromises.

[Maximusvo] has sensibly dodged all questions of brand loyalty in his text if not in his images even though it’s obvious what kind of confectionery he’s working with in his candy vending machine. The hard-shell chocolates are loaded into a hopper, from which a colourful cascade is released onto a scale. When the desired weight has been accumulated, it is tipped into a drawer for the hungry recipient.

Behind it all is an Arduino with a motor to release the beans, a load cell to weigh them, and an LCD display to give a status report. A motor vibrates the chute to ensure they move down it, but as can be seen in the video demo below the break it’s not doing an entirely successful job. There is an external buzzer to indicate delivery, and aside from the wooden construction of the machine there are 3D printed parts in the scale.

Most of the vending machines we’ve shown you have involved not Smarties or M&Ms, but cans of soda. Perhaps your high school locker can house one, or failing that you’d like to raid someone else’s machine.

*European chocolate Smarties, that is, not American candy sweets.


Filed under: Arduino Hacks

If you have OCD, then the worst thing someone could do is give you a bowl of multi-coloured M&M’s or Skittles — or Gems if you’re in the part of the world where this was written. The candies just won’t taste good until you’ve managed to sort them in to separate coloured heaps. And if you’re a hacker, you’ll obviously build a sorting machine to do the job for you.

Use our search box and you’ll find a long list of coverage describing all manner and kinds of sorting machines. And while all of them do their designated job, 19 year old [Willem Pennings]’s m&m and Skittle Sorting Machine is the bees knees. It’s one of the best builds we’ve seen to date, looking more like a Scandinavian Appliance than a DIY hack. He’s ratcheted up a 100k views on Youtube, 900k views on imgur and almost 2.5k comments on reddit, all within a day of posting the build details on his blog.

As quite often happens, his work is based on an earlier design, but he ends up adding lots of improvements to his version. It’s got a hopper at the top for loading either m&m’s or Skittles and six bowls at the bottom to receive the color sorted candies. The user interface is just two buttons — one to select between the two candy types and another to start the sorting. The hardware is all 3D printed and laser cut. But he’s put in extra effort to clean the laser cut pieces and paint them white to give it that neat, appliance look. The white, 3D printed parts add to the appeal.

Rotating the input funnel to prevent the candies from clogging the feed pipes is an ace idea. A WS2812 LED is placed above each bowl, lighting up the bowl where the next candy will be ejected and at the same time, a WS2812 strip around the periphery of the main body lights up with the color of the detected candy, making it a treat, literally, to watch this thing in action. His blog post has more details about the build, and the video after the break shows the awesome machine in action.

And if you’re interested in checking out how this sorter compares with some of the others, check out these builds — Skittles sorting machine sorts Skittles and keeps the band happy, Anti-Entropy Machine Satiates M&M OCD, Only Eat Red Skittles? We’ve Got You Covered, and Hate Blue M&M’s? Sort Them Using the Power of an iPhone!  As we mentioned earlier, candy sorting machines are top priority for hackers.

[via r/electronics]


Filed under: Arduino Hacks, cooking hacks

Seems like just about every hackerspace eventually ends up with an old vending machine that gets hacked and modded to serve up parts, tools, and consumables. But why don’t more hackerspaces build their own vending machines from scratch? Because as [Ryan Bates] found out, building a DIY vending machine isn’t as easy as it looks.

[Ryan]’s “Venduino” has a lot of hackerspace standard components – laser-cut birch plywood case, Parallax continuous rotation servos, an LCD screen from an old Nokia phone, and of course an Arduino. The design is simple, but the devil is in the details. The machine makes no attempt to validate the coins going into it, the product augurs are not quite optimized to dispense reliably, and the whole machine can be cleaned out of product with a few quick shakes. Granted, [Ryan] isn’t trying to build a reliable money-making machine, but his travails only underscore the quality engineering behind modern vending machines. It might not seem like it when your Cheetos are dangling from the end of an auger, but think about how many successful transactions the real things process in an environment with a lot of variables.

Of course, every failure mode is just something to improve in the next version, but as it is this is still a neat project with some great ideas. If you’re more interested in the workings of commercial machines, check out our posts on listening in on vending machine comms or a Tweeting vending machine.

[via r/arduino]


Filed under: Arduino Hacks, misc hacks

Final_Without_HousingWith some simple programming and a few basic parts, you can rig up a candy vending machine that slides sweets toward you at the push of a button.

Read more on MAKE

The post Build an Arduino-Powered Candy Vending Machine appeared first on Make: DIY Projects, How-Tos, Electronics, Crafts and Ideas for Makers.

Ott
31

Push Button, Receive Candy (or Death)

arduino hacks, arduino uno, candy, candy machine, cereal dispenser, Holiday Hacks, NEMA-17 Commenti disabilitati su Push Button, Receive Candy (or Death) 

candy-or-deathWill you be handing out candy on Halloween? Maybe you have a party to attend or kids to take around the neighborhood and can’t be home to answer the bell. You don’t want to be The Dark House With No Candy, ’cause that’s a good way to get TP’d. We’re not exactly sure what [Ben]‘s catalyst was aside from trying to avoid tempting would-be thieves with an unattended bowl on the porch. Whatever the reason, we’re happy to present Candy or Death, his gamified candy (or death)-dispensing machine.

Okay, so it only dispenses candy for now. [Ben] hasn’t quite worked the kinks out of his death ray. He designed it to sit behind a porch-facing window so it can’t be messed with. All trick-or-treaters can do is push the button and take the candy. It’s built around a cereal dispenser that’s modified to be cranked by a piece of round rod driven with a NEMA-17 stepper motor and an Arduino Uno with a motor shield. The candy slides down a length of aluminium rain gutter into a plastic stacking bin, and the whole thing is built into a nice wood frame.

A few adjustments were necessary to keep it from jamming. The dispenser’s hopper uses rubber blades to govern the flow, and he ended up removing a few and trimming the others. [Ben] has an album up of all his build pics and put his code on the gits. Stick around to see videos of the machine from the front and rear.


Filed under: Arduino Hacks, Holiday Hacks
Dic
22

Quick Candy Sorting Machine

arduino, arduino hacks, candy, sorter Commenti disabilitati su Quick Candy Sorting Machine 

570px-Sorting_machine_view

OCD. Sometimes things just get to you, like those pesky bags of randomly assorted candies. [Torsten] decided to build a sorting machine capable of sorting Skittles or M&Ms into separate cups by color at around 80 pieces per minute. It’s a great implementation, using an Arduino Duo. He based the code on the principles of a finite-state machine, in order to make it as quick as possible.

It works as you would expect: When a candy piece is loaded, the color is determined using an RGB sensor. A 360-degree servo is used to move the chute to the proper position, and interestingly, the system preemptively releases the candy before the chute is in position in order to maximize the speed. If you watch closely, you can see this behavior in the video (embedded after the break).

[Torsten] includes a complete bill of materials, if you’d like to try it for yourself. He also included a list of possible improvements.


Filed under: Arduino Hacks
This year my Halloween project is the Automatic Halloween Candy Dispenser® triggered by TextforTreat®, CallforTreat® (powered by Twilio)and @TweetforTreat® technologies. Of course it can also be triggered from a Big Red push button, but where is the fun in that?

When trick-or-treaters show up at my house they can text, call, or tweet a code displayed on an LCD screen to get their Halloween candy. They can also push the Big Red button.

Once the candy request is made a few "special" effects are triggered by X10 modules. A low laying fog machine is activated and lights turn on while the candy shoots down from my front deck on the second floor.

* Check my Instructable write up for more detailed information.




Candy Dispenser
Control Box
Main Box
Communication Bridge
Fog Machine
Lights and accesories


Candy Dispenser


The first thing was to figure out a good way to hold the candy and dispense it. I used a plastic bucket, a metal ventilation pipe and a CD attached to a servo motor. I figured that by having the candy dispense from the side as opposed to the bottom would allow the candy to move more freely and avoid candy jams.

The ventilation pipe comes in a "U" shape, so I made a "U" shaped cut in the bottom center of the bucket. Notice I did't cut the whole "U", instead I left a piece of plastic in the middle to hold the servo motor that rotates the CD.

After I inserted the ventilation pipe I did a few cuts to allow me to expand the pipe into a sheet form. I used a couple screws and bolts to keep the sheet attached to the bucket.  The rest of the space was covered by the mighty duck tape.

I cut the CD to allow the candy flow when rotated. Also I duck taped a continuous servo inside to function as a "shaker."


Control Box

The control box is pretty simple. I drilled/dremelled a few holes to attach the big red button, ioBridge LCD screen,  power jack and the RJ45 jack.

I really like the use of CAT 5 cable to make things more modular.

Main Box

The main program runs in the Arduino Duemilanove.  When the board is initialized it immediately makes a Web call to check for the current code and displays it on the LCD screen.

The main loop is waiting for either a physical push of the big red button or to receive a remote serial message. The attached XBee module communicates with another XBee module connected to the ioBridge IO-204 module serial board.

These are the digital I/O pins configuration:
  • XBee Module (with adafruit XBee kit)
    • Pin 13 - TX 
    • Pin 12 - RX
    • Gnd and 5v
  • Big Dome Push Button
    • Pin  8 - Button NO(normally open) +  GND + 100K. 
    • 5v - COM
  • Servo 1 (continuous rotating servo used for shaking)
    • Pin  7 - Data
    • Gnd and 5v
  • Servo 2 (used to rotate the CD)
    • Pin 6 - Data
    • Gnd and 5v
  • X10 C17A (x10 devices controller)
    • Pin  3 - DTR line for C17A - DB9 pin 4
    • Pin  2 - RTS line for C17A - DB9 pin 7
    • Gnd  - DB9 pin 5
  • ioBridge 16x2 serial LCD display
    • Pin 1 - LCD Data pin
    • Gnd and 5v
Attached is the Arduino Sketch, it also includes a library to control the ioBridge LCD screen.

Code Generator

I realized that someone with mischievous intentions could just tweet-spam the @Tweetfortreat account (or less likely someone could text or call my Twilio number numerous times) and I would end up with tons of candy on the floor.

Instead, I created a REST web service using of course my favorite web development tool, Oracle Application Express http://apex.oracle.com/ , to make sure a unique and random code was generated each time candy drop request was made from text, call or Twitter.

The REST application is really simple and I recognize it can also be created using any other technologies such as LAMP or even a GCI, or Perl application.

Application Objects:
  • 1 Table (ID,CODE,SELECTED)
  • 1 Numerical Sequence to generate primary key (ID)
  • 1 Trigger before insert record that will get the ID value and append a random number to the CODE column
  • 1 public procedure to retrieve the code (where selected = 1)
  • 1 public procedure to update the code once is used and generate a new one.
So I ended up with these two URL
http:/my.apexserver.com/pls/apex/getcode
http:/my.apexserver.com/pls/apex/updatecode?code=XXXX
*If you would like to implement something with a static file instead, I would recommend using http://www.random.org/clients/http/ to get a random number and store it in file, memory, or even the arduino itself.

ioBridge Setup

The ioBridge IO-204 is used as bridge (duh!) between the arduino and the internet. I am using the ioBridge serial board to connect an XBee module.

There are two main functions that the ioBridge was used for:
  1. Request current code
     I do a GET call from the arduino to retrieve the current code from my Code Generator service using ioBridge Serial Web Services API.
     Arduino code:
     mySerial.println("[[[get|http:/my.apexserver.com/pls/apex/getcode]]]");

      
  2. Start candy dropping sequence by text, call or tweet.
     An ioBridge widget will send a start character via serial message and the candy dropping sequence will start. This widget can be called using the ioBridge Static Widget API.
This URL  is called by Twilio and by my custom Twitter alert script.

http://www.iobridge.com/widgets/static/id=[widgetID]


These are the digital I/O pins configuration:
  • ioBridge Serial Board
  • TX - RX XBee
  • RX - TX XBee
  • GND and 5v

Twilio Setup


Twilio is a web-service API for communication apps. Twilio is as simple as it gets. It only  took me a short time to get my  SMS and Voice applications up and running! I had tried in the past to create similar applications with other technologies (VoiceXML and even Google Voice) and let me tell you is not that easy.

The voice application answers the phone, plays an intro sound file and asks for the code followed by the # sign. If a code is detected Twilio will do a "GET" action to a PHP file that will lookup the current code from my Code Generator Web Service. If it matches it will call the ioBridge static widget URL and candy will be dispensed.

The SMS application has almost the same PHP code except this time instead of looking for the digits dialed  it will look for body of the SMS message.

Check the attached XML and PHP files that generate the TwiML XML.

All in all Twilio is a winner and I have plenty of other ideas for the future.

Twitter Setup


No modern internet enabled project is complete without Twitter integration, right? :) Here is mine: This time i used a bash script, twurl and a crontab job to check for replies to @tweetfortreat. This bash script is running on my Sheevaplug, but it can be run in any linux/mac machine or it could be adapted to run as .bat in windows (using scheduled tasks).

Twurl is almost like curl but for Twitter. I did some ugly parsing of the twitter RSS feed to retrieve the tweet sender, but it works!

Here is my bash script
#!/bin/bash
mycode=`curl --silent http:/my.apexserver.com/pls/apex/getcode`
twitter=`twurl /1/statuses/mentions.rss | grep "@tweetfortreat $mycode" | cut -d ':' -f1 | tail -n 1 | cut -d '>' -f2`
echo $mycode $twitter
if [ -n "$twitter" ]; then
iobridge=`curl --silent http://www.iobridge.com/widgets/static/id=[widgetID]`
newkey=`curl --silent -d "code=$mycode" http:/my.apexserver.com/pls/apex/updatecode`
update=`twurl -d "status=@$twitter The code $mycode is correct. Happy Halloween!" /1/statuses/update.xml`
echo $newkey $iobridge
fi

Crontab will only allow you to execute a script every minute and I think is fine for now. Alternatively a while loop could be used instead.
Here is my crontab entry

*/1 * * * * /script_location/HalloweenCandy.sh > /dev/null 2>&1

Conclussion and Alternatives
If my Google skills (http://lmgtfy.com/?q=automatic+halloween+candy+dispenser)serve me well there are just not many documented Automatic Halloween Candy Dispensers out there. I did run into this one which I really like but is limited to M&Ms sized candy.I found some inspiration from the dog/cat feeders built using the internet enabled ioBridge http://support.iobridge.com/projects/tag/dog-feeder/.

I hope to see more iterations of the Automatic Halloween Candy Dispenser next year. Please make sure you share all your ideas/improvements in the comments section.


Happy Halloween!
Ott
26

Automatic Halloween Candy Dispenser

arduino, automatic halloween candy dispenser, candy, halloween, iobridge, twilio, twitter Commenti disabilitati su Automatic Halloween Candy Dispenser 

This year my Halloween project is the Automatic Halloween Candy Dispenser® triggered by TextforTreat®, CallforTreat® (powered by Twilio)and @TweetforTreat® technologies. Of course it can also be triggered from a Big Red push button, but where is the fun in that?

When trick-or-treaters show up at my house they can text, call, or tweet a code displayed on an LCD screen to get their Halloween candy. They can also push the Big Red button.

Once the candy request is made a few "special" effects are triggered by X10 modules. A low laying fog machine is activated and lights turn on while the candy shoots down from my front deck on the second floor.

* Check my Instructable write up for more detailed information.




Candy Dispenser
Control Box
Main Box
Communication Bridge
Fog Machine
Lights and accesories


Candy Dispenser


The first thing was to figure out a good way to hold the candy and dispense it. I used a plastic bucket, a metal ventilation pipe and a CD attached to a servo motor. I figured that by having the candy dispense from the side as opposed to the bottom would allow the candy to move more freely and avoid candy jams.

The ventilation pipe comes in a "U" shape, so I made a "U" shaped cut in the bottom center of the bucket. Notice I did't cut the whole "U", instead I left a piece of plastic in the middle to hold the servo motor that rotates the CD.

After I inserted the ventilation pipe I did a few cuts to allow me to expand the pipe into a sheet form. I used a couple screws and bolts to keep the sheet attached to the bucket.  The rest of the space was covered by the mighty duck tape.

I cut the CD to allow the candy flow when rotated. Also I duck taped a continuous servo inside to function as a "shaker."


Control Box

The control box is pretty simple. I drilled/dremelled a few holes to attach the big red button, ioBridge LCD screen,  power jack and the RJ45 jack.

I really like the use of CAT 5 cable to make things more modular.

Main Box

The main program runs in the Arduino Duemilanove.  When the board is initialized it immediately makes a Web call to check for the current code and displays it on the LCD screen.

The main loop is waiting for either a physical push of the big red button or to receive a remote serial message. The attached XBee module communicates with another XBee module connected to the ioBridge IO-204 module serial board.

These are the digital I/O pins configuration:
  • XBee Module (with adafruit XBee kit)
    • Pin 13 - TX 
    • Pin 12 - RX
    • Gnd and 5v
  • Big Dome Push Button
    • Pin  8 - Button NO(normally open) +  GND + 100K. 
    • 5v - COM
  • Servo 1 (continuous rotating servo used for shaking)
    • Pin  7 - Data
    • Gnd and 5v
  • Servo 2 (used to rotate the CD)
    • Pin 6 - Data
    • Gnd and 5v
  • X10 C17A (x10 devices controller)
    • Pin  3 - DTR line for C17A - DB9 pin 4
    • Pin  2 - RTS line for C17A - DB9 pin 7
    • Gnd  - DB9 pin 5
  • ioBridge 16x2 serial LCD display
    • Pin 1 - LCD Data pin
    • Gnd and 5v
Attached is the Arduino Sketch, it also includes a library to control the ioBridge LCD screen.

Code Generator

I realized that someone with mischievous intentions could just tweet-spam the @Tweetfortreat account (or less likely someone could text or call my Twilio number numerous times) and I would end up with tons of candy on the floor.

Instead, I created a REST web service using of course my favorite web development tool, Oracle Application Express http://apex.oracle.com/ , to make sure a unique and random code was generated each time candy drop request was made from text, call or Twitter.

The REST application is really simple and I recognize it can also be created using any other technologies such as LAMP or even a GCI, or Perl application.

Application Objects:
  • 1 Table (ID,CODE,SELECTED)
  • 1 Numerical Sequence to generate primary key (ID)
  • 1 Trigger before insert record that will get the ID value and append a random number to the CODE column
  • 1 public procedure to retrieve the code (where selected = 1)
  • 1 public procedure to update the code once is used and generate a new one.
So I ended up with these two URL
http:/my.apexserver.com/pls/apex/getcode
http:/my.apexserver.com/pls/apex/updatecode?code=XXXX
*If you would like to implement something with a static file instead, I would recommend using http://www.random.org/clients/http/ to get a random number and store it in file, memory, or even the arduino itself.

ioBridge Setup

The ioBridge IO-204 is used as bridge (duh!) between the arduino and the internet. I am using the ioBridge serial board to connect an XBee module.

There are two main functions that the ioBridge was used for:
  1. Request current code
     I do a GET call from the arduino to retrieve the current code from my Code Generator service using ioBridge Serial Web Services API.
     Arduino code:
     mySerial.println("[[[get|http:/my.apexserver.com/pls/apex/getcode]]]");

      
  2. Start candy dropping sequence by text, call or tweet.
     An ioBridge widget will send a start character via serial message and the candy dropping sequence will start. This widget can be called using the ioBridge Static Widget API.
This URL  is called by Twilio and by my custom Twitter alert script.

http://www.iobridge.com/widgets/static/id=[widgetID]


These are the digital I/O pins configuration:
  • ioBridge Serial Board
  • TX - RX XBee
  • RX - TX XBee
  • GND and 5v

Twilio Setup


Twilio is a web-service API for communication apps. Twilio is as simple as it gets. It only  took me a short time to get my  SMS and Voice applications up and running! I had tried in the past to create similar applications with other technologies (VoiceXML and even Google Voice) and let me tell you is not that easy.

The voice application answers the phone, plays an intro sound file and asks for the code followed by the # sign. If a code is detected Twilio will do a "GET" action to a PHP file that will lookup the current code from my Code Generator Web Service. If it matches it will call the ioBridge static widget URL and candy will be dispensed.

The SMS application has almost the same PHP code except this time instead of looking for the digits dialed  it will look for body of the SMS message.

Check the attached XML and PHP files that generate the TwiML XML.

All in all Twilio is a winner and I have plenty of other ideas for the future.

Twitter Setup


No modern internet enabled project is complete without Twitter integration, right? :) Here is mine: This time i used a bash script, twurl and a crontab job to check for replies to @tweetfortreat. This bash script is running on my Sheevaplug, but it can be run in any linux/mac machine or it could be adapted to run as .bat in windows (using scheduled tasks).

Twurl is almost like curl but for Twitter. I did some ugly parsing of the twitter RSS feed to retrieve the tweet sender, but it works!

Here is my bash script
#!/bin/bash
mycode=`curl --silent http:/my.apexserver.com/pls/apex/getcode`
twitter=`twurl /1/statuses/mentions.rss | grep "@tweetfortreat $mycode" | cut -d ':' -f1 | tail -n 1 | cut -d '>' -f2`
echo $mycode $twitter
if [ -n "$twitter" ]; then
iobridge=`curl --silent http://www.iobridge.com/widgets/static/id=[widgetID]`
newkey=`curl --silent -d "code=$mycode" http:/my.apexserver.com/pls/apex/updatecode`
update=`twurl -d "status=@$twitter The code $mycode is correct. Happy Halloween!" /1/statuses/update.xml`
echo $newkey $iobridge
fi

Crontab will only allow you to execute a script every minute and I think is fine for now. Alternatively a while loop could be used instead.
Here is my crontab entry

*/1 * * * * /script_location/HalloweenCandy.sh > /dev/null 2>&1

Conclussion and Alternatives
If my Google skills (http://lmgtfy.com/?q=automatic+halloween+candy+dispenser)serve me well there are just not many documented Automatic Halloween Candy Dispensers out there. I did run into this one which I really like but is limited to M&Ms sized candy.I found some inspiration from the dog/cat feeders built using the internet enabled ioBridge http://support.iobridge.com/projects/tag/dog-feeder/.

I hope to see more iterations of the Automatic Halloween Candy Dispenser next year. Please make sure you share all your ideas/improvements in the comments section.


Happy Halloween!


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook