loading

A few months ago, I went to an activity about the makers and I saw some people selling the jelly beans. But, however, they were selling the jelly beans by themselves. So I had an idea----use a robot to sell the jelly bean. I think I can use the Arduino board to make the auto-jelly beanbot. And I think that I can use internet of things to make it better.
The function of it:

1. To give the jelly bean out.

2. Suppose and use we-chat payment.

Step 1: Prepare for the Material and Tools

For material:
1. step motor

2. LCD1602

3. Arduino UNO

4.Step motor driver

5. 7.2v Li-Po

6. The case

7. Dupont line

8.PVC tube

9.spiral tube

10.power line

11.Wifi-module

For tools:

1. electric iron

2.Smartphone

Step 2: Control a Step Motor

step motor:

Arduino Uno-----------Expansion board

8------EN(stepper motor driver enable, active low)

7------Z.DIR (Z axis direction)

6------Y.DIR (Y axis direction)

5------X.DIR (control X axis)

4------Z.STEP (Z axis stepping control)

3------Y.STEP (Y axis stepping control)

2------X.STEP (X axis stepping control)

As the picture above, it showes us the step motor and we should put the tow lines with 5V and GND. Then move them to the tow tops shows on the picture.

And I showed the program below.

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C mylcd(0x3F,16,2);

void attachInterrupt_fun_3() {

digitalWrite(2,HIGH);

delayMicroseconds(500);

digitalWrite(2,LOW);

delayMicroseconds(500);

}

void setup()

{

pinMode(8, OUTPUT);

pinMode(5, OUTPUT);

digitalWrite(8,LOW);

digitalWrite(5,HIGH);

pinMode(3, INPUT);

pinMode(2, OUTPUT);

mylcd.init();

mylcd.backlight();

}

void loop()

{

attachInterrupt(digitalPinToInterrupt(3),attachInterrupt_fun_3,RISING);

delay(1000);

mylcd.setCursor(0, 0);

mylcd.print("payment success!!");

mylcd.setCursor(0, 1);

mylcd.print("Thank you!");

}

I used pin8,pin5 and pin2 for it. Pin8 can control the x axis and the board can control x,y,z three step motors. I want it to work when I press the button. But this is just a test for the project. In the end, I want to use we-chat payment to control it.

Step 3: 1602LCD

This robot use internet to work. And it has some payment so I should do something to show the consumers that they have bought the things. So I put a Lcd on it to show the consumers that their payment's success.

Then I will show you the program:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C mylcd(0x3F,16,2);

void setup() { mylcd.init(); mylcd.backlight(); }

void loop() { mylcd.setCursor(0, 0); mylcd.print("payment success!!"); mylcd.setCursor(0, 1); mylcd.print("Thank you!");

}

Step 4: Esp8266---Wifi Module---but Use Bluetooth Now

This part is about the most difficult part of this robot. We should connect it into the internet and use some internet payment to finish the work. Then we can use it to get the candy. But this part is too difficult for me now, so I want to use bluetooth to make it. I wish I would finish it and I will release it again. For using bluetooth, I use HC-06 that is a kind of bluetooth equipment.

Below is the program:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

char item;

LiquidCrystal_I2C mylcd(0x3f,16,2);

void setup()

{

pinMode(8, OUTPUT);

pinMode(5, OUTPUT);

pinMode(7, OUTPUT);

item = 0;

digitalWrite(8,LOW);

digitalWrite(5,HIGH);

digitalWrite(7,HIGH);

mylcd.init();

mylcd.backlight();

Serial.begin(9600);

pinMode(2, OUTPUT);

pinMode(3, OUTPUT);

}

void loop()

{

mylcd.setCursor(0, 0);

mylcd.print("candy bot");

mylcd.setCursor(0, 1);

mylcd.print("by Sean");

if (Serial.available() > 0) {

item = Serial.read();

if (item == 'a') {

mylcd.clear();

mylcd.setCursor(0, 0);

mylcd.print("payment success!");

mylcd.setCursor(0, 1);

mylcd.print("thank you!");

delay(2000);

mylcd.clear();

mylcd.setCursor(1-1, 1-1);

mylcd.print(".......");

delay(1000);

mylcd.clear();

for (int i = 1; i <= 200; i = i + (1)) {

digitalWrite(2,HIGH);

delayMicroseconds(800);

digitalWrite(2,LOW);

delayMicroseconds(800);

}

}

if (item == 'b') {

mylcd.clear();

mylcd.setCursor(0, 0);

mylcd.print("payment success!");

mylcd.setCursor(0, 1);

mylcd.print("thank you!");

delay(2000);

mylcd.clear();

mylcd.setCursor(1-1, 1-1);

mylcd.print(".......");

delay(1000);

mylcd.clear();

for (int i = 1; i <= 500; i = i + (1)) {

digitalWrite(3,HIGH);

delayMicroseconds(800);

digitalWrite(3,LOW);

delayMicroseconds(800);

}

}

}

}

And you can change the sentence into whatever you want.

http://www.arduino.cn/thread-19105-1-1.html

You can go to this part to learn about the internet payment.

I feel sorry for I did not finish the we-chat payment part. And I will sent you guys about this when I finish it.

Step 5: The Case of the Robot

You can make it by yourself. And I will show you my case. I wish it can help you.

<p>Awesome! Two of the my favorite things in one project. Robots and candy.</p>

About This Instructable

1,090views

12favorites

License:

More by cdisSean:Brilliant candy-bot 
Add instructable to: