This repository showcases a series of projects focused on controlling DC motors and LEDs using the PIC16F877A microcontroller. Each project highlights different functionalities, including directional control, speed regulation through Pulse Width Modulation (PWM), and real-time LED brightness adjustment using potentiometers.
- DC Motor Control: Govern the direction and operation of a DC motor with input signals for enabling and disabling the motor.
- DC Motor Speed Control: Implement PWM to dynamically control the motor's speed, incrementally increasing it until reaching a predefined maximum.
- Automatic Direction Control: Automatically rotate the motor in both directions for specified durations, demonstrating timing and directional control.
- PWM LED Intensity Control: Adjust LED brightness based on potentiometer input, providing smooth transitions with real-time adjustments.
These projects serve as practical examples for understanding microcontroller applications in motor and light control, emphasizing user-friendly interfaces and modular design for easy integration and modification.
This project controls a DC motor using a PIC16F877A microcontroller. The motor's operation is governed by two input signals and an enable signal, allowing for directional control and enabling/disabling the motor.
- Motor Control: Control the direction and operation of a DC motor.
- PWM Control: Utilize Pulse Width Modulation for speed control (if implemented).
- Flexible Inputs: Use two potentiometers for adjusting input signals dynamically.
- Interrupt Handling: Placeholder for future interrupt functionality.
- Connect the DC motor to the output pins as specified.
- Adjust the potentiometers to control the input signals dynamically.
- Compile and upload the code to the PIC16F877A microcontroller.
- Power the circuit and observe the motor's operation based on input signals.
This project controls the speed of a DC motor using Pulse Width Modulation (PWM) on the PIC16F877A microcontroller. The speed is automatically increased every 500 ms until it reaches a defined maximum.
- PWM Control: Adjust the speed of the motor dynamically using PWM.
- Incremental Speed Control: Automatically increase the speed by a defined increment until a maximum speed is reached.
- Easy Integration: Simple functions to enable/disable PWM and set duty cycles.
This project demonstrates how to control a DC motor using a PIC16F877A microcontroller. The motor rotates for 5 seconds in one direction, stops for 3 seconds, and then rotates in the opposite direction for another 5 seconds, followed by another 3-second stop.
- Control the motor direction: Rotate the motor clockwise and counter-clockwise.
- Adjustable timing: The motor operates for specified durations.
- Simple implementation: Easy to integrate and modify for various applications.
- Initialization: The microcontroller's ADC and interrupt settings are configured.
- Motor Control:
- The motor is enabled and set to rotate clockwise.
- After 5 seconds, the motor is disabled and paused for 3 seconds.
- The motor is then set to rotate counter-clockwise for another 5 seconds.
- Finally, the motor is disabled again for 3 seconds.
- Infinite Loop: The operation repeats indefinitely.
This project demonstrates how to adjust the intensity of an LED using Pulse Width Modulation (PWM) based on the position of a potentiometer. The system reads the potentiometer value and adjusts the LED brightness accordingly.
- PWM Control: Adjusts LED intensity using PWM signals.
- Potentiometer Input: Reads analog values from a potentiometer to set the brightness.
- Configurable Delay: Adjustable timing for reading the potentiometer.
- Initialization: The ADC (Analog-to-Digital Converter) and interrupt settings are configured.
- PWM Setup: The PWM module is enabled to control the LED brightness.
- Main Loop:
- The system continuously reads the potentiometer value.
- It updates the PWM duty cycle to adjust the LED intensity.
- A delay of 500 ms is introduced between adjustments to control the frequency of updates.
This project demonstrates the control of LED brightness using Pulse Width Modulation (PWM) in conjunction with potentiometers. By adjusting the potentiometer values, the intensity of the LED can be modified in real-time, with a smooth transition effect achieved through a delay mechanism of 500 ms. The implementation utilizes an Analog-to-Digital Converter (ADC) to read the potentiometer values and update the PWM duty cycle accordingly, making it an effective solution for LED intensity control in various applications. We control the intensity of an LED light using PWM (Pulse Width Modulation) and potentiometers, with a specified change delay of 500 ms.
- PWM Control: Utilizes two PWM modules to adjust LED brightness based on potentiometer values.
- Analog-to-Digital Conversion: Reads potentiometer values using ADC (Analog-to-Digital Converter).
- Real-time Adjustment: Changes LED brightness in real-time with a delay of 500 ms for smooth transitions.
- User-Friendly Interface: Simple setup using potentiometers for easy adjustment of brightness.
Figure 1 DC Motor Control (Left Rotate with Button) (Flowcode)
Figure 2 DC Motor Control (Right Rotate with Button) (Flowcode)
Figure 3 Automatic rotation to the left and right of the DC Motor (Flowcode)
Figure 4 Automatic rotation to the left and right of the DC Motor (Flowcode)
Figure 5 DC motor using Pulse Width Modulation (PWM) on the PIC16F877A microcontroller (Flowcode)
Figure 6 Intensity of the LED light using the PWM module and potentiometers (Flowcode)