Monday, 21 December 2015

Conclusion and Recommendation

Conclusion :
Development of Smart Laundry System is a simple modification of the existing weighing method. It gives benefits to the user in terms of weighing and payment. It provides an attractive and user friendly interface through visual basic application.

However, this project has several weakness :
1.accuracy for the weighing
2.prototype design

For further development I would suggest to improve in terms of accuracy and prototype design. This project can go further and it has a potential to be sold to the launderette. 

Result

Simulation Design :

Hardware :

Visual Basic Application :
For items in pieces

For items in Kg

Payment receipt

Payment receipt print preview

Database for the customers records



Project Costing

The total cost for this project is about RM 374.50

Software Development

For this project, I used :
a)      MikroC PRO for PIC
  • Used to write the source code of the program. It is written in c language
b)      Proteus 8 Professional
  • Used to draw schematic for the project's simulation. ARES in Proteus is used to draw the PCB layout of the project
c)      Visual Basic 2010
  • Used to develop the user interface for the user. In this project, staffs of the laundry shop are the users for the interface
d)     SQlite Browser
  • Act as the database platform. For this project, there are two important data that need to be stored in the database :
               1. Item Details (such as price, types of washing)
               2. Customer's record



Overall Scope of the Project

These are the scope of the project. It involves two main parts ; hardware and software development. In short, below are the overall component of Development of Smart Laundry System.
Hardware
a)      Load cell sensor 
b)      PIC16F88 Microcontroller
c)      INA125P amplifier
d)     HC11 wireless serial port module
e)      USB to UART converter
Software
a)      MikroC PRO for PIC
b)      Proteus 8 Professional
c)      Visual Basic 2010
d)     SQlite Browser





Tuesday, 8 December 2015

UART

A UART (Universal Asynchronous Receiver/Transmitter) is the microchip with programming that controls a computer's interface to its attached serial devices. Specifically, it provides the computer with the RS-232C Data Terminal Equipment ( DTE ) interface so that it can "talk" to and exchange data with modems and other serial devices.
  • As part of this interface, the UART also:
  • Converts the bytes it receives from the computer along parallel circuits into a singleserial bit stream for outbound transmission
  • On inbound transmission, converts the serial bit stream into the bytes that the computer handles
  • Adds a parity bit (if it's been selected) on outbound transmissions and checks the parity of incoming bytes (if selected) and discards the parity bit
  • Adds start and stop delineators on outbound and strips them from inbound transmissions
  • Handles interrupt s from the keyboard and mouse (which are serial devices with specialport s)
  • May handle other kinds of interrupt and device management that require coordinating the computer's speed of operation with device speeds
More advanced UARTs provide some amount of buffering of data so that the computer and serial devices data streams remain coordinated. The most recent UART, the 16550, has a 16-byte buffer that can get filled before the computer's processor needs to handle the data. The original UART was the 8250. If you purchase an internal modem today, it probably includes a 16550 UART (although you should ask when you buy it). According to modem manufacturer US Robotics, external modems do not include a UART. If you have an older computer, you may want to add an internal 16550 to get the most out of your external modem.

http://whatis.techtarget.com/definition/UART-Universal-Asynchronous-Receiver-Transmitter

USB to UART Converter


USB to UART converter V2011 (UC00B)
Serial communication is most popular interface between device and this applies to microcontroller and computer. UART is one of those serial interfaces. Classically, most serial interface from microcontroller to computer is done through serial port (DB9). However, since computer serial port used RS232 protocol and microcontroller used TTL UART, a level shifter is needed between these interfaces. Recently, serial port of computer have been phase out, it have been replaced with USB. Of course most developer chooses USB to serial converter to obtain virtual serial port. The level shifter is still necessary for UART interface. Thus, Cytron decided to develop a USB to UART converter which offers USB plug and play, direct interface with microcontroller and it provide low current 5V supply from USB port.
This product offers low cost USB to UART converter to user.  Make you easy to connect a microcontroller project to a PC. Compare to UC00A which is USB 2.0 speed, this product use a low cost USB 1.1 speed of chip and the driver can support Windows Operating System only, no driver for LINUX or Mac. However, it is more than enough in most of the projects. It has been designed with capabilities and features of:
USB Specification v1.1
Tested with the baud rate up to 115200 bps.
Low cost USB to UART converter
Easy to use, aiming development between computer and microcontroller, 3.3V or 5V logic.
USB powered, no external source is required to use this converter
Configurable for 3.3V/5V UART interface.
Easy to use 6 pin interface: TXD, RXD, GND, DTR, RTS and VCC (5V or 3.3V).

Sunday, 18 October 2015

Strain Gauge

A load cell is made by using an elastic member (with very highly repeatable deflection pattern) to which a number of strain gauges are attached. There are a total of four strain gauges that are bonded to the upper and lower surfaces of the load cell. When force is applied, strain gauges at the top of the sensor will stretch whereas strain gauges at the bottom part will compressed.


Methodology

Below are the block diagram for the project :


Load Sensor
When clothes is placed on the weighing scale, load cell sensor will convert the load into an electronic signal. This signal is in analog voltage. Load sensor work on the principle of piezo-resistivity ; when a force is applied to the sensor, it changes its resistance. This change in resistance leads to a change in output voltage
Amplifier
Analog to digital converter (ADC) on the Microcontroller can read approximately 19mV per step based on the formula :
(𝟓 𝒗𝒐𝒍𝒕𝒔)/(𝟐𝟓𝟔 𝒔𝒕𝒆𝒑) = 19 mV per step
For the scale, total voltage different is less than 19mV when force is applied. Hence, we need to amplify the signal using INA125P amplifier
MCU System
Microcontrollers can only differentiate between HIGH or LOW level on input pins. Most of the modern MCUs have an Analog to Digital Converter (ADC). ADC will convert the analog voltage from the weighing scale to a digital value so that it can be processed by the Microcontroller. PIC16F88 is 8bit Microcontroller meaning it has the ability to detect 256 discrete analog levels. ADC ports on PIC16F88 are labelled with AN0 – AN6
Transmitter and Receiver
In order to transmit and receive data from the Microcontroller, we use HC11 wireless serial port module. It is a half-duplex data transmission meaning that only one end transmits at a time, the other end receives. Transmitter is connected to the MCU whereas receiver is connected to the USB to UART converter. After ADC in the MCU convert the signal from analog to digital, transmitter will transmit the data to the receiver
USB to UART Converter
Most serial interface from Microcontroller to laptop is done through USB. Level shifter is necessary for UART interface because it converts digital signals from one logic standard to another. For this project, UC00B is used as an USB to UART converter because it offers direct interface with microcontroller and it provides low current 5V supply from USB port
Laptop
A user interface is created using Visual Basic 2010 software. The interface provides the user with :
       I.            1.Weight and total price of the items
    II.           2. Item selections
 III.           3. Barcode on the receipt
 IV.           4. Customer’s database
This is the flow chart of the project (based on interface in Visual Basic Application)


Hardware Development

Below are the main components involved in this project :

PIC16F88
The PIC16F88 features 8 MHz internal oscillator, 256 bytes of EEPROM data memory, a capture/compare/PWM, an Addressable USART, a synchronous serial port that can be configured as either 3-wire Serial Peripheral Interface (SPI™) or the 2-wire Inter-Integrated Circuit (I²C™) bus, 7 channels of 10-bit Analog-to-Digital (A/D) converter and 2 Comparators that make it ideal for advantage analog / integrated level applications in automotive, industrial, appliances and consumer applications.




INA125P Amplifier
The INA125P is a low power, high accuracy instrumentation amplifier with a precision voltage reference. It provides complete bridge excitation and precision differential-input amplification on a single integrated circuit. A single external resistor sets any gain from 4 to 10,000. The INA125 is laser-trimmed for low offset voltage (250mV), low offset drift (2mV/°C), and high
common-mode rejection (100dB at G = 100). It operates on single (+2.7V to +36V) or dual (±1.35V to±18V) supplies. The voltage reference is externally adjustable with pin selectable voltages of 2.5V, 5V, or 10V, allowing use with a variety of transducers. The reference voltage is accurate to ±0.5% (max) with ±35ppm/°C drift (max).Sleep mode allows shutdown and duty cycle operation to save power.

Load cell Sensor
A load cell is a sensor or a transducer that converts a load or force acting on it into an electronic signal. This electronic signal can be a voltage change, current change or frequency change depending on the type of load cell and circuitry used.
The most common use of this sensor is in weighing machine. Load cells are used in several types of measuring instruments such as weighing scales, universal testing machines. Every weighing machine which shows weight has a load cell as a sensing element. 
Load cell in the weighing scale is a resistive load cell. Resistive load cells work on the principle of piezo-resistivity. When a load/force/stress is applied to the sensor, it changes its resistance. This change in resistance leads to a change in output voltage when a input voltage is applied.
HC11 serial port wireless module
HC11 wireless communication frequency band is multiple types of serial port transparent transmission modes have respective features, and the mode is changed by command.
User do not need to program the modules, and four modes are only responsible for receiving and sending serial port data, and are convenient to use.
HC11 wireless module is low current consumption; the idle current is 80μA, 3.5mA or 22mA, depending on the selected mode. The number of bytes sent to serial port of module unlimited to one time.
For this project, it is used to transmit the data beetween MCU and computer.
USB to UART Converter
Serial communication is most popular interface between device and this applies to microcontroller and computer. UART is one of those serial interfaces. Classically, most serial interface from microcontroller to computer is done through serial port (DB9). However, since computer serial port used RS232 protocol and microcontroller used TTL UART, a level shifter is needed between these interfaces. Recently, serial port of computer have been phase out, it have been replaced with USB. Of course most developer chooses USB to serial converter to obtain virtual serial port. The level shifter is still necessary for UART interface.
USB to UART converter offers USB plug and play, direct interface with microcontroller and it provide low current 5V supply from USB port. This product offers low cost USB to UART converter to user. It is easier to connect a microcontroller project to a PC.
It has been designed with capabilities and features of :
USB Specification v1.1
            Tested with the baud rate up to 115200 bps.
Low cost USB to UART converter
Easy to use, aiming development between computer and microcontroller, 3.3V or 5V logic.
USB powered, no external source is required to use this converter
Configurable for 3.3V/5V UART interface
            Easy to use 6 pin interface: TXD, RXD, GND, DTR, RTS and VCC (5V or 3.3V)


Modification of the project

At first I decided to use 8051 microcontroller but finally I decided to use PIC16F88 due to several reasons. PICs are faster, more reliable ( high noise immunity) and code-efficient than 8051s.There are more source of coding for PIC16F88 available through various types of websites. Hence, it will be more easier for me to learn about PIC16F88 compared to 8051 microcontroller.

For the time being, my major sources are from this website http://www.mikroe.com/chapters/view/2/chapter-1-pic16f887-microcontroller-device-overview/ and the online book link as stated http://www.mikroe.com/products/view/285/book-pic-microcontrollers-programming-in-c/

For the second part , I decided to modify the available digital weighing scale instead of developing the new weighing scale using load cell sensor and load cell sensor platform. This can help me to reduce the project cost. Furthermore , I found one youtube video related to my project idea. In this video, they modify the digital weighing scale hence it is able to interface with microcontroller. They also explain the most important part in weighing scale known as the strain gauge concept.
Here is the youtube link for the video : https://www.youtube.com/watch?v=fPzUtzFJFus

I keep watching this video in order to understand what I'm doing for this project. These two sources help me a lot. Everything is new for me but I'm trying the best to understand and generate the ideas for what I'm doing for.

This is the list of component that I've finally decided to use :
  • PIC16F88 microcontroller
  • INA125P amplifier
  • HC-11 wireless module

Monday, 18 May 2015

8051 MCU

8051 employs Harvard architecture. It has some peripherals such as 32 bit digital I/O, Timers and Serial I/O. The basic architecture of 8051 is given below:

Basic 8051 Architecture
Various features of 8051 microcontroller are given as follows :
  • 8-bit CPU
  • 16-bit Program Counter
  • 8-bit Processor Status Word (PSW)
  • 8-bit Stack Pointer
  • Internal RAM of 128bytes
  • Special Function Registers (SFRs) of 128 bytes
  • 32 I/O pins arranged as four 8-bit ports (P0 - P3)
  • Two 16-bit timer/counters : T0 and T1
  • Two external and three internal vectored interrupts
  • One full duplex serial I/O
Pinouts
Pins 1-8: Port 1 Each of these pins can be configured as an input or an output.
Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning.
Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions:
Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output.
Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output.
Pin 12: INT0 Interrupt 0 input.
Pin 13: INT1 Interrupt 1 input.
Pin 14: T0 Counter 0 clock input.
Pin 15: T1 Counter 1 clock input.
Pin 16: WR Write to external (additional) RAM.
Pin 17: RD Read from external RAM.
Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz.
Pin 20: GND Ground.
Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs.
Pin 29: PSEN If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory.
Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission.
Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists).
Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0).
Pin 40: VCC +5V power supply.

HC-11 Wireless Module

HC-11 wireless module
The HC-11 433MHz Wireless Serial Port Module is based on the TI C1101 ultra low-power wireless transceiver IC. As well as the C1101 wireless transceiver, the module also includes a microcontroller with preprogramed firmware (no programming required by the user) that provides seamless connection via a TTL serial UART interface. Using this interface the module can operate in one of 3 modes:

Command mode (Pin 5 pulled low)
Allows for text based serial 'AT' commands to be sent to the module, or remote module(s) allowing for various configuration options to be set such as Local/Remote Channel, address, baud rate, etc.

Serial pass-through mode (Pin 5 high)
Any serial data sent to the module will be transmitted to any receiving module on the same channel and address and will be present on its Tx pin. Conversely Any serial data sent to a remote modules serial interface Rx pin will be received by the local module.

IO Mode
By issuing an appropriate AT command whilst the module is in command mode, the module can be reconfigured from wireless serial pass-through mode to a wireless digital IO module. In this mode the Rx, Tx, and Con pins are reconfigured as digital IO pins. Whilst in this mode the same pins any module configured as a slave can be controlled by the state of the state of these pins. This allows for remote device to be digitally controlled without the use of a microcontroller.

Pinout:

Features:
§  433.4-473.0MHz operation (depending on channel)
§  Ultra-low power consumption (3.5mA or 22mA depending on mode) with sleep option (80μA).
§  10dBm output power and high sensitivity providing long range in the open environment.
§  3V6V operating voltage.
§  Serial pass through mode to replace the serial cable (half duplex).
§  IO pass through modes.
§  3V interface with 5V tolerance.
§  You can set the frequency and set the address, and dozens of instructions, automatic filter
§  8.Small size (13.5 × 28.2mm).
§  255 selectable addresses
§  20 selectable channels

Default Settings:
§  Baud rate: 9600
§  Channel: 1
§  Module address: 0
§  Tx Power: 8 (10dBm)
§  HC-11 Pinouts

Load cell amplifier

Load cell amplifier
The board is total solution for analog front end for Load Cell applications.This board is highly integrated in the sense it contains Instrumentation Amplifier, Analog to Digital Converter and Digitizer which outputs serial data of 9600 baud rate for direct reading in kilograms.
The output can be used to connect to microcontroller for further display and processing or can be fed to PC serial port to view on terminal.The calibration functions in built in the board giving very accurate, stable and reliable output every time.
Specifications:
Name
Typ
Unit
Working Voltage
5
V DC Regulated
Output Reading Rate Every
100
Mili Seconds
Data Format
12
Byte ASCII
UART baud rate (8 bit data, no parity, 1 stop bit)
9600
bps

Board Pinouts for Interfacing
Pin
Pin Name
Details
RX-I
Receive Input
Input serial data of 5V logic level to perform forced calibration or auto zero, Usually connected to TXD pin of microcontrollers/PC/RS232.
TX-O
Transmit Output
Output serial data of 5V logic level, Usually connected to RXD pin of microcontrollers/PC/RS232.
+5V
Power Supply
Regulated 5V supply input.
GND
Ground
Ground level of power supply. Must be common ground with microcontroller.

Load cell sensor (Single Point Load cell)


Single Point Load cell
A load cell is a sensor or a transducer that converts a load or force acting on it into an electrical signal.  This electrical signal can be a voltage change, current change or frequency change depending on the type of load cell and circuitry used. The most common use of this sensor is in weighing machine. Load cells are used in several types of measuring instruments such as weighing scales, universal testing machines. Every weighing machine which shows weight has a load cell as a sensing element. 
The conversion is indirect and happens in two stages. Through a mechanical arrangement, the force being sensed deforms a strain gauge. The strain gauge measures the deformation (strain) as an electrical signal, because the strain changes the effective electrical resistance of the wire. A load cell usually consists of four strain gauges in a Wheatstone bridge configuration. Load cells of one strain gauge (quarter bridge) or two strain gauges (half bridge) are also available.
The electrical signal output is typically in the order of a few millivolts and requires amplification by an instrumentation amplifier before it can be used. The output of the transducer is plugged into an algorithm to calculate the force applied to the transducer.
  
Commonly available load cells include:
§  S-Beam Load Cell
§  Single Point Load Cells
§  Shear Beam Load Cells
§  Pancake Load Cells
§  Button Load Cells
§  Through hole Load cells and
§  Miniature and Sub-Miniature load cells

Wiring Identifier:
The wiring of load cell consist of four wires (Plus one cable shielding, optional). The wires are as below. The RED/BLACK are usually given DC excitation voltage. While the GREEN/WHITE are taken as sensing output.
 Specifications:
Parameter
Value
Type
Single Point Load Cell
Total Precision
C3 class
Material
Aluminium Alloy
Surface
Anodized Treatment
Protection
IP65
Suggested Platform Size
350 x 350 mm
Applications
Weighing Scales, Retail, Bench & Counting Scales
Rated Load
40 Kg. Max
Rated Output
2.0mV/V+/- 5%
Zero Balance
+/- 1% Full Scale
Input Resistance
405 +/- 6 Ohm
Output Resistance
350 +/- 3 Ohm
Excitation Voltage
5-12V DC
Nonlinearity
0.017% Full Scale
Hysteresis
0.02% Full Scale
Repeatability
0.01% Full Scale
Creep(30min)
0.015% Full Scale
Operating Temperature
-20 °C to +65 °C
Temperature Effect on Zero
0.017% Full Scale / 10 °C
Temperature Effect on Span
0.014% Full Scale / 10 °C
Insulation Resistance
5000 Mega Ohm(50V DC)
Safe Overload
150% Full Scale
Ultimate Overload
200% Full Scale
Cable
420mm(3mm, 4 wire shielding cable)