Tuesday, 10 December 2013

Week 8 of FYP 1

Date: 06/11/2013 (Wednesday)
Title: Research and Findings (PIC 16F877A)

ANALYSIS

Moving up the Microchip PIC16F Microcontroller family, we have the PIC16F877A. This is a very common MCU and it’s always mentioned in DIY projects. It’s popular among students, hobbyist and even engineers because it’s cheap. It is cheaper than its little brother which is the PIC16F84A. Another reason is the sheer amount of input and output pins available on this MCU. Among other things, this MCU also has Analog to Digital conversion capability without the need of an external chip.

PIC (Peripheral Interface Controller) is the IC which was developed to control peripheral devices, alleviating the load from the main CPU (Control Processing Unit). Compared to a human being, PIC is equivalent to the autonomic nervous system. The PIC, like the CPU, has calculation functions and memory, and is controlled by the software. However, the throughput and the memory capacity are low. Depending on the kind of PIC, the maximum clock operating frequency is about 20 MHz and the memory capacity to write the program is about 1000 to 4000 words. The clock frequency determines the speed at which a program is read and an instruction is executed. The throughput cannot be judged with the clock frequency alone. It changes with the processor architecture. However within the same architecture, the one with the highest clock frequency has the highest throughput.


The PIC is convenient for making calculations. The memory, the input or output ports and so on are incorporated into the IC (Integrated Circuit). The efficiency and the functions are limited, but the PIC can do the job of many IC's with software. Therefore, the circuit can be compact. Among all the PIC MCU families, the popular PIC16F877A was chosen because of its variety of hardware modules needed for most applications.


PIC 16F877A

Device Programmers


Devices called "programmers" are traditionally used to get program code into the target PIC. Most PICs that Microchip currently sells feature ICSP (In Circuit Serial Programming) and/or LVP (Low Voltage Programming) capabilities, allowing the PIC to be programmed while it is sitting in the target circuit. ICSP programming is performed using two pins, clock and data, while a high voltage (12V) is present on the Vpp/MCLR pin. Low voltage programming dispenses with the high voltage, but reserves exclusive use of an I/O pin and can therefore be disabled to recover the pin for other uses (once disabled it can only be re-enabled using high voltage programming).

There are many programmers for PIC microcontrollers, ranging from the extremely simple designs which rely on ICSP to allow direct download of code from a host computer, to intelligent programmers that can verify the device at several supply voltages. Many of these complex programmers use a pre-programmed PIC themselves to send the programming commands to the PIC that is to be programmed. The intelligent type of programmer is needed to program earlier PIC models (mostly EPROM type) which do not support in-circuit programming.

Many of the higher ends flash based PICs can also self-program (write to their own program memory). Demo boards are available with a small boot loader factory programmed that can be used to load user programs over an interface such as RS-232 or USB, thus obviating the need for a programmer device. Alternatively there is boot loader firmware available that the user can load onto the PIC using ICSP. The advantages of a boot loader over ICSP is the far superior programming speeds, immediate program execution following programming, and the ability to both debug and program using the same cable.

Programmers/debuggers are available directly from Microchip. Third party programmers range from plans to build your own, to self-assembly kits and fully tested ready-to-go units. Some are simple designs which require a PC to do the low-level programming signalling (these typically connect to the serial or parallel port and consist of a few simple components), while others have the programming logic built into them (these typically use a serial or USB connection, are usually faster, and are often built using PICs themselves for control).


PIC Programmer (Program Burner)

Crystal Oscillator (20MHz)



PIC 16F877A has an on-chip RC oscillator but it is used for ADC operation. But the external oscillators (usually 4 - 20MHz) are required for operating the PIC.

Monday, 9 December 2013

Week 9 of FYP 1

Date: 11/11/2013 – 14/11/2013 (Monday to Thursday)
Title: Research and Findings (Relay)


Introduction


A relay is an electrically operated switch. Current flowing through the coil of the relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil current can be on or off so relays have two switch positions and most have double throw (changeover) switch contacts.

Relays allow one circuit to switch a second circuit which can be completely separate from the first. For example a low voltage battery circuit can use a relay to switch a 230V AC mains circuit. There is no electrical connection inside the relay between the two circuits; the link is magnetic and mechanical.

The coil of a relay passes a relatively large current, typically 30mA for a 12V relay, but it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the small IC current to the larger value required for the relay coil. The maximum output current for the popular 555 timer IC is 200mA so these devices can supply relay coils directly without amplification.

Relays are usually SPDT or DPDT but they can have many more sets of switch contacts, for example relays with 4 sets of changeover contacts are readily available. Most relays are designed for PCB mounting but we can solder wires directly to the pins providing us to avoid melting the plastic case of the relay.

The supplier's catalogue should show you the relay's connections. The coil will be obvious and it may be connected either way round. Relay coils produce brief high voltage 'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To prevent damage we must connect a protection diode across the relay coil.


The relay's switch connections are usually labelled COM, NC and NO:

COM = Common, always connect to this; it is the moving part of the switch.

NC = Normally Closed, COM is connected to this when the relay coil is off.


NO = Normally Open, COM is connected to this when the relay coil is on.

Relay Circuit

Selection of the Relays

There are several features that need to be considered when choosing a relay:

Physical size and pin arrangement

- If we are choosing a relay for an existing PCB we will need to ensure that its dimensions and pin arrangement are suitable. We should find this information in the supplier's catalogue.

Coil voltage

- The relay's coil voltage rating and resistance must suit the circuit powering the relay coil. Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily available. Some relays operate perfectly well with a supply voltage which is a little lower than their rated value.

Coil resistance

- The circuit must be able to supply the current required by the relay coil. We can use Ohm's law to calculate the current:

Relay coil current  = supply voltage/coil resistance

For example: A 12V supply relay with a coil resistance of 400ohm passes a current of 30mA. This is OK for a 555 timer IC (maximum output current 200mA), but it is too much for most ICs and they will require a transistor to amplify the current.

Switch ratings (voltage and current)

- The relay's switch contacts must be suitable for the circuit they are to control. You will need to check the voltage and current ratings. Note that the voltage rating is usually higher for AC, for example: "5A at 24V DC or 125V AC".

Protection diodes for relays

Protection diode for a relay Transistors and ICs must be protected from the brief high voltage produced when a relay coil is switched off. The diagram shows how a signal diode (ex. 1N4148) is connected 'backwards' across the relay coil to provide this protection.

Current flowing through a relay coil creates a magnetic field which collapses suddenly when the current is switched off. The sudden collapse of the magnetic field induces a brief high voltage across the relay coil which is very likely to damage transistors and ICs. The protection diode allows the induced voltage to drive a brief current through the coil (and diode) so the magnetic field dies away quickly rather than instantly. This prevents the induced voltage becoming high enough to cause damage to transistors and ICs.

Protection Diode For Relay

Sunday, 8 December 2013

Week 10 of FYP 1

Date: 22/11/2013 (Friday)
Title: Presentation Day

- 2.15pm (setup table, setup laptop)

- All students of FYP 1 must register at 2.30pm

- Start 3.00pm – 5.00pm

- 2.30pm (Access Begin)

- Accessed by Sir Mohd Zubir B Suboh and Siti Afifah Bt Mohshim



Presentation Requirements:
  • 19 Slide (Minimum 8 Slide)
  • Present 10-15 minutes
  • Check with the supervisor first before presentation day



Contents:

  •  Introduction
  • Problem Statements
  •  Aim & Objectives
  • Scope & Limitation
  • Literature Review
  • Methodology
  • Expected Outcome
  • Progress work (30% Not necessary)

·          
Comments & Recommendations by Assessors:

- The presentation was running smoothly but there were some comments and recommendations given by the assessors.

- Sir Zubir had given his recommendation of how to expend and wider the implementation of my project such as at Gas Tank storage facilities, in the kitchen, and so on.


- Madam Afifah also gave her recommendation of using LPG Sensor rather than Methane MQ-4 Gas Sensor so that it is easier to demonstrate during Engineers Day as acquiring Methane Gas is rather difficult. 

Saturday, 7 December 2013

Week 11 of FYP 1

Date: 29/11/2013 (Friday)
Title: Detailed Research on Methane Gas


Methane Characteristics

Methane is an odourless gas and is lighter than air. Because methane is lighter than air, it tends to rise and accumulate near the higher, stagnant parts of enclosed buildings and tightly closed manure storage pits. It is most likely to accumulate during hot, humid weather.

Methane is extremely difficult to detect without gas detection instruments. Concentrations in confinement livestock housing are normally well below the levels that may be explosive; however, explosions attributed to methane have occurred around manure storage pits without proper vents.

Methane can displace oxygen in confined areas, resulting in an oxygen-deficient atmosphere. Methane can explode at concentrations of 50,000 ppm or more (a level of 5 per cent).


Health Effects

The Occupational Safety and Health Administration (OSHA) has no permissible exposure limit for methane, but the National Institute for Occupational Safety and Health's (NIOSH) maximum recommended safe methane concentration for workers during an 8-hour period is 1,000 ppm (0.1 percent). Methane is considered an asphyxiant at extremely high concentrations and can displace oxygen in the blood.




Methane exposure levels and effects



How are people exposed to Methane?


Breathing: Most exposures occur when people inhale methane. Methane can go into homes through sewer traps or foundation cracks. People can be exposed by inhaling the chemical at work, cooking on a gas stove, or entering confined spaces such as manholes, silos, animal waste pits, septic tanks and sewers.

Drinking/Eating: Because methane evaporates quickly, it is usually not found in food or drinking water. Very low level exposure can occur when contaminated water is used for drinking and/or for food preparation or when children eat contaminated soil.

Touching: Methane gas does not pass readily through intact skin. Methane in its extremely cold liquefied form can, however, cause burns to the skin and eyes.



Will exposure to Methane result in harmful health effects?


Immediately or shortly after exposure to oxygen levels of less than 15% in air, a person may feel tired, dizzy, and have a headache.




The following health effects can occur after several years of exposure to methane:

Cancer: Methane is not suspected of causing cancer.

Reproductive Effects: The reproductive and developmental effects of methane are not known.

Organ Systems: No long term health effects are currently associated with exposure to methane.

In general, chemicals affect the same organ systems in all people who are exposed. However, the seriousness of the effects may vary from person to person.

A person's reaction depends on several things, including individual health, heredity, previous exposure to chemicals including medicines, and personal habits such as smoking or drinking.

It is also important to consider the length of exposure to the chemical; the amount of chemical exposure; and whether the chemical was inhaled, touched, or eaten.


Can a medical test determine exposure to Methane?


Methane is rapidly eliminated from the body. Although methane can be measured in exhaled breath, urine, blood, and other tissues, no reliable method exists to determine the level of exposure. There are currently no tests available to evaluate the health effects of methane exposure.

Friday, 6 December 2013

Week 12 of FYP 1

Date: 06/12/2013 (Friday)
Title: Redraw a block diagram


- Make more research from the previous block diagram to add a safety feature of releasing the leaked gas to the atmosphere. 




Thursday, 5 December 2013

Week 13 of FYP 1

Date: 09/12/2013 (Monday)
Title: Research and Findings (Solenoid)


The Function of Solenoid


A locking solenoid is a conventional solenoid, a wire coil that is magnetized when paired with an electrical current, that is made to lock a door or device. The locking solenoid is small enough to fit into a lock, where it keeps the locking mechanism from moving unless an electromagnetic force is used to gain access. When the door is locked, no power is used, so the solenoid has a long duty cycle and tends to run off batteries. While most lock solenoids are very small, there are some large ones made for heavy-duty equipment and safety devices. The most common places a locking solenoid is used are in doors, vending machines and turnstiles.

When a door or device locks via a locking solenoid, it is using basic electromagnetic forces to control the lock. The solenoid fits in the locking mechanism and, when locked, will expand so the device cannot unlock by sheer force. An electromagnetic force is needed to tell the solenoid to move, thus allowing the device to unlock and open.

While the locking solenoid will keep the device locked, it is not technically on when in locking mode, because no power is being used. The solenoid only needs power when unlocking and, because most devices are consistently locked, very little energy is ever required by the solenoid. For this reason, most solenoids run on battery power, and the battery rarely needs to be changed.


The majority of locking solenoids are made to be small, because they fit in small devices, but there are some that are large and exhibit powerful electromagnetic forces. Heavy-duty solenoids are used in construction equipment such as forklifts to lock the mast when the machine is off or not operating. Unlike smaller solenoids that exhibit the force of about 45 Newtons, these larger solenoids use about 1,000 Newtons to lock the equipment in place.


Solenoid


Current Applications


The most common devices that use a locking solenoid are usually small, around the size of a human adult or less, and do not need much locking force. Hotels, offices and other secure areas use these solenoids to lock doors, because picking a solenoid lock is very difficult. Instead of the easily broken padlocks long used on vending machines, solenoid locks are modern alternatives. Turnstiles at parks, subways and entertainment events use solenoids to stop people unless they are authorized to pass through.




How Do Push & Pull Action Solenoids Work?


Solenoids are made up of a coil of wire and a plunger or actuator. The coil of wire is wound many times around a plastic spool. The copper wire is lightly coated with a varnish to electrically insulate the wire from conducting power to each strand, since the wires are lay next to each other and touching. This allows the coil of wire to have a long length for creating a magnetic field.

 The generation of the magnetic field is dependent upon the way the coil is wound. The magnetic field can either be a push or pull type of field. Since the coil is wound around the plastic spool, the plunger or actuator fits inside of the spool. Attached to the plunger is a mechanical lever that can increase the movement of the "in" or "out" action of the electric solenoid.

As other linear solenoids push/pull solenoids are on/off type actuators and develop force in one direction when energised. The return force must be provided externally, e.g. by a return spring.


"Push-Pull" solenoids are the most robust series of linear solenoids and are therefore the best option for heavy duty applications. They offer a very high holding force at a comparably low power input. This makes them ideally suited for applications asking for low power consumption or low heat dissipation.

Operation of Solenoid

Wednesday, 4 December 2013

Week 14 of FYP 1

Week 14
Date: 16/12/2013 (Monday)
Title: Schematic Diagrams

Schematic for Bluetooth Communication



Schematic For LM 1117T




Schematic for PIC Connections


Schematic for Relay Circuit