Posts

Showing posts from August, 2013

How to interface Servo motor with PIC (Code + Schematic)

Image
This post will provide a practical tutorial of how to interface servo motor with PIC microcontroller. I derived some mathematical formulas to calculate its precise rotation in degrees. I am using Hextronik (HXT900) 9 gram servo motor in this particular tutorial. The angle of servo motor is controlled through PWM (Pulse Width Modulation) by varying a pulse width from 0.5ms to 2.5ms (0o – 180o). I am using 16Bit PIC microcontroller but same code will work on all PIC except the PWM module functions.
You may download code and schematic from the download section at the bottom of this post. I am using MPLAB X IDE, C30 Compiler and Schematic is in PDF. This code is written in C Language and will work on PIC24, DsPIC33 and DsPIC30 (16bit microcontroller) by slightly changing the code.
In this post I supposed that you know following if not then please read them before proceeding further in this post.
1.How to interface LCD with PIC (Click here). 2.How to generate PWM using PIC (Click here). 3.How t…

Digital Bulb Intensity Controller using PIC. (Code + Schematic)

Image
This post will provide a practical example of how to control intensity of a DC bulb digitally. The intensity of bulb is controlled through PWM (Pulse Width Modulation) by varying a duty cycle. I am using 16Bit PIC microcontroller but same code will work on all PIC except the PWM module functions.
You may download code and schematic from the download section at the bottom of this post. I am using MPLAB X IDE, C30 Compiler and Schematic is in PDF. This code is written in C Language and will work on PIC24, DsPIC33 and DsPIC30 (16bit microcontroller) by slightly changing the code.
In this post I supposed that you know following if not then please read them before proceeding further in this post.
1)How to interface LCD with PIC (Click here). 2)How to generate PWM using PIC (Click here). 3)How to interface Push button with PIC (Click here).
Experimental Setup and circuit: As I am using DsPIC33F custom I/O board and a LCD. LCD is connected with PortE through Level translators as LCD works on of 5.0…

Digitally controlled DC fan using PWM (Code + Schematic)

Image
This post will provide a practical example of how to control DC fan speed digitally. The speed of Fan is controlled trough PWM (Pulse Width Modulation) by varying the duty cycle. I am using 16Bit PIC microcontroller but same code will work on all PIC except the PWM module functions.
You may download code and schematic from the download section at the bottom of this post. I am using MPLAB X IDE, C30 Compiler and Schematic is in PDF. This code is written in C Language and will work on PIC24, DsPIC33 and DsPIC30 (16bit microcontroller) by slightly changing the code.
In this post I supposed that you know following if not then please read them before proceeding further in this post.
1)How to interface LCD with PIC (Click here). 2)How to generate PWM using PIC (Click here). 3)How to interface Push button with PIC (Click here).
Experimental Setup and circuit: As I am using DsPIC33F custom I/O board and a LCD. LCD is connected with PortE through Level translators as LCD has working voltage of 5.0VDC…