Pages

PIC16F886 horn driver

A very interesting horn driver project presented by Microchip technology is presented in this circuit diagram . This horn driver project is based on PIC16F886 microcontroller , from Microchip . This microcontroller horn driver circuit diagram is very simple and require few external components . The PIC MCU has peripheral resources within the device to provide horn driver services in a very simple manner.

The PIC MCU peripherals include the Enhanced CCP (ECCP) module in Pulse-Width Modulation (PWM) Half-Bridge mode to drive the 2 horn drive leads and a single ADC input to monitor the horn feedback after it has been conditioned.

Horn characteristics are required to determine the defined parameters for the range of the PWM module.


For example , a horn with a resonant frequency of 3.5 kHz ± 0.5 kHz; the PWM module generates a PWM frequency output from 3 kHz to 4 kHz with 50% duty cycle.

With a device that is running off of the internal oscillator at 8 MHz, the clock source to Timer2 that drives the PWM period generates 2M clocks per second. For a 3 kHz period, this is 667 clocks per cycle, and for a 4 kHz period, this is 500 clocks per cycle. Because Timer2 is an 8-bit timer, accepting only a maximum value of 255, these clocks per cycle must be divided (a prescaler of divide-by-4, yielding 166 clocks per cycle for 3 kHz, and 125 clocks per cycle for 4 kHz) .


The PWM output driven by the ECCP module in Half-Bridge mode, with both the P1A and P1B outputs active-high, will step through the 125 through 166 clocks per cycle periods at a period rate, and as the Period register is loaded, the value will be dividedby- 2 and loaded into the Duty Cycle register for a 50% duty cycle. This will become the new PWM period for measuring the feedback from the horn driver, and drives the transistor that raises the level that the horn lead sees, to 9V.
Software for this project was developed by Bill Anderson , Microchip Technology Inc..


You can download the software for the PIC16F886 horn driver following this link : PIC16F886 horn driver.



PIC16F886 horn driver schematic circuit

Digital clock project using PIC16C54A microcontroller

Using microcontrollers you can design many interesting and useful electronic projects . This electronic project circuit is based on PIC16C622 microcontroller ( manufactured by Microchip ) . This PIC project is a simple resistance and capacitance “Pic Meter” which can measure resistance in the range 1W to 999W and capacitance from 1 nF to 999 nF.

This PIC METER uses a variation of the single-slope integrating converter.
All measured data are transmitted to a PC which displays the value measured.


This Pic Meter project is powered directly from the RS-232 serial port ,the RTS and DTR lines from the serial port output 3V to 11V to the PIC METER. The diodes D2 and D3 prevent any damage to the PC’s serial port.


Resistor R10 is used to current limit the Zener diode, D4. D4 is used to regulate the RTS and DTR voltage to 5.6V. Capacitors C3 and C4 provide power supply filtering to the Zener diode and the PIC16C622. Using this type of powering source for the PIC Meter will not damage the RS232 port , because this project has an very low current consumption of 7mA.

S1switch is used to select either a resistor or capacitor measurement. RB5 of the PIC16C622 is used to detect what type of component is being measured.


Resistor measurements that are started without any component connected to the measuring terminals will cause an error. Capacitor measurements without a component connected to the measuring terminals will give a result of 0 pF.

Switch S2 is used to initiate a measurement. The switch is connected to RB6 of the PIC16C622 and the
PORTB wake-up on change interrupt is used to detect a key press.


The charge time of the unknown RC network is measured using Timer0 , measured value is multiplied by the known value of resistance or capacitance and stored in an accumulator. Then the charge time of the known RC network is measured. The accumulator is divided by the known RC network charge time to give the value of resistance or capacitance of the unknown component.


This software and project was designed by Rodger Richey from Microchip Technology Inc.


You can download the software for this project from the Microchip website or following this link .Pic meter pic16c22 source code


 simple Pic meter schematic circuit diagram using pic16c22 microcontroller

PIC16F84A digital thermometer microcontroller project

You can measure temperature using various methods like : analog circuits , digital circuits or some other methods . This electronic project is a very simple thermometer that is based on the PIC16F84A microcontroller , designed by Microchip .

Why to use a thermometer that is designed using a microcontroller and not a classic analog thermometer ? because you can design a complex solution using few external components , resulting an low cost application that provide a high precision measurement .

This microcontroller project use watchdog timer function to measure temperature . The WDT on all PICmicro microcontrollers has a nominal time-out period of 18 ms. The WDT time-out period varies with temperature, VDD and part-to-part process variations. Without using a separate temperature sensor, it is possible to calculate the temperature with reasonable accuracy using the WDT time-out period.


To translate the environment temperature into an actual reading, the system must be able to do the following:
• Provide a method for establishing time-out to temperature calibration
• Count the number of WDT time-outs for a given period of time
• Equate the number of time-outs to a temperature

The system design also includes wake-on-interrupt key scanning and temperature display.
The circuit diagram is built around a PIC16F84A microcontroller, three seven segment
LEDs to display temperature. The common anode of each LCD is connected to PORTA<2:0> through PNP transistors, which are used to source the current for each digit. The entire device operates on a single 9V battery.

The PIC16F84A microcontroller is normally in SLEEP mode, consuming
very little operating current but if any key is pressed, it ‘wakes up’ from SLEEP and updates the WDT count, and checks for additional key presses. If there are none, it returns to SLEEP mode.
The WDT Thermometer has three distinct operating modes:
SLEEP Mode: This is the default mode the system starts in when power is applied .
Display Mode: When the TEMP key is pressed, the system wakes up and the LEDs show the temperature
in degrees Centigrade.
Calibration Mode: This mode creates a set of new calibration values, in addition to those present in the firmware.
To calibrate the device you must to :
1. Place the system in the temperature forcing system at the higher of the two calibration temperatures, and wait 5 minutes for the temperature to stabilize.
2. Press and hold the SET key while applying power to the system.
3. Press either the UP or DOWN key to increase or decrease the displayed temperature setting by one degree to match the actual temperature.
4. Press the SET key. The new high temperature calibration is stored in data EEPROM.
5. Change the temperature of the forcing system to the low calibration temperature (allow 5 minutes for the temperature to stabilize).
6. Press either the UP or DOWN key to increase or decrease the displayed temperature setting by one degree to match the current temperature.
7. Press the SET key. The new low temperature calibration is stored in data EEPROM, and the firmware sets a flag (Default) to indicate that new calibration information is available.
8. To return to the preprogrammed calibration at any time during this process, press the TEMP key.
This project ( hardware and software ) was designed by Leena Chaudhari from Microchip Technology Inc.


You can download source code for this PIC16F84A project by following this link


PIC16F84A digital thermometer electronic microcontroller project



PWM motor contoller with MSP430

A very simple and useful PWM dc motor controller circuit can be constructed using MSP430 integrated circuit manufactured by Texas Instruments.

Many of the MSP430 microcontrollers have either the Timer_A module or the Timer_A and Timer_B modules included in them. These modules contain a 16-bit counter that can be incremented from a number of clock sources. They can even count in low power modes. These timers also have a number of capture/compare registers that lend themselves to a variety of applications. One of these applications is the automatic generation of a PWM output to control a DC motor.

The circuit operates by polling the two push button input pins and either incrementing or decrementing the Timer_A capture/compare register CCR1, when either of the inputs is at a logic low state. The software checks the value of the register to ensure that it does

not exceed the minimum or maximum values the register will hold, and thereby prevents it from rolling over. Timer_A is configured in UP-mode with MCLK as timer clock source and output unit Out1 in output mode 7 to produce a PWM square wave output on P1.2/TA1.


The CCR0 value is set to 255 to define Timer_A to count up to 256 counts (8 bits).
Changing the value in CCR1 varies the duty cycle of the PWM signal produced by Timer_A. The PWM signal is used to switch a Darlington transistor. The transistor in turn powers the DC motor. As the PWM duty cycle varies, the average power to the motor also changes.


This change in average power is what controls the speed of the motor. The motor speed is variable in 256 steps from 0 to maximum. The DCO is set to approximately 5MHz to achieve a PWM frequency around 20KHz thereby allowing the motor to run without producing any audible PWM noise.


The TI TPS77133 shown in the circuit provides both the regulated VCC to the MSP430 and a power on reset signal to control the reset input of the MSP430. The TPS77233 can be used if the supply voltage supervisor (power good) function is required. The code is written in assembly language using the IAR Kickstart integrated development environment.

Download Programming code for pwm motor control with msp430

pwm dc motor control using msp430 microcontroller

PIC16C54 dual dice electronic project circuit

An electronic dice project circuit can be designed in various modes , using logic circuit or using microcontrollers . This electronic project is based on the PIC16C54 microcontroller , manufactured by Microchip . This project is a simple dual dice electronic project , that use few external electronic parts and LED displays , to generate ( simulate ) dices .

As you can see in the schematic circuit , the main advantage of this electronic dice project is that this circuit require few external electronic parts ( like many of the microcontroller based projects ) .

The circuit needs to be powered from a 5 volts DC power supply circuit , but you can use a 9 volts battery and a 5 volt three terminal regulator ( connected like in this circuit diagram ) .

There are two I/O ports in the 16C54; one 8 bit & the other 4 bit. The 8 bit port, Port B, is connected to the 7 segment display. Three pins of the 4 bit Port A are used and the other pin is tied high. Pin 4 of the PIC is also tied high to give a power-on reset.


A 150R resistor acts as a current limiting resistor for each display. PIC ports have a maximum sourcing current of 40mA ( the maximum current for the LED display is 200mA so it is the PIC that R1 is protecting, not the display.)

The PIC uses its internal RC clock oscillator option (with the 10K resistor, R3, and the 330pF capacitor, C2) and runs at about 330kHz. The switch is connected to input RA0. Normally this line is pulled high via R4 to +5V, but when the switch is closed the input is pulled low. The software detects the falling edge as a dice roll.

PIC16C54 microcontroller dual dice electronic project circuit

You can download souce code for this electronic project following this link

PIC12F683 microcontroller based metal detector

The metal detector project is designed using PIC12F683 microcontroller.

The circuit schematic is shown below


The source code for this project is shown below


/*
 *******************************************************************************
 * PIC12F683 microcontroller based metal detector
 *******************************************************************************
 *
 * 
 *
 * source code for mikroC PRO compiler V1.65
 * feel free to use this code at your own risks
 *
 * target : PIC12, oscillator in HS mode, watchdog enabled
 *
 * PIC PIN Assignemnt :
 *
 * GP0 : detect LED indicator
 * GP1 : calibrate LED indicator
 * GP2 : NC
 * GP3 : NC
 * GP4, GP5 : inductor
 *
 *******************************************************************************
 */

#define MAXTRY 15       // number of watchdog restart to calibrate loop counter

unsigned char   ctr ;           // number of loops between two watchdog resets
unsigned char   previous ;      // previous value of ctr
unsigned char   calibr ;        // calibration value when oscillator runs free
unsigned char   restarts ;      // number of watchdog restarts
unsigned char   en ;            // enable flag, allows detection

/*
 * main loop
 */
void    main()
        {
        unsigned char   i ;
        

        /*
         * configure GPIO as digital port
         */
        CMCON0 = 7 ;
        ANSEL = 0 ;
        TRISIO = 0 ;
        GPIO = 0 ;

        /*
         * power up ?
         */
        if(STATUS.NOT_TO)
                {
                /*
                 * yes, init variables
                 */
                restarts = 0 ;
                calibr = 1 ;
                }

        /*
         * watchdog reset counter
         */
        if(restarts < 255) restarts++ ;

        /*
         * if counter differs too much from calibration value
         */
        if((previous ^ ctr) > calibr)
                {
                /*
                 * turn detect LED on
                 */
                GPIO.F0 = en ;
                
                /*
                 * if not on power up
                 */
                if(STATUS.NOT_TO == 0)
                        {
                        /*
                         * while in calibration mode
                         */
                        if(restarts < MAXTRY)
                                {
                                /*
                                 * shift calibration value
                                 * and wait a little bit
                                 */
                                calibr <<= 1 ;
                                Delay_ms(5) ;
                                }
                        }
                else
                        {
                        /*
                         * turn detect LED off
                         */
                        GPIO.F0 = 0 ;
                        }
                }

        /*
         * save last counter
         */
        previous = ctr ;

        /*
         * is calibration over ?
         */
        if(restarts > MAXTRY)
                {
                /*
                 * yes, turn calibrate LED off
                 * and set enable flag
                 */
                GPIO.F1 = 0 ;
                en = 1 ;
                }
        else
                {
                /*
                 * no, turn calibrate LED on
                 * and clear enable flag
                 */
                GPIO.F1 = 1 ;
                en = 0 ;
                }

        /*
         * set watchdog prescaler
         */
        OPTION_REG = 0b11111001 ;
        
        /*
         * start counter, to be interrupted by watchdog
         */
        ctr = 0 ;
        for(;;)
               {
               ctr++ ;
               }
        }



Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.