Monday, 1 December 2014

Testing Stepper Motor stepping on LED with PIC18F4550


MICROCONTROLLER AND ITS INTERFACING WITH IR SENSOR

Microcontroller

microcontroller (sometimes abbreviated µCuC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to themicroprocessors used in personal computers or other general purpose applications.

Interfacing 
A microcontroller can be considered a self-contained system with a processor, memory and peripherals and can be used as an embedded system.[8] The majority of microcontrollers in use today are embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems.
While some embedded systems are very sophisticated, many have minimal requirements for memory and program length, with no operating system, and low software complexity. Typical input and output devices include switches, relayssolenoidsLEDs, small or custom LCD displays, radio frequency devices, and sensors for data such as temperature, humidity, light level etc. Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O devices of a personal computer, and may lack human interaction devices of any kind.


Interrupts[edit]

Micro controllers must provide real time (predictable, though not necessarily fast) response to events in the embedded system they are controlling. When certain events occur, an interrupt system can signal the processor to suspend processing the current instruction sequence and to begin an interrupt service routine (ISR, or "interrupt handler"). The ISR will perform any processing required based on the source of the interrupt, before returning to the original instruction sequence. Possible interrupt sources are device dependent, and often include events such as an internal timer overflow, completing an analog to digital conversion, a logic level change on an input such as from a button being pressed, and data received on a communication link. Where power consumption is important as in battery operated devices, interrupts may also wake a microcontroller from a low power sleep state where the processor is halted until required to do something by a peripheral event.
The output from the IR sensor circuit will be connected to pins of a PIC18f4550 microcontroller and the microcontroller will regard it as digital input to read either 1 or 0.  According to the output from the IR sensor module, the PIC18F4550 will respond by glowing led. Since we just want to read some voltage in the microcontroller as input (either High or low) hence we are going to configure input pins as digital to read just 1 or 0 from the sensor. - See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpufThe output from the IR sensor circuit will be connected to pins of a PIC18f4550 microcontroller and the microcontroller will regard it as digital input to read either 1 or 0.  According to the output from the IR sensor module, the PIC18F4550 will respond by glowing led. Since we just want to read some voltage in the microcontroller as input (either High or low) hence we are going to configure input pins as digital to read just 1 or 0 from the sensor. - See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpufThe output from the IR sensor circuit will be connected to pins of a PIC18f4550 microcontroller and the microcontroller will regard it as digital input to read either 1 or 0.  According to the output from the IR sensor module, the PIC18F4550 will respond by glowing led. Since we just want to read some voltage in the microcontroller as input (either High or low) hence we are going to configure input pins as digital to read just 1 or 0 from the sensor. - See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpufThe output from the IR sensor circuit will be connected to pins of a PIC18f4550 microcontroller and the microcontroller will regard it as digital input to read either 1 or 0.  According to the output from the IR sensor module, the PIC18F4550 will respond by glowing led. Since we just want to read some voltage in the microcontroller as input (either High or low) hence we are going to configure input pins as digital to read just 1 or 0 from the sensor. - See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpuf
The output from the IR sensor circuit will be connected to pins of a PIC18f4550 microcontroller and the microcontroller will regard it as digital input to read either 1 or 0.  According to the output from the IR sensor module, the PIC18F4550 will respond by glowing led. Since we just want to read some voltage in the microcontroller as input (either High or low) hence we are going to configure input pins as digital to read just 1 or 0 from the sensor. - See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpuf
The output from the IR sensor circuit is connected to RA0 of the pic18f4550 which is configured as input with TRISB registers, and the output will be displayed on LED connected across RD7, RD6,RD5 (PORTD) and RB0 and RB1 (PORTB) which are configured as output pins. Follow the schematic below.
Schematic (IR sensor and PIC18F4550 microcontroller)
Schematic for Infrared IR sensor circuit interfacing with a PIC18F4550 Microcontroller circuit
In this project we don’t need to perform any Analog to Digital Conversion(ADC), hence we are going to turn the ADC off (ADCON0bits.ADON = 0) and configure all the PINS to Digital.  At the default 1 MHZ oscillator frequency the output sometimes gives unstable result, hence tuning the microcontroller to 8MHZ solved the problem, Please note that pic18f4550 works by default on 1 MHZ and you can change the OSCCON bits settings to tune the oscillator frequency according to your requirement.
Search in pic18f4550 datasheet for OSCCON register bits and you will find a nice description and bits settings table for available oscillator frequency and settings to configure the microcontroller oscillator frequency. Here I have configured the internal oscillator to 8MHZ to avoid switch debouncing. However it works well with 1MHZ settings as well. As a better plan the comparator is also turned off to avoid any conflict.
                          All the resistors in the above Schematic is 1k resistance. If possible, it is also recommended to add a IC 7805 liner Voltage regulator IC as a source of +5V to avoid any voltage fluctuation which could possibly damage the microcontroller. Make sure the input voltage to pic18f4550 must never exceed +5v. Please do read the excellent pic18f4550 datasheet provided by microchip.
IR sensor circuit programmed with PIC18F4550 microcontroller as Digital Input pin

Source Code:

MPLAB IDE and C18 Compiler is used for compiling the source code, however MPLAB X IDE and XC8 Compiler can be also used with no difficulty. Download the entire project at the end of the source code below with compiled firmware. 

SOURCE CODE :infraredinput.c

/*
 * File:   infraredinput.c
* Author: ron
 * December 10, 2012, 1:21 PM
 */
#include <p18f4550.h>           // Include Header for PIC18F4550
#define switch1  PORTAbits.RA0  // Switch on RA0
#define led1    LATDbits.LATD7     // led1
#define led2    LATDbits.LATD6    // led2
#define led3    LATBbits.LATB0   // led3
#define led4    LATBbits.LATB1    // led4
#define led5    LATBbits.LATB2    // led5
void main (void)
{
            /* If you want your microcontroller to work at  1MHZ then comment the three lines below */
OSCCONbits.IRCF0 = 1 ;               // set internal clock to 8 MHz
OSCCONbits.IRCF1 = 1;                //  For Avoiding switch debouncing problem     
OSCCONbits.IRCF2= 1;                 //
/* Input output settings*/
       TRISAbits.TRISA0 = 1;                  //   RA0 Input for taking input from IR sensor
       TRISDbits.TRISD7 = 0;                  // Port D pins output
       TRISDbits.TRISD6 = 0;
       TRISBbits.TRISB0 = 0;                  // Port B pins Output
       TRISBbits.TRISB1 = 0;
       TRISBbits.TRISB2 = 0;
       CMCON = 0x07;           // Disable Comparator
       ADCON1bits.PCFG0 = 1;          // These 4 settings below determines the analog or digital input
       ADCON1bits.PCFG1 = 1;          // In our case we are making all the pins digital
       ADCON1bits.PCFG2 = 1;         // by setting them as 1111
       ADCON1bits.PCFG3 = 1;         // Check with the datasheet for a nice desc of these bits and config.
       ADCON0bits.ADON = 0;  //  Disabled ADC
while(1)
     {   //Forever Loop
            if(switch1 == 1)    //   On reading IR sensor value ON
                    {    //Turn led ON
                                led1 = 1;
                                 led2 = 1;
                              led3 = 1;
                              led4 = 1;
                                 led5 = 1;              }
       else if ( switch1 == 0) // On reading IR Sensor Value OFF
                      {   //Turn led off
                              led1 = 0;
                            led2 = 0;
                            led3 = 0;
                            led4 = 0;
                            led5 = 0;              }
                                     else {    }
    }   //End While loop --forever
}
/* THE END */
The coding above is pretty much self-explanatory, and comment lines must be also helpful for better understanding.
- See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpuf
The output from the IR sensor circuit is connected to RA0 of the pic18f4550 which is configured as input with TRISB registers, and the output will be displayed on LED connected across RD7, RD6,RD5 (PORTD) and RB0 and RB1 (PORTB) which are configured as output pins. Follow the schematic below.
Schematic (IR sensor and PIC18F4550 microcontroller)
Schematic for Infrared IR sensor circuit interfacing with a PIC18F4550 Microcontroller circuit
In this project we don’t need to perform any Analog to Digital Conversion(ADC), hence we are going to turn the ADC off (ADCON0bits.ADON = 0) and configure all the PINS to Digital.  At the default 1 MHZ oscillator frequency the output sometimes gives unstable result, hence tuning the microcontroller to 8MHZ solved the problem, Please note that pic18f4550 works by default on 1 MHZ and you can change the OSCCON bits settings to tune the oscillator frequency according to your requirement.
Search in pic18f4550 datasheet for OSCCON register bits and you will find a nice description and bits settings table for available oscillator frequency and settings to configure the microcontroller oscillator frequency. Here I have configured the internal oscillator to 8MHZ to avoid switch debouncing. However it works well with 1MHZ settings as well. As a better plan the comparator is also turned off to avoid any conflict.
                          All the resistors in the above Schematic is 1k resistance. If possible, it is also recommended to add a IC 7805 liner Voltage regulator IC as a source of +5V to avoid any voltage fluctuation which could possibly damage the microcontroller. Make sure the input voltage to pic18f4550 must never exceed +5v. Please do read the excellent pic18f4550 datasheet provided by microchip.
IR sensor circuit programmed with PIC18F4550 microcontroller as Digital Input pin

Source Code:

MPLAB IDE and C18 Compiler is used for compiling the source code, however MPLAB X IDE and XC8 Compiler can be also used with no difficulty. Download the entire project at the end of the source code below with compiled firmware. 

SOURCE CODE :infraredinput.c

/*
 * File:   infraredinput.c
* Author: ron
 * December 10, 2012, 1:21 PM
 */
#include <p18f4550.h>           // Include Header for PIC18F4550
#define switch1  PORTAbits.RA0  // Switch on RA0
#define led1    LATDbits.LATD7     // led1
#define led2    LATDbits.LATD6    // led2
#define led3    LATBbits.LATB0   // led3
#define led4    LATBbits.LATB1    // led4
#define led5    LATBbits.LATB2    // led5
void main (void)
{
            /* If you want your microcontroller to work at  1MHZ then comment the three lines below */
OSCCONbits.IRCF0 = 1 ;               // set internal clock to 8 MHz
OSCCONbits.IRCF1 = 1;                //  For Avoiding switch debouncing problem     
OSCCONbits.IRCF2= 1;                 //
/* Input output settings*/
       TRISAbits.TRISA0 = 1;                  //   RA0 Input for taking input from IR sensor
       TRISDbits.TRISD7 = 0;                  // Port D pins output
       TRISDbits.TRISD6 = 0;
       TRISBbits.TRISB0 = 0;                  // Port B pins Output
       TRISBbits.TRISB1 = 0;
       TRISBbits.TRISB2 = 0;
       CMCON = 0x07;           // Disable Comparator
       ADCON1bits.PCFG0 = 1;          // These 4 settings below determines the analog or digital input
       ADCON1bits.PCFG1 = 1;          // In our case we are making all the pins digital
       ADCON1bits.PCFG2 = 1;         // by setting them as 1111
       ADCON1bits.PCFG3 = 1;         // Check with the datasheet for a nice desc of these bits and config.
       ADCON0bits.ADON = 0;  //  Disabled ADC
while(1)
     {   //Forever Loop
            if(switch1 == 1)    //   On reading IR sensor value ON
                    {    //Turn led ON
                                led1 = 1;
                                 led2 = 1;
                              led3 = 1;
                              led4 = 1;
                                 led5 = 1;              }
       else if ( switch1 == 0) // On reading IR Sensor Value OFF
                      {   //Turn led off
                              led1 = 0;
                            led2 = 0;
                            led3 = 0;
                            led4 = 0;
                            led5 = 0;              }
                                     else {    }
    }   //End While loop --forever
}
/* THE END */
The coding above is pretty much self-explanatory, and comment lines must be also helpful for better understanding.
- See more at: http://www.rakeshmondal.info/IR-Sensor-Interface-pic18f4550-input#sthash.gt45TPe7.dpuf

Density based traffic light control using microcontroller



HOW TO INTERFACE MICROCONTROLLER WITH STRAIN GAUGE LOAD CELL

8051 microcontroller based projects trafffic density controller ppttraffic light controller using 8051 ppt , 8051 microcontroller based traffic light controllerdensity based traffic light controller using 8051 , density based traffic light control system using microcontroller 8051 pdftraffic light controller using 8051 microcontroller pdf , traffic light controller 8051 microcontroller program projectppt on traffic density controller using microcontroller ,density based traffic light control system using 8051microcontroller 8051 based traffic light controller program , microcontroller based traffic density controller ppt,
to know how straing gauge load cell works...
http://www.rdpe.com/ex/hiw-sglc.htm
microcontroller based project video links for final year eee b-tech student
https://www.youtube.com/playlist?list=PLeEL-CP8rlErwxObNFblnVPtCRvJ9gbfZ
2013-2014 (b-tech) PROJECTS
EMBEDDED HARDWARE PROJECT TITLES
· A Design of Bi-verification Vehicle Access Intelligent Control System based on RFID 
· A New Intelligent Remote Control System for Home Automation and Reduce Energy Consumption 
· A New Method for Detecting Leaks in Underground Water Pipelines 
· A Novel MEMS Respiratory Flow Sensor 
· A Novel Rear End Collision, Accident Avoidance, Distance Measuring using Ultrasonic Technology
· A Real-Time Wireless Brain–Computer Interface System for Drowsiness Detection
· A Reconfigurable Snake Robot Based on CAN-Bus
· A Wireless Sensor Node SoC with a Profiled Power Management Unit for IR Controllable Digital Consumer Devices
· Alcohol Sensor Detection for Drivers In Vehicles
· Alive human detecting robot used for natural disasters
· Antenna Adjusting control through PC using RF communication
· Anti Sleep Alarm for Students Based on RTC
· Anti theft alert and auto arresting system for museums and jewelry shops
· Apartment automation monitoring and management system
· Apartment security robot with auto dialing
· Auto wiper control for cars during rain
· Automated Prepaid Energy Meter Consumption System
· Automatic Bottle Filling Machine Control System
· Automatic code changing mechanism for Locker Security
· Automatic Dam Shutter Control based on Microcontroller
· Automatic Flush System Based Microcontroller
· Automatic Induction Motor Starter With Programmable Timer
· Automatic Irrigation Water Supply Monitoring And Control System
· Automatic Line following Robot
· Automatic navigation robot for industrial applications based on RFID technology
· Automatic Railway Gate Control With Voice Announcement
· Automatic Street Light Controller using TRIAC
· Automatic Vehicle Starter System Based Alcohol Breath Analyzer Sensing
· Automatic water pump controller
· Banking password and authentication process using SMS
· Bomb handling robot
· Border security system using RF
· Breathe alcohol tester controlling a car ignition system
· Bus Number Announcements and Identification for Blind People
· Car Monitoring using Bluetooth Security System
· Cartesian robot for the purpose of the pick and place
· Coin operated fast cell phone charger
· Complete house electrical automation with auto dialing to EB for power failure with IVRS
· Control of heavy electrical loads using GSM mobiles
· Count Down Timer based on Microcontroller
· C-to-DC converter using MOSFETS
· DC Motor speed control using RF communication
· DC Motor Speed Controller using Cellular Phone
· Design and development of touch screen based ticket vending machine
· Design and Implementation Cell phone operated land rover
· Design and Implementation of a Mini-Size Search Robot
· Design and implementation of Bi-directional Visitor Counter
· Design of a Directional Detector / Counter
· Design of a Wall-Climbing Robot with Passive Suction Cups
· Design of Embedded Fastest Finger First using Microcontroller
· Design Of Intelligent Traffic Light Controller Using Embedded System
· Design of Real-Time Embedded Clock based on Microcontroller
· Design of Sensor Modules of Active & Intelligent Energy-saving System
· Design of Wireless Sensor System for Neonatal Monitoring
· Development of Anti-Rigging Voting system using RFID card Technology
· Device Control through Mobile Phone
· Device Controlling through PC
· Dew-Based Wireless Mini Module for Respiratory Rate Monitoring
· Digital Function Generator
· Digital Heart Beat Monitor with LCD Display
· Digital Thermometer Cum Controller
· Digital Watt meter with voltage and current display
· Dim-dip automation for four wheelers
· EB prepaid card system
· Electronic Energy Meter With Instant Billing
· Embedded based AC Motor Speed Control Using TRIAC
· Embedded based Advanced Sensors Controlled Bank Security System
· Embedded based Auto SMS Facility enabled Vehicle Accident Detection Sensor
· Embedded based Automatic Car Parking Radar
· Embedded based Automatic College Bell
· Embedded based Automatic Room Light Controller with Visitor Counter
· Embedded based Boiler Management System
· Embedded based Coin Mobile Phone Charger for Public Places
· Embedded based Coin Operated Water Wending Machine
· Embedded based Density Sensed Dynamic Time based Traffic Light Control
· Embedded based Digital Calendar LCD Display
· Embedded based Digital RPM Indicator using Proximity Sensor
· Embedded based Gas Leakage Detection System for Industries
· Embedded based Industrial Process Control and Automation System
· Embedded based Infrared Remote Switch
· Embedded Based Intelligent Electronic Voting Machine
· Embedded based intelligent e-voting machine
· Embedded based Multi Channel Fire Sensing System and Control
· Embedded based Password Door Locking
· Embedded based Power Sharing of Transformers with Auto Protection
· Embedded based Secured Wireless Data Communication
· Embedded based Sound, Flame, Vibration Detector
· Embedded based Telephone Controlled Motor
· Embedded based Temperature Analyzing System for Industrial Control
· Embedded based Train Automation Accident Prevention and Unmanned Gate Control
· Embedded Energy Economizer and Management System
· Embedded Microcontroller based Industrial Timer based Microcontroller
· Embedded Parking Yard Monitoring and Control System
· Embedded RF based Remote Control
· Embedded soft start of DC motors using IGBT with over load protection
· Embedded System based Highway Monitoring System
· Embedded System based Transformer Oil Testing Machine
· Embedded System Controlled Electroplating System
· Embedded Temperature based Fan Speed Control System
· Embedded Token Display System with Voice Message
· Energy meter monitoring and control system using SMS technology
· Ethernet Enabled Digital I/O Control in Embedded Systems
· Finger print based secure ATM process
· Fluid Level Controller with Dry Run & Over Voltage Protection
· Frequency meter for Digital Signals using Microcontroller
· Fuel level monitoring system
· GPS Based Border Alert System for Fisherman
· Green House Monitoring and Automation
· GSM And GPS Based Vehicle Tracking And Locating System
· GSM based door opening system using password
· GSM Based Highway Road Traffic Monitoring System
· GSM based Home automation
· GSM based instantaneous vehicle registration details extraction system
· GSM based Irrigation System
· Head Motion Controlled Wheel chair
· Heavy Vehicles Alert And Intimating System For Traffic Police Using Capacitive Sensor And GSM
· High current DC motor controller
· Home Automation System Based On Wireless and Internet
· Home automation using RF communication
· Human identification robot in forest area
· Identification of cracks in tunnel using tunnel robot
· Identification of Missing Objects with Group Coding of RF tags
· Identifying Objects Using RF Transmitters and Receivers and Retrieving Data Using GSM
· Implementation of Code Lock Using Microcontroller
· Implementation of Digital Thermometer based Microcontroller
· Implementation of Secured Room Access System based Microcontroller
· Implementation of Solar Cell Tracing System for the Maximum Utilization of Solar Power and Illumination
· Implementation of Temperature Indicator cum Controller Microcontroller
· Implementation of Water level Controller based Microcontroller
· Implementation of Wireless Messaging Via Mobile Microcontroller
· Induction Motor Control using Touch Screen
· Industrial annunciator using IVRS
· Industrial Fault Monitoring & Indication using Advanced Sensors
· Industrial stepper motor control system
· Intelligent banking machine for Physically Impaired
· Intelligent Home Monitoring and Intruder Detection System using Wireless Technology
· Intelligent Home Security and Management System through GSM
· Intelligent Multi Sensor System for Control of Boilers and Furnaces
· Intelligent traffic system for emergency vehicle using Wireless sensor network
· Large Scale Active RFID System Utilizing Zigbee Networks
· Laser based Object Counter with Preset Stop Machine
· LDR based automatic lamp illumination controller with High Power/Intensity LED lighting
· LDR Based Highways Road Light Failed Intimation Using GSM And GPS
· LDR based Power Saver for Street Light Control System
· Lift controller using Microcontroller
· Line following robot with multiple intelligence
· Low Cost LCD Frequency Meter using Microcontroller
· Low-Cost Versatile Timer using Microcontroller Implementation
· MEMS Accelerometer controller Wheel chair
· Micro controller based Induction Meter Implementation
· Micro controller based Temperature Meter Implementation
· Micro Controller Based Wireless Home Automation
· Microcontroller Based Alarm Clock Microcontroller
· Microcontroller based coded device switching system for multiple device switching
· Microcontroller based Implementation of Capacitance Meter
· Microcontroller based Implementation of DC Motor Controller
· Microcontroller based Implementation of Heart Rate Meter
· Microcontroller based Implementation of Tachometer
· Microcontroller based Implementation of Temperature Indicator
· Microcontroller based Implementation of Ultrasonic Distance Meter
· Microcontroller based Load Cell Digital Weighting Machine
· Microcontroller Based Moving Message Display
· Microcontroller based Multiple device control based on change in input frequency
· Microcontroller based solar charger
· Microcontroller Based Speedometer cum odometer implementation
· Microcontroller based weather forecasting robot using GSM
· Mobile based Design and Development of Bomb Detecting Robot
· Monitoring of Posture Allocations and Activities by a Shoe-Based Wearable Sensor
· Motion Based Password for device switching
· Multi Channel Data Logger using Embedded System.
· Multi channel door alarm with display
· Multiple timer control for electrical devices
· Multipurpose card with unique identification
· Payment system made automatic as per consumer requirement
· PC based Examination for Blind people
· PC based Unman Ground Vehicle
· PC Based Wireless Appliance Control
· PC based Wireless Stepper Motor Controller
· PC controlled home automation using RF communication
· Petrol Bunk Automation Using Smartcard
· PWM based DC Motor Speed Controller.
· PWM based variable DC supply using embedded technology with short circuit protection
· Radio Frequency based Real-time Child monitoring and alarm system
· Rain operated viper operated system
· Real Time Atomization Of Agricultural Environment For Social Modernization of Indian Agriculture System
· Real Time Clock based automatic college bell ringing system along with temperature display
· Real-Time Combinatorial Optimization for Elevator Group Dispatching
· Remote Controlled Stepper Motor Implementation
· Remote Monitoring Intelligent System Based on Fingerprint Door Lock
· Remote Process Monitoring through SMS
· RF Based Robot Control Using PIR Sensor For Defense Force
· RF based Unmanned Automated Electric Power Tariff Calculation by the Remote EB Station
· RF based vehicle tracking system
· RFID Based attendance management with door access control
· RFID based Attendance System
· RFID based industrial gateway system
· RFID based library database management and search tool implementations
· RPM counter using Microcontroller
· RPM measurement of motors using OPTO isolator
· RTC based automatic water supply
· SCR based Dc power supply with output protection
· Secure Remote Patient Monitoring System
· Sensors-Based Wearable Systems for Monitoring of Human Movement and Falls