LPC 21xx Microcotroller Programming Starting

When getting started in embedded programming, GPIO (viz. General Purpose Input Output) pins are one of the first things played with. Its also quite evident that the most popular embedded systems Program is Blinking LED i.e a LED connected to pin on the Microcontroller that keeps blinking. The use of GPIO is not limited to driving LEDS but can be also used for reading digital signal , generating triggers for external components , controlling external devices and what not. In this tutorial we see how to use and program GPIO Pins for lpc214x ARM 7 microcontrollers from NXP/Philips.

In this tutorial we also learn to make a project in keil MDK with a blinking LED.

First of all make download Keil MDK from keil official Site ,install it and open it .

Go to the project menu and and make new project from their choose micro-controller from NXP family to LPC214x. and add Startup file to project. create new file name as extension of type .c. add file to the source project.

include hedder file as #include “lpc21xx.h” to the code.

First we start with GPIO (General purpose INPUT and OUTPUT) Pins. the LPC21xx controllers have two ports with 32 pins each as it is mirco-controller with 32 bit resistor.

there are four resister PIN , DIR , SET, CLR for each pin of 2 ports.

DIR - this resistor is used to set direction of pins.

Example of using this resistor is IO0DIR |= (1<<6); it will set pin 6 of port 0 as output.

void Direction_Set(unsigned int Port_No,unsigned int Pin_No,char Direction)
{
switch(Port_No)
{
case 0:
if(Direction)
{
IO0DIR |= (1<<Pin_No);
}
else
{
IO0DIR &= ~(1<<Pin_No);
}
break;
case 1:
if(Direction)
{
IO1DIR |= (1<<Pin_No);
}
else
{
IO1DIR &= ~(1<<Pin_No);
}
break;
}
}

SET  - this resistor is used to set pin/port of microcontroller. example of this resistor is IO1SET |= (1<<10); this will set Pin 10 of port 1.

void Set_Pin(unsigned int Port_No,unsigned int Pin_No)
{
if(Port_No)
{
IO1SET |= (1<<Pin_No);
}
else
{
IO0SET |= (1<<Pin_No);
}
}

Here is the function provided for Set pins of microcontroller.

 

CLR -  This resistor is used to clear Port/Pin of micro-controller. example of this resistor is as IO1CLR |= (1<<10);  .

void Clear_Pin(unsigned int Port_No,unsigned int Pin_No)
{
if(Port_No)
{
IO1CLR |= (1<<Pin_No);
}
else
{
IO0CLR |= (1<<Pin_No);
}
}

PIN - this resistor is used to take input from pins/port.
int Read_Pin(unsigned int Port_No,unsigned int Pin_No)
{
if(Port_No)
{
return (IO1PIN&(1<<Pin_No));
}
else
{
return (IO0PIN&(1<<Pin_No));
}
}

——————————————————————————————————————–

int Read_Port(unsigned int Port_No)
{
if(Port_No)
{
return (IO1PIN);
}
else
{
return (IO0PIN);
}
}

 

Automotic Wall Follower Robot

Background:

Today the autonomous robots by tracking some sort of guidance are very famous. One on this type is the line following robot, a similar is wall following robot where the robot follow some wall and move around the wall. Here in this section we will discuss all about the wall following robot and their simplest circuit.

Components required.

  • DC geared motor (2 sets)
  • wheels (2 sets)
  • caster wheel
  • IR LED (2 sets)
  • Phototransistor (2 sets)
  • Variable resistance, 100K-Ohm (2sets)
  • resistance, 330 Ohm (4 sets)
  • Power Transistor (4 sets)
  • PCB
  • Ribbon Wire
  • Robotic Base
  • Power source, 9V DC
  • Battery connector

Design and working:

As we have seen already in autonomous line follower robot that the transistor-transistor motor derive circuit have a central point across which the motor gets OFF and ON as per the logic we have incorporated therein. Here we will use the same circuit but the configuration is different from autonomous line follower. Here we use one circuit and tune up the variable resistance so that the motor turns ON when the light(IR) intensity increases on the face of Phototransistor. In other circuit we swap the configuration and alter the position of the phototransistor and the variable resistance in the voltage divider section so that the motor connected to this circuit tunes on when the light (IR) intensity increases above the certain level on the face of the phototransistor. As in shown in figure-1 the Motor-1 is turns ON when the IR light intensity increases on the phototransistor face and motor-2 turn ON when the IR light intensity decreased on the phototransistor face.

figure-1

figure-1

We use these two phenomenons to control our robot. But before this we have to transport the circuit parts as leveled in the figure-2 to form the wall sensing module.

figure-2

figure-2

Here the Sensor-Module (SM)-1 and SM2 are representing the sensor modules that will fixed up in the robot body parts as shown into the figure-3. When robot come closure to the wall the SM-2 senses the event and turns the motor-2 (which is away from the wall) OFF so that the robot goes away from the wall. when the robot goes far away from the wall then SM-1 comes into the picture and it senses the low IR light on the SM-1 which signifies the event of robot moves far away from the wall and in that condition the Moto-1 turned OFF by the intelligent circuit associated with this and then the Robot comes closure to the wall so by the both action the robot maintains a certain distance from the wall and these distance can be controlled by changing the variable resistance values. So that’s all about the wall follower, now it’s time to get up and build one for yourself :)

figure-3

figure-3

Autonomous Line Follower (Simplest IR Module Based)

graphics-click-here-688974Click here to get all components required to build this robot
Background:

Today world are very advance in the field of robotics. Still the term robotics it very advance but the hobbyist made it easy as to cope up with their lazy style of working. In this we talk the simplest circuit ever you encounter for the line follower robot.

Components Required:

  • DC geared motor (2 sets)
  • Wheels (2 sets)
  • caster wheel
  • PCB
  • Ribbon wire
  • IR LED (2 sets)
  • Phototransistor (2 sets)
  • 100K-Ohm Variable resistance (2 sets)
  • 330 ohm(3 sets)
  • Power transistor (4 sets)
  • Battery  9V DC
  • Battery connector
  • robotic base
  • Ribbon wire
    To get all the componentsgraphics-click-here-688974 Click here.

Design & Working:

inventix_r01

Figure-1

for the design the first part is the sensor module and for that we use the  infrared module, first we take an IR LED and get it glow via a 330 Ohm resistance on the 9 Volt grid as shown in figure-1 (Always keep in mind that the Positive lead having longer terminal of IR LED), then comes our sensor part for that we’ll use a Phototransistor that is a very good sensor having immunity to the visible range light and hence very good for indoor robotic event as if will not malfunction due to the environmental lights which is present in the case of LDR based circuits. As far as the Phototransistor is concern always keep in mind that the longer terminal is emitter and shorter terminal is collector so when it connected to the circuit as per the  design is looks like you connected oppositely as we normally see in case of LED that we always connect the small terminal to the ground. but remember the Phototransistor is not the LED so instead it looks like we are connecting in opposite way as LED but the connection is correct. then we connect the variable resistance from the collector and the positive bus of 9 Volt grid (Use of variable resistance instead of fixed resistance has its own advantage as we can always has a facility to tune and adjust our sensor as per the requirement by just varying the variable resistance). there after we connect he middle point of PT(Phototransistor ) and variable resistance to the base of another NPN Power transistor which having a 330 Ohm resistance on its collector terminal having its other terminal to the positive but of the 9Volt grid. then the final connection is made via the collector terminal of 1st Power transistor is being connected to the base of second stage power transistor  which having a motor to its collector terminal. Yeah!!! it’s a quite good question why we are using two transistor, is it possible to use a single transistor instead? the answer is yeah, but in that case the tuning of the variable resistance should be precise and any deviation in the environmental IR light required another tuning, So to increase the circuit performance we like to employed 2 instead of one. Moreover it can work Black Line follower and White line follower both we have to just swap the position of PT and variable resistance or can put the sensor inside and outside the track.
inventix_r01

Ohhhh….. The actual design has some more adventure then we see here in the circuit since we have to put the sensor module at the track level so make a sensor module by taking the circuit component out of main circuit as the shaded part shown in Figure-2 into the path sensor module and the terminal connected back to the circuit via a hard wire.
inventix_r02

Now here are few tips over the mechanical arrangement of the setup. for the optimal dynamics control of the Robot always keep your sensor module in the direction of the motion at the half of the distance between wheels  in front of the wheels axis. So here is we are finally now take your Robot and do some artwork on it….. :) :):):)
inventix_r03

रिमोट संचालित इलेक्ट्रिक बल्ब प्रोजेक्ट

graphics-click-here-688974इस आविष्कार को करने के लिए जरुरी उपकरण यहाँ से प्राप्त करें|

समस्या:
हम अक्सर ये पाते हैं कि, हम जब सोने जाते हैं तो आलस के कारण अपने रूम का बल्ब जलती हुई अवस्था में छोड़ देते हैं| हमारे बुजुर्ग लोगों को अक्सर घर के बल्ब और पंखे को संचालित करने में स्विचबोर्ड के दूर होने के कारण कठिनाई का सामना करते हैं|

सामाधान:
इस आविष्कार में हम एक ऐसा प्रणाली डिजाइन करेंगे जिसको हम घर के किसी भी इलेक्ट्रिकल मशीन जैसे| इलेक्ट्रिक-बल्ब, पंखे इत्यादी को इसके सहारे संचालित कर सकते हैं| यह किसी भी साधारण टीवी के रिमोट से संचालित कर सकेंगे  अथवा एक स्पेशल डिजाइन के रिमोट से इसको कंट्रोल कर सकते हैं|

जरूरी उपकरण:

  • छोटी ट्रांसफार्मर (230V/9V)
  • पॉवर-डायोड, 4 कि संख्या में
  • 100uF का कैपासिटर
  • 10uF के तीन कैपेसिटर
  • 7805 वोल्टेज रेगुलेटर
  • TSOP1738 इन्फ्रारेड सेंसर
  • IC555D टाइमर
  • 7474 D-टाइप का फ्लिप-फ्लॉप (एक बिट का मेमोरी)
  • MJE3055T पॉवर-ट्रांजिस्टर
  • 6 वोल्ट का रिले
  • 20K-Ohm का चर-प्रतिरोध
  • 100 ओह्म एवं 20 ओह्म का प्रतिरोध
  • PCB (इस आविष्कार के लिए डिजाइन किया हुआ)
    सारे उपकरण को प्राप्त करने के लिए  graphics-click-here-688974यहाँ क्लिक करें|

डिजाइन एवं कार्यप्रणाली:

इस आविष्कार को बनाने के लिए सबसे पहले हम AC वोल्टेज को DC वोल्टेज में बदलने के लिए सर्किट बनायेंगे (यही सर्किट अक्सर हमें DC चार्जर में मिलता है)| पहले हम 230V AC को 9V AC में बदलेंगे| उसके बाद पूर्ण-तरंग रेक्टिफायर सर्किट बनायेंगे जो कि चार पॉवर-डायोड से मिलकर बना होता है| इसके बाद इसको चित्रानुसार 100uF से जोड़ देंगे जिसको फिर 7805 नामक 5-वोल्ट के वोल्टेज रेगुलेटर से 5-वोल्ट DC में बदल देंगे, जिसको हम अपने इलेक्ट्रॉनिक सर्किट में उपयोग करेंगे| रिमोट का सिग्नल को सेंस करने का काम TSOP1738 के द्वारा होगा जिसका पिन-3 सेंस करने पर निम्न वोल्टेज देता है| इस निम्न वोल्टेज संकेत को हम IC555D टाइमर सर्किट के सहायता से पहचानते

हैं| और इसकी जानकारी एक बिट के मेमोरी 7474 (D-टाइप) के फ्लिप-फ्लॉप में सुरक्षित कर लेते हैं जो अपने पिछली याद कि हुई जानकारी के हिसाब से आनेवाली जानकारी को अपने में सुरक्षित कर लेता है| फिर हम इस मेमोरी के उत्पाद को एक पॉवर-ट्रांसिस्टर के मदद से शक्तिवर्धन करके एक रिले को संचालित करेंगे जिसके सहयोग से हम बल्ब तथा किसी इलेक्ट्रिक मशीन को नियंत्रित कर देते हैं|

रिमोट संचालित बल्ब प्रोजेक्ट का सर्किट डायग्राम

रिमोट संचालित बल्ब प्रोजेक्ट का सर्किट डायग्राम

Heart Rate Monitoring Sensor Circuit

Heart rate is a very vital health parameter that is directly related to the soundness of the human cardiovascular system. This project describes a technique of measuring the heart rate through a fingertip using a PIC microcontroller. While the heart is beating, it is actually pumping blood throughout the body, and that makes the blood volume inside the finger artery to change too. This fluctuation of blood can be detected through an optical sensing mechanism placed around the fingertip. The signal can be amplified further for the microcontroller to count the rate of fluctuation, which is actually the heart rate.

Reflective And Transmissive Pulse Oximetry

Pulse oximetry is a noninvasive photo-based technique that measures the light absorption and refection properties of deoxygenated and oxygenated hemoglobin. The amount of light absorbed in the hemoglobin is defined by the Lambert-Beer Law, which associates the degree of light absorption with the wavelength of the beam light, the path length, and the absorption coefficient of the blood constituents.

Heartbeat

 Requirements:

  • IC LM358
  • Potentiometer (2×100 K ohm).
  • Resistance (1×220 Ohm, 1×10 K,1×1 K, 1×47 K, 1×100 K.
  • Capacitor (1×100 nf , 1x 479 nf).
  • IR LED
  • IR Receiver.
  • Microcontroller board.
  • Display (LCD , LED Or Seven Segment).
  • Power Supply.

Sensor Assembly

The sensor unit consists of an infrared light-emitting-diode (IR LED) and a photo diode, placed side by side, and the fingertip is placed over the sensor assembly, as shown below. The IR LED transmits an infrared light into the fingertip, a part of which is reflected back from the blood inside the finger arteries. The photo diode senses the portion of the light that is reflected back. The intensity of reflected light depends upon the blood volume inside the fingertip. So, every time the heart beats the amount of reflected infrared light changes, which can be detected by the photo diode. With a high gain amplifier, this little alteration in the amplitude of the reflected light can be converted into a pulse.

HEART-BEAT-CIRCUIT
Finally

Automatic water tank Filling System

Automatic water level controller circuit is a simple project. It can automatically switch ON and OFF the domestic water pump set depending on the tank water level. You can implement this motor driver circuit at your home or college using less costly components.  The main advantage of this water level controller circuit is that it automatically controls the water pump without any user interaction.
The heart of this pump controller circuit is a NE 555 IC; Here we have manipulated the flip flop inside the 555 timer IC. Our project consists of two water level sensors, one fixed at the top and other at the bottom. Working of this circuit is almost similar to a bi stable mutlivibrator.

  • By Using This Project you are able to save water
  • By Using this you are able save time on monitoring to tank full and  to close Motor.
  • By using you are making you home to Smart Home category

Requirements

  1. Power supply (6v)
  2. NE 555 timer IC
  3. Resistors (100Ωx2, 10kΩ)
  4. Relay (6V, 30A)
  5. BC 548 transistor x2
  6. 1N4007 Diode

Automatic Water Tank Controller Engineering Project

Projects

C Programming Based Database management project

Here we had given a small c programming  based Project that having following features.

  •  this project uses File handling and taking input and wring to files.
  • This program is password protected with password 12345.
  • This program uses good knowledge of structure.
  • this program calculates employee salay , age and sort them according to different way.
  • this  program uses some system command of c programming.
  • You can download project from  MiniProject