0% found this document useful (0 votes)
51 views6 pages

Is Used. LM7805 IC Provides +5 Volts Regulated Power Supply With Provisions To Add A Heat Sink Whose Input Voltage Range 7V-35V

The document describes a circuit board that uses three voltage levels: 3.3v, 5v, and 12v. A voltage regulator circuit converts the 12v input to 5v and 3.3v for different components. A NodeMCU microcontroller interfaces with a barcode scanner and bill validator using UART and an LCD display using I2C. The circuit and code are described to accept money input, validate funds, and dispense a product if valid.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views6 pages

Is Used. LM7805 IC Provides +5 Volts Regulated Power Supply With Provisions To Add A Heat Sink Whose Input Voltage Range 7V-35V

The document describes a circuit board that uses three voltage levels: 3.3v, 5v, and 12v. A voltage regulator circuit converts the 12v input to 5v and 3.3v for different components. A NodeMCU microcontroller interfaces with a barcode scanner and bill validator using UART and an LCD display using I2C. The circuit and code are described to accept money input, validate funds, and dispense a product if valid.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

R1= 1KΩ;

R2 = 1KΩ;

R3=2.2KΩ;

C1=0.1µF;

There are three voltage levels in the PCB circuit 3.3v, 5v and 12v. For 12v DC we’re using
HLK-PM 12, datasheet is attached whose input voltage range is 90-264 Volt AC and output
voltage is 12v DC after then for getting output voltage 5v DC, LM7805 is used. LM7805 IC
provides +5 volts regulated power supply with provisions to add a heat sink whose Input voltage
range 7V- 35V. For 3.3v dc, voltage divider circuit is used and converts it to a lower one by
using a pair of resistors R2 and R3. These voltages are for the functioning of different modules in
the PCB which operates at different voltage level.

Barcode Scan engine and bill validator, both are communicating with NODEMCU on UART.
The UART (Universal asynchronous receiver/transmitter) module allows configuration of and
communication over the UART serial port. Rest of pins of different components are connected
with I/O pins of NODEMCU. Interfaced LCD with NodeMCU using I2C. Connecting LCD to
I2C and then interfacing it to NodeMCU is very simple.

The LCD’s registers from D0 to D7 and Vcc, GND, RS, R/W pins will be connected to I2C.

GND pin of I2C is connected Ground pin (GND) of the NodeMCU.

VCC pin of I2C is connected Vin pin of the NodeMCU. (Because we need to supply 5v to LCD)

SDA pin of I2C is connected D4 of the NodeMCU.

SCL pin of I2C is connected D3 pin of the NodeMCU.


Circuit Connection:

Coding:

// include the library code:

#include <LiquidCrystal_I2C.h>

#include <Wire.h>

LiquidCrystal_I2C lcd(0x27,16,2);

// initialize the library by associating any needed LCD interface pin


// with the arduino pin number it is connected to

//const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

//Assigning bill validator pins

const int bv_in=6;

const int bv_op=7;

int state=0;

//Assigining dispensing machine pins

const int disp_in=d0;

const int validity=d1;

int validity_state=0;

int input;

//Assigining position sensor pin

const int Position=d2;

//LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {

// set up the LCD's number of columns and rows:

Serial.begin(9600);

lcd.begin(16, 2);

Wire.begin(D4,D3);

pinMode(bv_in, INPUT);

pinMode(disp_in, INPUT);

pinMode(Position,OUTPUT);

pinMode(bv_op, OUTPUT);

pinMode(validity, OUTPUT);

// Print a message to the LCD.

//lcd.print("Hello World!");

start();

}
void loop() {

// set the cursor to column 0, line 1

// (note: line 1 is the second row, since counting begins with 0):

lcd.clear();

lcd.print("Insert Money");

a();//Insert money into “Bill Validator”

delay(3000);

void start()

lcd.print(" Welcome");

delay(2000);

lcd.clear();

//lcd.setCursor(0, 1);

lcd.print(" Bill Validator");

lcd.blink();

delay(2000);

void a()

state = digitalRead(bv_in);

if(state==0)

lcd.clear();

lcd.print("No Money");

lcd.setCursor(0,1);

lcd.print("Inserted");
delay(2000);

if(state==1)

lcd.clear();

lcd.print("Money Inserted");

delay(2000);

validity_state = digitalRead(validity);

if(validity_state==1)

lcd.clear();

lcd.print("Record transaction to machine");

winner:

digitalWrite(disp_in, 0x1000000);// If valid currency, send credit pulse to “Ticket Validator

digitalWrite(disp_in, 0x0010000);//

if(Serial.available())

input = Serial.read();

Serial.print("Scanned Code: " );

Serial.println(input);

digitalWrite(disp_in, 0x1111000);

digitalWrite(disp_in, 0x0010000);

digitalWrite(Position,HIGH);

delay(3000);

goto winner;

else
{

digitalWrite(disp_in, 0x1111101); //Reject (Eject bill if not valid currency)

lcd.clear();

lcd.print("Money is not valid");

if(validity_state==0)

lcd.clear();

lcd.print("Record transaction declined");

You might also like