Skip to content

🌳 A PWM-powered arduino project that smoothly controls LED brightness and servo motor position using a potentiometer

License

Notifications You must be signed in to change notification settings

pythonicforge/thor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PWM-Controlled LED & Servo Using Potentiometer πŸŽ›οΈβœ¨

Project Overview

This Arduino project demonstrates Pulse Width Modulation (PWM) by controlling the brightness of an LED and the position of a servo motor using a potentiometer. As you turn the potentiometer knob, the LED smoothly dims or brightens, while the servo motor rotates accordingly.

How It Works

  • The potentiometer reads an analog input (0–1023) from pin A0.
  • The analog value is mapped to two ranges:
    • 0–255 for LED brightness (PWM output to pin 10).
    • 0–180Β° for servo motor rotation (signal to pin 9).
  • The analogWrite() function adjusts LED brightness.
  • The servo.write() function moves the servo.

Circuit Connections

  • Potentiometer:
    • Left pin β†’ GND
    • Middle pin β†’ A0 (Analog Input)
    • Right pin β†’ 5V
  • LED:
    • Anode (+) β†’ Pin 10 (via resistor)
    • Cathode (–) β†’ GND
  • Servo Motor:
    • VCC (Red) β†’ 5V
    • GND (Black/Brown) β†’ GND
    • Signal (Yellow/Orange) β†’ Pin 9

Demo (Tinkercad Simulation)

πŸ”— View the Project Simulation

Future Improvements

  • Add an OLED display to show live PWM and servo angle values.
  • Use a button to toggle between different PWM modes.

License

This project is open-source and available under the MIT License.

About

🌳 A PWM-powered arduino project that smoothly controls LED brightness and servo motor position using a potentiometer

Topics

Resources

License

Stars

Watchers

Forks

Languages