MICROCONTROLLER BASED WEIGHING MACHINE

Similar documents
AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Chapter 13. PIC Family Microcontroller

Microtronics technologies Mobile:

2.0 Command and Data Handling Subsystem

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

8051 MICROCONTROLLER COURSE

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

An Introduction to MPLAB Integrated Development Environment

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

Analog-to-Digital Converters

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

ET-BASE AVR ATmega64/128

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

Fondamenti su strumenti di sviluppo per microcontrollori PIC

MX PIC24F Educational Module User Manual

RAM & ROM Based Digital Design. ECE 152A Winter 2012

EasyPIC4 User s Manual

Accurate Measurement of the Mains Electricity Frequency

Wireless Security Camera

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

Tutorial for MPLAB Starter Kit for PIC18F

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

Display Message on Notice Board using GSM

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

POCKET SCOPE 2. The idea 2. Design criteria 3

Chapter 1 Lesson 3 Hardware Elements in the Embedded Systems Chapter-1L03: "Embedded Systems - ", Raj Kamal, Publs.: McGraw-Hill Education

Hardware and Logic Implementation of Multiple Alarm System for GSM BTS Rooms

AN-812 APPLICATION NOTE

Central Processing Unit (CPU)

K8048 PIC PROGRAMMER BOARD

Serial port interface for microcontroller embedded into integrated power meter

Getting Started with PIC24F/PIC24H Programming and Interfacing in C

Final Design Report 19 April Project Name: utouch

MICROPROCESSOR AND MICROCOMPUTER BASICS

Handout 17. by Dr Sheikh Sharif Iqbal. Memory Unit and Read Only Memories

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

3. Identification of water pumps through RFID technology. 4. Wireless control of remote water pump using RF technology.

ONLINE HEALTH MONITORING SYSTEM USING ZIGBEE

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

c0003 A Simple PIC Application CHAPTER 3

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

FEATURES DESCRIPTION. PT6321 Fluorescent Display Tube Controller Driver

Open Architecture Design for GPS Applications Yves Théroux, BAE Systems Canada

Lecture N -1- PHYS Microcontrollers

CAN bus board. EB018

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

Android based Alcohol detection system using Bluetooth technology

Conversion Between Analog and Digital Signals

Smart Thermostat page 1

Tire pressure monitoring

Part Number Description Packages available

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

DESIGN OF SMS ENABLED CAR SECURITY SYSTEM

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

A N. O N Output/Input-output connection

Chapter 2 Logic Gates and Introduction to Computer Architecture

Digital Electronics Detailed Outline

KEYWORDS: Cellphone, Braille language, Visually impaired people(vip), Microcontroller, Decoder, Latches, DC motors.

DATA LOGGER AND REMOTE MONITORING SYSTEM FOR MULTIPLE PARAMETER MEASUREMENT APPLICATIONS. G.S. Nhivekar, R.R.Mudholker

GUI BASED REMOTE ON/OFF CONTROL AND MONITORING SINGLE PHASE LAMP USING MICROCONTROLLER

Hello and welcome to this training module for the STM32L4 Liquid Crystal Display (LCD) controller. This controller can be used in a wide range of

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

ALARM SYSTEM USING BODY DETECTOR UMMI KALSOM BINTI NOOR DIN

RDF1. RF Receiver Decoder. Features. Applications. Description. Ordering Information. Part Number Description Packages available

HD44780U (LCD-II) (Dot Matrix Liquid Crystal Display Controller/Driver)

PART B QUESTIONS AND ANSWERS UNIT I

Designing VM2 Application Boards

Test Driven Development of Embedded Systems Using Existing Software Test Infrastructure

Microcontroller-based experiments for a control systems course in electrical engineering technology

Measuring Resistance Using Digital I/O

The Central Processing Unit:

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

Microprocessor & Assembly Language

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Microcontrollers Figure 26-1 Objectives Key Words and Terms 26.1 OVERVIEW OF THE MICROCONTROLLER microcontroller

Controlling a Dot Matrix LED Display with a Microcontroller

Microprocessor or Microcontroller?

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

Design of an Insulin Pump. Purpose of an Insulin Pump:

Monitoring of Intravenous Drip Rate

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Embedded Patient Monitoring System

Peak Power Tracker Circuit Description (from

Memory Basics. SRAM/DRAM Basics

Byte code Interpreter for 8051 Microcontroller

Design And Implementation Of Bank Locker Security System Based On Fingerprint Sensing Circuit And RFID Reader

Lab Experiment 1: The LPC 2148 Education Board

Remote PLC system using GSM network with application to home security system

Serial Communications

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

The Programming Interface

THE TRANSITION FROM THE 8085 TO THE MODERN WORLD

Cell Phone Based Liquid Inventory Management Using Wireless System

Programming Logic controllers

Microcontrollers A Brief History of Microprocessors

Transcription:

MICROCONTROLLER BASED WEIGHING MACHINE Kimani Peter Ng ang a F17/28901/2009 222 May 2014 A progress report of the final year project towards partial fulfillment of the requirements for the degree of Bachelor of Science in Electrical and Electronic Engineering of the University of Nairobi. Supervisor: Prof. E. Mwangi. Examiner: Mr. S. A. Ahmed. Abstract This paper presents the design of an efficient, accurate and inexpensive microcontroller based weighing scale which can be used in all weight measuring operations. A digital weighing scale widely uses a load cell (resistive strain gauge) to measure weight. It converts pressure into appropriate voltage levels. This voltage level is filtered and converted into digital data in the microcontroller which is then displayed on a 16*2 LCD. The prime goal of this project is to provide high precision, low cost and user friendly functionalities. Introduction- Now a day precise measurement and storage of weight is one of the most important activities in industries. The mechanical weighing machines are now replaced by the electronics weighing machine as electronic weighing machines are smart with the advantages like accuracy, reliability, and wide range. The Electronics weighing bridges are comparatively light weight and easy to operate with direct display. Earlier electronic weighing machine were designed using DPM, Microprocessor and Personal computer. The disadvantage of DPM type weigh machine has no facility to store data internally. Microprocessor and Personal computer based system cost is very high. To remove this drawback microcontroller based weigh machine is designed. This project presents the software and hardware design, results and conclusion. 1

2.THEORETICAL BACKGROUNG: A microcontroller is a type of microprocessor furnished in a single integrated circuit and needing minimum support chips. Its principle nature is maximum efficiency at minimum cost. A microcontroller is an intelligent core for a specialized dedicated system. It is a complete computer system with input-output lines, timers, Read-Only Memory (ROM), Read-Write Memory (RAM) and some peripherals such as counters and timers, analog to digital converters, comparators and serial ports. The PIC microcontroller is mostly build on the Harvard architecture and has characteristics which include RISC processor design, single word instructions, machine and data memory configuration and characteristic instruction formats. The Reduced Instruction Set Computer (RISC) has 35 instructions and each instruction performs more elementary operations. Consequences of this are a smaller silion area, faster execution and reduced program size with fewer accesses to main memory. In the Harvard architecture the data and instructions use different path and storage areas. This type of machine can read and write instructions to and from memory at the same time and results in a faster machine. Since the device has separate buses for instructions and data it is possible for instructions to be sized differently than data items. Being able to vary the number of bits in each instruction op-code makes possible the optimization of program memory and the use of single-word instructions that can be fetched in one bus cycle. The PIC architecture has a two-stage instruction pipeline, since the fetch and current instruction and execution of the previous one can overlap in time, one complete instruction is fetched and executed at every machine cycle (pipelining). The PIC clocking system is designed so that an instruction is fetched, decoded, and executed every four clock cycles where the clock is either internal or external. In this manner a PIC equipped with a 4MHz oscillator clock beats at a rate of 0.25 micro seconds. Since each instruction executes at every four clock cycles, each instruction takes 1 us when the pre-scalar is not used. In the PIC16F690 microchip controller there 18 general purpose I/O pins are available where one pin is only input that is the master clear pin, 3 ports which include port A which is 6 pins wide, port B which is 4 pins wide and port C which is 8 pins wide making the device have 18 pins and 2 pins for powering the device. This microcontroller has three types of memory- ROM, RAM and EEPROM.ROM memory is used to permanently save program being executed that is why it is often referred to as program memory. Since ROM is made of FLASH technology, its contents can be changed by providing special programming voltage. Similar to program memory, the contents of EEPROM are permanently saved even after the power going off. The third memory is the RAM which consists of two parts: the general purpose registers (GPR) and the special function registers (SFR). Peripheral devices in the pic16f690 microchip controller include the timer which is used as timers or counters. The asynchronous receiver transmitter contains all the clock generators, shift 2

registers and data buffers necessary to perform an input or output serial data transfer independent of device program execution. 3. DESIGN-The design of the microcontroller weigh scale was based on the PIC16F690 as the heart of the system. The design was divided into two main parts; hardware and software design. 3.1 Hardware design-lcd to PIC Interface; LCD requires 8 pins for the 8 bit mode of sending data for 8-bit configuration mode of the LCD. PORTC of PIC16F690 is 8 bit wide and was found convenient for the data lines of the LCD. That is, RC0-7 PIC pins where connected to D0-7 data lines of LCD as shown on figure 2-1.Enable pin (E) of the LCD was connected to RA1 (pin 18) of the microcontroller. Register select (RS) pin of the LCD was connected to RB5 (pin 12) of microcontroller. Since the objective was to write data to the LCD read/write line was grounded; because at no point is data being read from the LCD. This helped free up an extra pin. VDD 1 2 3 4 5 6 7 8 9 10 11 12 13 14 VSS VDD VEE RS RW E D0 D1 D2 D3 D4 D5 D6 D7 10K to PIN 13 to PIN 12 to PORTC Figure 3-1 LCD to PIC interface The 10KΩ resistor connected between V SS and V DD to ground is used to vary the contrast of the LCD brightness. An optimal value is achieved depending on one wish. It varies the voltage from V DD value ground. To achieve a visual sign when operating in the safe limits (0-100gms) a green LED was used. This was connected between VDD and RA5 (pin 3) through a urrent limiting resistor of 330 ohms whose justification is is given in equation 2.1 below. (5.3 1.8) = 25 = 140 3.1 To make sure the value of current sourced is far below the maximum allowed current (25 ma) a 330 ohms resistor was chosen. 3

3.2 Software design- Software design was divided into the following divisions: a) ADC program. b) LCD program. c) LED subprogram. d) Main program to coordinate the others. Below is the flow chat developed to guide in the development of the needed program. START INITIALIZATION CHECK WEIGHT LIMIT DISPLAY ON LCD YES IS THE LIMIT NO EXCEEDED? SWITCH OFF LED YES the program. Figure Error! No text of specified style in document.-1 flow chart for The initialization involved pin configuration. The ADC subprogram and LCD subprograms were also written in assembly code language in mplab. 4

4. EXPERIMENTAL RESULTS AND ANALYSIS- Table 4.1 below shows simulated results when the design was run on proteus. It shows the variation of the displayed value of the weight as the voltage is varied from 0 to 5 volts as well as the resistance drops consequently. The table also shows the status of the LED as the weight is varied. Table 4.1- Table of simulated results. VOLTAGE % RESISTANCE KΩ VOLTAGE V DISPLAYED VALUE in gm 0 10 0 0.0 ON 1 9.9 0.05 9.775 ON 2 9.8 0.1 19.55 ON 3 9.7 0.15 28.348 ON 4 9.6 0.2 37.145 ON 5 9.5 0.25 45.943 ON 6 9.4 0.3 53.763 ON 7 9.3 0.35 61.583 ON 8 9.2 0.4 69.404 ON 9 9.1 0.45 77.224 ON 10 9.0 0.5 85.044 ON 11 8.9 0.55 91.886 ON 12 8.8 0.6 98.729 ON 13 8.7 0.65 105.571 OFF 14 8.6 0.7 112.414 OFF 15 8.5 0.75 119.256 OFF LED STATUS When the voltage to the microcontroller input was at zero, the displayed value was also at zero while the visual alarm was ON to show that the weight was within the specified limit. Behold 100 gm the visual alarm goes off indicating that the weight level is behold the specified minimum limit. 4.1 System Evaluation. Number of main ICs. In terms of the number of components, the developed PIC16F690 Microcontroller Based Electronic Weighing Balance (MCBEWB) uses the least. The microcontroller chip has adequate in-built Flash Memory, EEPROM, RAM and I/O ports. Any microprocessor based electronic weighing balance would require an external 5

RAM, an external EPROM and an I/O device among other support chips. This renders the latter extremely expensive. Portability. From the portability perspective, the developed system has unlimited range as all that is needed is a single external power supply. It has been designed to make it as compact as possible. The Butchery Electronic Weighing Balance (BEWB) is bulky and therefore has limited portability. Space. In terms of space, the developed system required least space for both the digital circuitry and the analog circuitry. This is attributed to the fact that minimal number of chips was used and to crown it all, the system was implemented on PCB boards. Owing to the many external chips used, in BEWBs and SRLEWBs, a lot of space is required for circuit implementation. Flexibility. The developed system is considered the most flexible, as in-system reprogramming is possible. This is courtesy of the built-in Serial Programmable Interface (SPI) of the PIC16F690 microcontroller. Program can be written or erased up to 1000 times. Some BEWBs and SRLEWBs use dedicated chips like those in DMMs. They only perform specific tasks and cannot be changed or modified to do otherwise. For those that are microprocessor based, in-system reprogramming is not possible. Microprocessor based related Control/Data Acquisition Applications use external EPROM for program storage. To change the program, it is erased by exposing it to UV, a tedious process indeed. Range and Resolution. The developed electronic weighing balance has tried to address both resolution and range. It is the best in as far as striking a balance between range and resolution goes. This is a modest system with a reasonable range while at the same time being sensitive enough. This is quite rare in virtually all-electronic weighing systems. Display Capability. In as far as display capability is concerned; the developed system enjoys the widest capability. Using the ASCII code, it can display all alphanumeric data/information. It can display special characters. BEWBs and SRLEWBs can only display numeric data/information. Information in letters or symbols is usually engraved alongside the LCD display. Conclusion-The project design objectives of the weight monitoring system were successfully achieved. The system displaying unit LCD was able to monitor the variations in weight. This 6

weigh scale is of great importance for the industries involved in weight taking and also in the retail market. REFERENCES: 1. PIC16F631/677/685/687/689/690 Data sheet 20-pin Flash-Based, 8-bit CMOS Microcontrollers with Nano Watt Technology.[Performance]. Microchip Technology Inc., 2006. 2. J.S.a.M.p. Canton, Microcontroller Programming The Microchip PIC, Taylor & Francis Group, 2007. 3. T.D. Green Embedded Systems Programming with the PIC16F690, Second Edition ed., 2008. 4. M. Bates, Interfacing PIC Microcontrollers Embedded Design by Interactive Simulation, Martin Bates: Elsevier, 2006. 5. D. Ibrahim, PIC BASIC Projects 30 Projects Using PIC BASIC and PIC BASIC PRO, Great Britain: MPG Books Ltd, 2006. 7