In this article, we are going to make our own control card for coffee vending machines. This machine is nowadays very common in shops and restaurants. Small businesses can be started with this machine. Here let’s make a simple functional control card for the coffee vending machine.

Disclaimer: Electricity is always dangerous. Proper skill is required to work with electricity. Do work at your own risk. The author will not be responsible for any misuse or harmful act or any mistake you make. The contents of this website are unique and copyright protected. Kindly don’t do any nonsensical act copying and claiming it as yours. Most of the articles published here are kept as open-source to help you. Take the knowledge for free and use it, but if you are interested you can buy the ready resources offered here. If you need any help or guide feel free to comment below, the author will try to help you. Thanks.

About coffee vending machine:

A coffee vending machine usually dispenses hot coffee. But getting tea and hot water is optional. Most of the vending machines have other features like milk, coffee-mate, etc. More elaborately sugar, flavor, etc. also can be added.

A common coffee vending machine

Some of these vending machines may have a keypad for password or RFID card scanning option. But in a very simple one, only a few basic options are kept.

These are:

  • Adding Coffee powder
  • Adding Tea powder
  • Adding Water
  • Adding Sugar
  • Mixing

Sometimes, sugar is premixed with tea/coffee. In this case, the mixture is called a premix. Here in South Asia, most of the coffee vending machines use the premixed powder for coffee & tea separately.

In this article, we are going to make the last type which uses premixed powders. In this case, we have only a few devices to control. We can say these devices like this:

Devices:

  • Premix1
  • Water1
  • Mixure1
  • Premix2
  • Water2
  • Mixure2

Mixure1&2 are motors to drive and the rest of the devices are valves. We can use simple relays to drive these loads.

Premix1, Water1, Mixure1 these are making coffee, and Premix2, Water2, and Mixure2 are making tea. Besides, to get hot water only, Water1 & Water2 work simultaneously.

Now, we can draw our circuit diagram.

You may find this article helpful: PICKit2 colon Simplified

Circuit Diagram our our coffee vending machine:

coffee vending machine circuit diagram
Simulative circuit diagram

Relays are presented by LEDs to simplify the circuit diagram so that you can understand it clearly. I’ve designed this circuit in PCB. You can watch this video to understand as well as practice making one for yourself.

The video language is Bengali. If you do not understand kindly read the subtitles.

Programming & Simulation:

Here in this project, I used mikroC pro for PIC as the compiler and proteus 8.9 as the simulator.

/*******************************************************************************
Program for, Coffee Vending Machine
Program Written by_ Engr. Mithun K. Das
MCU:PIC16F877A; X-tal:20MHz; Compiler: mikroC pro for PIC v7.6.0
Date: 24-12-2020
*******************************************************************************/

// LCD module connections
sbit LCD_RS at RB5_bit;
sbit LCD_EN at RB4_bit;
sbit LCD_D4 at RB3_bit;
sbit LCD_D5 at RB2_bit;
sbit LCD_D6 at RB1_bit;
sbit LCD_D7 at RB0_bit;

sbit LCD_RS_Direction at TRISB5_bit;
sbit LCD_EN_Direction at TRISB4_bit;
sbit LCD_D4_Direction at TRISB3_bit;
sbit LCD_D5_Direction at TRISB2_bit;
sbit LCD_D6_Direction at TRISB1_bit;
sbit LCD_D7_Direction at TRISB0_bit;
// End LCD module connections

void Lcd_COut(char row, char col, const char *cptr)
{
  char chr = 0;             //first, it is used as empty string
  Lcd_Out(row, col, &chr);  //nothing to write but set position.
  for ( ; chr = *cptr ; ++cptr ) Lcd_Chr_CP(chr); //out in loop
}


//define buttons here
#define    TEA          RA0_bit
#define    COFFEE       RA1_bit
#define    HALF         RA2_bit
#define    HOT_WATER    RA3_bit

//define outputs here
#define    Buzzer       RD3_bit
#define    Relay1       RC4_bit
#define    Relay2       RD2_bit
#define    Relay3       RC5_bit
#define    Relay4       RC6_bit
#define    Relay5       RC7_bit
#define    Relay6       RD4_bit



int rl1_counter;// 50 = 5 sec    //premix1
int rl2_counter;                 //water1
int rl3_counter;                 //wiper1
bit tea_activation;

int rl4_counter;// 50 = 5 sec    //premix2
int rl5_counter;                 //water2
int rl6_counter;                 //wiper2

bit coffee_activation;
bit hot_water_activation;
bit edit_mode;
int division=1;

int edit_mode_entry_counter=0;
short edit_page=0;


#include "subfunctions.h"

I’ve described the complete code with simulation side by side. Please watch these videos to understand the code. Please watch these videos to understand the code.

Or you can get the complete code from here.

PCB Design:

I’ve designed a PCB for this project. Here is the PCB:

You can use this PCB design to make your own PCB or alternatively, you can buy my design from here.

Conclusion:

In the end, we can say that if anyone reads this article with concentration, watch the videos carefully it is not a difficult job to make his/her own control card.

I hope this project was helpful to you. If you make one for yourself, it will be a great pleasure for me. Anywhere you need help, let me know. Please share this project and subscribe to my blog. Thank you.

For more useful articles, don’t forget to subscribe.

Loading

JLCPCB – Only $2 for PCB Prototype (Any Color)

24 Hours fast turnaround, Excellent quality & Unbeatable prices

$18 Welcome Bonus for new registrations Now!!! https://jlcpcb.com


Check this out: 5 coolest multimeters you can buy


Lab Projects BD

This is a personal electronics blog. The author loves to write on different topics and shares his knowledge to help others.

4 Comments

Joy · February 24, 2021 at 5:12 pm

Nice….Go ahead.. Thank you.

Ajape · March 3, 2021 at 11:12 am

Good day engr Mithun. Thanks for this new development. How I wish I could understand Indian language, as I am from Nigeria, but I don’t really grab your explanation, and the code in the video is not clearly seen and I really want to learning it and do it. I have practice many of your projects on your blogs, based PIC controller. Please. If you could send me the source code and the schematic diagram of this COFFEE VENDING MACHINE CONTROL CIRCUIT. my Gmail address is: rafiuajape4@gmail.com
Secondly sir. There is one project you had posted in your previous blogs: DIGITAL MULTIMETER” I have been searching for it but I couldn’t find it again. Please I need your help if you could send them to me, I would be very grateful sir. Thanks.

Ayush Dubey · October 5, 2021 at 2:13 am

Sir can you please send me the source code and the schematic diagram of this COFFEE VENDING MACHINE CONTROL CIRCUIT. My Gmail id is adgec2530@gmail.com
I want to complete my major project.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *