Cov txheej txheem:

$ 1 Arduino-based Vending Machine: 8 Kauj Ruam
$ 1 Arduino-based Vending Machine: 8 Kauj Ruam

Video: $ 1 Arduino-based Vending Machine: 8 Kauj Ruam

Video: $ 1 Arduino-based Vending Machine: 8 Kauj Ruam
Video: Venduino, Arduino Vending Machine 2024, Hlis ntuj nqeg
Anonim
Image
Image
Casing
Casing

Peb tau txais peb lub tswv yim los ntawm peb tus kws qhia ntawv engineering - peb txhua tus xav tias nws yuav yog lub tswv yim zoo kom muaj lub tshuab muag khoom rau peb chav kawm thiab nws hais tias - "txias, ua ib qho". Nws tau muab tawm tias lub tshuab muag khoom yuav yog qhov haujlwm zoo tshaj plaws thiab thaum ua tiav yuav ua haujlwm raws li kev nrhiav nyiaj txiag rau peb txoj haujlwm engineering.

Nws hu ua $ 1 Vending Machine tsis yog vim nws raug nqi $ 1 los ua, tab sis tsuas yog vim tus neeg lees txais daim nqi yog tus qauv qub uas tsuas siv $ 1 nqi xwb:)

Kauj Ruam 1: Cov Qauv

Peb xav tau lub tshuab muag khoom uas yuav haum rau saum lub rooj thiab tsis siab dhau. Peb coj qhov ntev ntawm qhov dav ntawm lub rooj kom paub tseeb tias peb tsis muaj lub tshuab muag khoom dai ntawm lub rooj.

Kauj ruam 2: Casing

Casing
Casing
Casing
Casing
Casing
Casing

Peb ua peb lub thawv 19 ntiv dav los ntawm 17 ntiv tes ntev los ntawm 25 ntiv siab. Peb siv lub tshuab CNC txiav peb cov ntoo. Peb siv cov txheej txheem khov kho los tsim lub ntsej muag thiab tom qab ntawd hloov lawv mus rau kev kos cov hom ntaub ntawv rau peb CNC software. Peb txhuam cov ntug thiab tom qab ntawd ntswj lawv nrog 1 ¼ ". Peb txuas lub vaj huam sib luag pem hauv ntej nrog lub pob khawm thiab siv screws "cov ntsia hlau, yog li cov ntsia hlau yuav tsis hla mus rau lwm sab. Peb kuj siv Acrylic iav uas peb txiav rau lub txee thiab lub vaj huam sib luag pem hauv ntej.

Kauj ruam 3: Electronics

Electronics
Electronics
Electronics
Electronics
Electronics
Electronics
Electronics
Electronics

Arduino

Peb siv Arduino Mega 2560 Board. Peb kuj tseem siv Adafruit Motor Boards kom lawv tuaj yeem khiav cov cav ntoo stepper. Peb ntxiv cov pins rau cov adafruit kom lawv txuas mus rau ib leeg. Lawv tau muab lawv tso rau saum ib leeg. Txhua tus tuaj yeem khiav 2 lub cav. Tsis tas li, thov nco ntsoov tias lub jumper xav tau txuas nrog.

Cov Khoom Siv Hluav Taws Xob

Bestek ATX Fais fab siv siv lub adapter kom lub hwj chim muab rau. Tus adapter yog los ntawm sparkfun.com thiab muab ntau yam hluav taws xob.

Coils rau hauv Motors

Peb tau tsim cov qauv ua haujlwm kom tuav lub cav, rub lub kauj, thiab coj cov kauj raws lub txee. Peb tau ua tiav peb cov coils los ntawm ebay thiab txiav lawv mus rau qhov ntev. Peb kuj yuav tsum tau khoov 3 ntawm lawv txij li peb tsis tau txais 6 nrog qhov xaus ncaj los txuas rau lub kauj txuas. Peb tom qab ntawd 3D luam tawm lawv thiab txuas lawv mus rau kauj thiab lub cev muaj zog. Stepper motors peb muaj, peb muab tso rau hauv ib lub roob. Nws yuav tuav lub cav thiab coj cov kauj raws txoj kev ncaj.

LCD thiab Keypad

Peb siv Arduino Keypad thiab LCD npo txuas rau hauv 5V cov hlau lead ntawm cov khoom siv hluav taws xob rau lub zog thiab tom qab ntawd mus rau tib lub Arduino Board

Thaiv

Peb pom zoo siv 18 gauge xov hlau. Hauv peb qhov xwm txheej, peb yuav tsum tau txiav txim siab los ntawm kev siv ntau qhov ntsuas vim tias peb khiav tawm ntawm 18 qhov ntsuas

LED Sawb

Peb siv cov hlua LED los teeb lub tshuab. Peb txuas nws mus rau 12V cov hlau lead ntawm lub zog hloov khoom siv. Cov hlua LED uas peb siv ua tsaug tau muaj + thiab - ntawm nws uas ua rau cov txheej txheem txuas nws yooj yim dua.

Kauj Ruam 4: Tus Neeg Txais Nyiaj

Bill Txais
Bill Txais
Bill Txais
Bill Txais
Bill Txais
Bill Txais
Bill Txais
Bill Txais

Peb siv Coinco BA30B raws li peb tus nqi lees txais. Nws yuav tsum tau txuas ncaj qha rau ntawm phab ntsa ua lub zog siv. Peb ua ke nws nrog 24-pin adapter los ntawm atx fais fab mov los ntsaws rau hauv thiab tso cai txuas yooj yim dua. Cov pinouts peb ua raws yog pom hauv qhov txuas hauv qab no:

techvalleyprojects.blogspot.com/2011/07/ard…

Hauv peb qhov xwm txheej, peb yuav tsum tsim tsa kom nce tus neeg txais daim nqi vim tias tsis li ntawd nws yuav qis dua rau peb lub casing.

Kauj ruam 5: Xeem

Kuaj cov khoom siv hluav taws xob sab nraum lub thawv ua ntej kom ntseeg tau tias cov khoom ua haujlwm. Txhua yam teeb meem uas tshwm sim yuav tsum tau kho ua ntej tso rau hauv lub casing.

Kauj Ruam 6: Cov Khoom Siv Hluav Taws Xob rau Casing

Thaum koj tau sim cov khoom siv hluav taws xob thiab txaus siab rau lawv cov txiaj ntsig, pib tso lawv rau hauv koj lub casing. Kho cov xaim ntev kom lawv haum zoo sab hauv.

Kauj Ruam 7: Xeem Kawg

Thaum muab tso rau hauv lub casing, sim txhua yam ntxiv. Yog tias txhua yam ua haujlwm raws li koj xav tau, nrog koj zoo siab! Koj tau ua lub tshuab muag khoom.

Kauj ruam 8: Arduino Code + Txuas

Rub tawm:

Arduino Txoj Cai

drive.google.com/drive/folders/1oC4MhOcMFy…

SolidWorks Folder nrog ib feem ntawm cov ntaub ntawv thiab sib dhos

drive.google.com/drive/folders/1amZoypiWcZ…

Tsuas yog qee yam tau tshwm sim rau qhov txuas, ntawm no yog tus lej arduino tso tawm kom pom. Arduino Txoj Cai <<

#include #include #include "Arduino.h" #include #include #include "utility/Adafruit_MS_PWMServoDriver.h" #suav nrog

const int stepsPerRevolution = 200; const byte ROWS = 4; // plaub kab const byte COLS = 3; // peb kab ntawv char keys [ROWS] [COLS] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}, {'*', '0', '#'}}; byte rowPins [ROWS] = {5, 6, 7, 8}; // txuas mus rau kab pinouts ntawm cov keyboard byte colPins [COLS] = {2, 3, 4}; // txuas mus rau kab ntawv pinouts ntawm cov keyboard Keypad keypad = Keypad (uaKeymap (cov yawm sij), rowPins, colPins, ROWS, COLS); Adafruit_MotorShield AFMS1 = Adafruit_MotorShield (); Adafruit_StepperMotor *myMotor1 = AFMS1.getStepper (-200, 1); Adafruit_StepperMotor *myMotor2 = AFMS1.getStepper (-200, 2); Adafruit_MotorShield AFMS2 = Adafruit_MotorShield (0x61); Adafruit_StepperMotor *myMotor3 = AFMS2.getStepper (-200, 1); Adafruit_StepperMotor *myMotor4 = AFMS2.getStepper (-200, 2); Adafruit_MotorShield AFMS3 = Adafruit_MotorShield (0x62); Adafruit_StepperMotor *myMotor5 = AFMS3.getStepper (-200, 1); Adafruit_StepperMotor *myMotor6 = AFMS3.getStepper (-200, 2); Adafruit_MotorShield AFMS4 = Adafruit_MotorShield (0x63); Adafruit_StepperMotor *myMotor7 = AFMS4.getStepper (-200, 1); Adafruit_StepperMotor *myMotor8 = AFMS4.getStepper (-200, 2); LiquidCrystal lcd (1, 11, 9, 10, 12, 13); // Digital Pins lub lcd txuas nrog // Constants // // tus pin rau daim nqi validator tus credit (-) kab const int billValidator = 22;

// Variables /

/ kaw lub sijhawm ntawm mem tes (milliseconds) tsis tau kos npe ntev;

// tuav tag nrho cov nyiaj sau tseg int dollarCounter = 0; teeb tsa tsis muaj dab tsi () {lcd.begin (16, 1); // teeb tsa cov ntawv lcd tswj lcd.print ("Ntxig $ 1 Tsuas"); // Teeb cov ntawv Serial.begin (9600); // Initialize serial ports rau kev sib txuas lus. Serial.println ("Stepper test!"); // Ntaus Tawm Stepper Test hauv kab ntawv saib kom peb paub tias lub tshuab tsav twg yog nias. AFMS1.begin (); AFMS2.begin (); AFMS3.begin (); AFMS4.begin (); myMotor1-> setSpeed (100); // Teeb Tsav Ceev uas lawv yuav khiav myMotor2-> setSpeed (100); myMotor3-> setSpeed (100); myMotor4-> setSpeed (100); myMotor5-> setSpeed (100); myMotor6-> setSpeed (100); myMotor7-> setSpeed (100); myMotor8-> setSpeed (100); // Tus pin teeb tsa rau tus nqi lees paub thiab khawm pinMode (billValidator, INPUT); // Teeb tsa tus lej lej

// Initialize serial ports rau kev sib txuas lus. Serial.begin (9600); Serial.println ("Tos duas las …"); } void loop () {{ntev = pulseIn (billValidator, HIGH); // Pib nrhiav lub plawv dhia ntev tau txais los ntawm daim ntawv lees txais yog (lub sijhawm> 12000) // Tus nqi uas nws yuav tsum tau hla kom thiaj li siv tau raws li tus txheej txheem thiab cov nyiaj tau los tiag tiag {// Suav duas DollarCounter ++; // Txheeb xyuas kom nkag siab Serial.print ("Dollar tau pom. / N Tag nrho:"); // Zaub tshiab suav suav Serial.println (dollarCounter); // loop txhawm rau tos kom txog thaum lub pob nyem thaum (ntev> 12000) {char key = keypad.getKey (); // tau txais keyoad txuas nrog thiab pib pom qhov twg raug nias yog (qhov tseem ceeb! = NO_KEY) {// yuav nrhiav qhov tseem ceeb nias Serial.println (qhov tseem ceeb); // qhia rau peb paub qhov twg raug nias hauv qhov saib xyuas txuas ntxiv {{yog (qhov tseem ceeb == '1') {// Yog tias Key 1 raug nias, ua raws li hauv qab no: int keyPressed = key - '1'; myMotor8-> kauj ruam (580, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor8-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai}

yog (qhov tseem ceeb == '2') {// Yog tias Key 2 raug nias, ua cov hauv qab no: int keyPressed = key - '2'; myMotor7-> kauj ruam (400, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor7-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '3') {// Yog tias qhov tseem ceeb 3 raug nias, ua cov hauv qab no: int keyPressed = key - '3'; myMotor6-> kauj ruam (400, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor6-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '4') {// Yog tias Key 4 raug nias, ua cov hauv qab no: int keyPressed = key - '4'; myMotor5-> kauj ruam (180, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor5-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '5') {// Yog tias Key 5 raug nias, ua cov hauv qab no: int keyPressed = key - '5'; myMotor4-> kauj ruam (6900, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor4-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '6') {// Yog tias Key 6 raug nias, ua cov hauv qab no: int keyPressed = key - '6'; myMotor3-> kauj ruam (400, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor3-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '7') {// Yog tias qhov tseem ceeb 7 raug nias, ua cov hauv qab no: int keyPressed = key - '7'; myMotor7-> kauj ruam (400, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor7-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai} yog (qhov tseem ceeb == '8') {// Yog tias tus yuam sij 8 raug nias, ua cov hauv qab no: int keyPressed = key - '8'; myMotor8-> kauj ruam (400, FORWARD, DOUBLE); // Pib Lub Cev Muaj Zog thiab tig rau 350 degrees hauv qhov kev qhia ua ntej. myMotor8-> tso tawm (); // Tshaj tawm lub cev muaj zog los ntawm lub xeev tuav nws tus kheej hauv qhov chaw. rov qab; // Rov qab mus rau qhov pib ntawm lub voj txoj cai}}}}}} >>

Pom zoo: