Electronics tutorials including microcontroller, microprocessor, programing and circuits. Intended for beginners, electronics hobbyists, college students, professionals and educational purposes.

DC Motor Speed Control using PWM with PIC Microcontroller

I already posted about Interfacing DC Motor with PIC Microcontroller. In our robotics applications we may have to control the speed of the DC Motor. In this tutorial we will see how to control the speed of a DC Motor using Pulse Width Modulation (PWM). By using PWM we can easily control the average power delivered to a load and by thus we can easily control the speed of the DC Motor. You may think that a variable resistor in series...

Generating PWM with PIC Microcontroller using CCP Module

PWM is a technique used to generate analog output signal using digital signals. It is commonly used to control average power delivered to a load, motor speed control, generating analog voltage levels and for generating analog waveforms. CCP Modules are available with a number of PIC Microcontrollers. CCP stands for Capture/Compare/PWM. Using PWM module is far more easier and cost effective than using extra chips for PWM generation.  MikroC Pro for PIC Microcontroller provide built-in library for PWM which makes our...

Expanding IO Ports of PIC Microcontroller using MCP23S17

Usually a microcontroller comes with a limited number of IO ports called General Purpose Input Output (GPIO) ports. But some applications require more IO ports than that available on a microcontroller. In these cases we can use IO Port Expanders to increase the IO capability of a microcontroller. MCP23017 and MCP23S17 are two such 16 bit IO expander with Serial Interface  manufactured by Microchip. MCP23017 uses high speed I2C interface while MCP23S17 used high speed SPI interface. MCP23S17 In this tutorial we...

Analog to Digital Conversion in ARDUINO

Analog to digital conversion module of ARDUINO UNO has 6 input ports. The number of the port varies with your ARDUINO model but the coding remains the same. The analog reading in the analog inputs are converted into corresponding 10bit(0-1023). ARDUINO developers have made such an option that you can print anything and see it on the Serial monitor. This example demonstrates analog input usage by reading an analog sensor on analog pin 0 and turning on and off a light...

Building Your Own PCB : Printed Circuit Boards

The electronic product construction technique for many is the printed circuit board, or PCB. There are a number of ways to build a custom printed circuit board. Good quality copper clad should be used for manufacturing of printed circuit board. Materials that you use to make printed circuit boards come in various forms. You can buy either single- or double-sided copper clad. Unless you’re making a double-sided board, stick with single-sided clad. The board that you use to make your PCB...

Expanding Output Pins of a PIC Microcontroller through Multiplexing

Imagine that you want to control 100 LED's with a PIC Microcontroller. No PIC Microcontroller with a DIP package having that many IO lines. This article explains two ways to expand output pins of a Microcontroller through multiplexing. Here we are using Time Division Multiplexing to expand output pins. The first method is by using D-Latch and second method is by using Serial in Parallel Out Shift register. In this tutorial we demonstrate the working by using 64 LEDs. Using D Flip-Flop and Decoder 74574 Octal...

PIC to PIC Communication using UART

Introduction PIC to PIC communication will be needed in some embedded applications. We have two options to transmit data through transmission lines. Parallel Transmission Serial Transmission Parallel Transmission Parallel Data Transmission In parallel communication an entire byte of data is transmitted at a time. That is each bit has dedicated line. Thus for 8-bit data transfer we need 8 dedicated lines as shown above. Serial Transmission Serial Data Transmission In Serial Transmission only one bit of a byte is transmitted at a time. There is only one communication line, thorough which...

Using Interrupt with PIC Microcontroller

Introduction Interrupt is the one of the most powerful feature in embedded applications. Almost all the real time applications are implemented using Interrupts. So what is an Interrupt...?? As the name suggests Interrupts are special events that requires immediate attention, it stops a microcontroller/microprocessor from the running task and to serve a special task known as Interrupt Service Routine (ISR) or Interrupt Handler. Suppose you are at home, taking coffee. Suddenly your mobile phone rings. You stop taking coffee and answer the call. When you have...

>