Friday 24 February 2012

TDMA technology

Figure 14: The GSM system uses TDMA to split a frequency into time slots.

Time division multiple access (TDMA) is the access method GSM uses for shared networks. GSM uses TDMA to raise the efficiency of the network. GSM uses TDMA to raise the efficiency of the network.Using TDMA, a narrow band that is 30 kHz wide and 6.7 milliseconds long is split time-wise into three time slots. Narrow band means channels in the traditional sense. Each conversation gets the radio for one-third of the time. This is possible because voice data that has been converted to digital information is compressed so that it takes up significantly less transmission space. Therefore, TDMA has three times the capacity of an analog system using the same number of channels.

Thursday 23 February 2012

What is GSM?

GSM stand for Global System for Mobile communications. Originally, the acronym GSM stood for Groupe Spécial Mobile, a group formed by the Conference of European Posts and Telegraphs (CEPT) in 1982 to research the merits of a European standard for mobile telecommunications. In Europe and many other parts of the world, GSM is the only type of cellular service available. Commercial service using the GSM system did not actually start until 1991. The technology behind the GSM uses Gaussian Minimum Shift Keying (GMSK) modulation a variant of Phase Shift Keying (PSK) with Time Division Multiple Access (TDMA) signalling over Frequency Division Duplex (FDD) carriers. (How GSM works?)

GSM systems provide a number of useful features:
  • Uses encryption to make phone calls more secure 
  • Data networking 
  • Group III facsimile services 
  • Short Message Service (SMS) for text messages and paging 
  • Call forwarding 
  • Caller ID 
  • Call waiting 
  • Multi-party conferencing

    Thursday 16 February 2012

    Input & Output Circuit

    In the previous post, the basic circuit is complete but still can't see any result yet. This is because there is no input and output attached to the I/O pins to show any result. Below is the basic input and output circuit for this project:


    Input Circuit
     Figure 7: Input Circuit

    The push button input is a very simple and direct input. It has being put in the circuit replacing the input from J6 connector (signal status from the 1st RCCB) for simulating in the Proteus Software for output generating. As in the circuit above, push button is being pulled up by R4 (10KOhm Resistor) to Vcc. So, when the push button is being released, the voltage will be Vcc (5V, since it is being pulled up to Vcc), and when push button is being pressed, the voltage will be 0V. This type of input is called active low input, where the output voltage is 0V or Logic 0 when it is active (button pressed). Sometime, there is a circuit that will put a resistor before the digital input port. The function of the resistor is to protect the digital input port at the microcontroller, just in case that the digital input port is being configured as an output, and the resistor will limit the current from the port.


    Output Circuit

    There are 3 output circuit for this project:

    1) LED
    Figure 8: Basic Output Circuit

    When OUTPUT 2 receive logic condition from the microcontroller, R10 (330kohm) will limit the current to the D3 LED. The D3 LED will on.


    2) LCD
    Figure 9: LCD Pins Diagram
    
    The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters. Most LCDs with 1 controller has 14 pins. Pin description is shown in the table below:

    Figure 10: Character LCD Pins with 1 Controller

    Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever user sends on the DDRAM is actually displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so whatever user write after 16 chars is written in DDRAM but is not visible to the user.
    Figure 11: DDRAM Address for 2 Line LCD

    2.1) LCD Circuit
    Figure 12: LCD Circuit Connection
    

    Above is the connection diagram of LCD in 4-bit mode, only 7 pins needed to interface with an LCD. D4 - D7 are the data pins connection and Enable and Register select are for LCD control pins. The Read/Write (RW) pin of the LCD will not be using, as the data only writing on the LCD. So, it has to be grounded permanently. If user wants to use it, then they may connect it on controller but that will only increase another pin and does not make any big difference. The unwanted data pins of LCD i.e. Vss, VEE and D0-D3 are connected to ground.
    There are many reasons why use LCD in 4-bit mode instead of 8-bit. One basic reason is lesser number of pins are needed to interface LCD.

    More about LCD

    3) Relay Switching
    Figure 13: Relay Switching Circuit
    

    For the above circuit, when the base of the transistor receive any supply from the microcontroller, it will allow the 5V to the ground without active the relay. Otherwise, the relay will active and create a back e.m.f that will turn the switching from the normally open to normally close (which is turn on the Backup RCCB).

    Thursday 9 February 2012

    Basic Circuit for PIC16F877A

    There's no point in knowing the PIC16F877A without know how to start up it. There are 7 pin should be connect correctly. 

    Power Supply Pin

    Table 1: Power Supply Pin


    In every single electronic component, the supply pin is the most important thing. Same goes to PIC16F877A. The ideal voltage for this microcontroller is 5V (DC). The current that supply to this microcontroller should not be higher that 5.5V and below then 2V. This is because, the higher current will burn the microcontroller and the microcontroller will not operate if the current is below than it required current. Usually, the supply come from either battery or dc adapter and it's hard to fine normal battery or dc adapter in 5V. This problem can be solve by using LM7805 (Datasheet) voltage regulator which will step down the larger input voltage to 5V. Below is the voltage regulating circuit to regulate a voltage from 7V-20V to a stable 5V by using LM7805:

    Figure 3: Basic connection to step down to 5V

    The circuit begins with J2 which is a 2 pins connector to connect to battery or ac adapter. Pin 1 is negative and pin 2 is positive. The first capacitor C1, cleans up the signal if any (ac) noise is present on this. It shorts this noise to ground and allows the pure DC signal into the regulator. The regulator regulates this voltage down to 5 volts. After it comes out of the regulator, the other capacitor C2, cleans up any high-frequency or ac noise that may come out, again to produce a clean DC signal. Now this DC voltage, clean and crisp, is ready to power the load. D1 is a 5V LED as power on/off indicator and R1 is a resistor to limit the current through the LED.

    Reset Pin

    As being mention before, there are 7 pins to connect in order to operate the microcontroller. 4 pins already connected, so there are 3 more pins left. The other important pin is the reset pin (MCLR-Master Clear Reset at Pin 1). If the PIC read 0V at the MCLR pin, it will reset the program and if the MCLR pin read 5V, the PIC will execute the program. The MCLR can be directly connect with 5V (series with resistor like picture below) but it will unable to reset if something goes wrong with the system.

    Figure 4: 5V direct current connection to MCLR pin

    To solve this problem, a switch and a pull up resistor can be added in between 5V and the reset pin so it can create logic condition which is 1 and 0 to reset the pin.

    Figure 5: Reset connection with switch and pull up resistor

    Table 2: Logic Condition for MCLR pin

    When the switch is not pushed, current will flow trough 10K resistor and MCLR Pin. As a result, MCLR Pin receive 5V and PIC read it as logic 1. But when switch is push, current will flow through 10K resistor, switch and directly to ground. There is no voltage will receive at MCLR Pin. This give 0 logic at MCLR Pin.

    Oscillator

    Five from seven of important pins already covered, now there are only 2 pin left which is pin number 13 and 14. Those pin was named as OSC1 and OSC2. It can been connect  to the crystal osillator from various frequency. Pulse generated from the oscillator will some time have the noise. To reduce the noise, two capacitors in piko farad value is needed. The value of capacitor is depend on the speed of oscillator that you use. Below is the way how to connect the the cristal oscillator and capacitor value table.

    Figure 6: Oscillator connection

    Table 3: Capacitor value refer to the oscillator type

    Thursday 2 February 2012

    PIC16F877A Microcontroller


    Figure 1: PIC16F877A 

    PIC16F778A is widely uses now and it is also famous among the beginner until all the professionals because of the FLASH Memory technology which can be write/erase within a tousand times of programming. Speed and code compression are the superiority of this risc microcontroller compared to other 8-bit microcontroller. PIC16F877A have 40 pin by 33 path of I/O. EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage of various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.). Low cost, low consumption, easy handling and flexibility make PIC16F877A applicable even in areas where microcontrollers had not previously been considered (example: timer functions, interface replacement in larger systems, coprocessor applications, etc.).In System Programmability of this chip (along with using only two pins in data transfer) makes possible the flexibility of a product, after assembling and testing have been completed. This capability can be used to create assembly-line production, to store calibration data available only after final testing, or it can be used to improve programs on finished products.


    Figure 2: PIC16F877A Bubble Diagram


    Special Microcontroller Features:

    • 100,000 erase/write cycle Enhanced Flash program memory typical
    • 1,000,000 erase/write cycle Data EEPROM memory typical
    • Data EEPROM Retention > 40 years
    • Self-reprogrammable under software control
    • In-Circuit Serial Programming™ (ICSP™) via two pins
    • Single-supply 5V In-Circuit Serial Programming
    • Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
    • Programmable code protection
    • Power saving Sleep mode
    • Selectable oscillator options
    • In-Circuit Debug (ICD) via two pins

    Peripheral Features:

    • Timer0: 8-bit timer/counter with 8-bit prescaler
    • Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via external crystal/clock
    • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
    • Two Capture, Compare, PWM modules
    • Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)
    • Universal Synchronous Asynchronous Receiver
    • Transmitter (USART/SCI) with 9-bit address detection
    • Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls (40/44-pin only)
    • Brown-out detection circuitry for Brown-out Reset (BOR)

    High-Performance RISC CPU:

    • Only 35 single-word instructions to learn
    • All single-cycle instructions except for program branches, which are two-cycle
    • Operating speed: DC – 20 MHz clock input DC – 200 ns instruction cycle
    • Up to 8K x 14 words of Flash Program Memory, Up to 368 x 8 bytes of Data Memory (RAM), Up to 256 x 8 bytes of EEPROM Data Memory
    • Pinout compatible to other 28-pin or 40/44-pin PIC16CXXX and PIC16FXXX microcontrollers

    Analog Features:

    • 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
    • Brown-out Reset (BOR)
    • Analog Comparator module (Two analog comparators, Programmable on-chip voltage reference (VREF) module, Programmable input multiplexing from device inputs and internal voltage reference, Comparator outputs are externally accessible)

    CMOS Technology:

    • Low-power, high-speed Flash/EEPROM technology
    • Fully static design
    • Wide operating voltage range (2.0V to 5.5V)
    • Commercial and Industrial temperature ranges
    • Low-power consumption