EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / very goodPWM gives variable

very goodPWM gives variable

|

Microcontroller › 8051 › STREET LIGHT THAT GLOWS ON DETECTING VEHICLE MOVEMENT › very goodPWM gives variable

May 18, 2014 at 12:19 pm #11743
Ashutosh Bhatt
Participant

very good

PWM gives variable DC output. the equation for PWM output is

   Vcc * Ton / Ttotal

for example if Ton is 50% of Ttotal then output is Vcc / 2

similarly if Ton is 25% – output is Vcc / 4 like wise

 

so avg DC output varies as pulse width varies.

 

if this voltage is applied to LED (any DC operated device) its intensity varies.

 

generating PWM is very simple. if your controller does not have built in PWM channel then you can do this

 

take two time variables Ton and Toff.

make one delay subroutine that gives delay as per value passed of Ton or Toff

set any one pin of microcontroller to 1

give delay for Ton time

reset that pin to 0

give delay for Toff time

 

now just change Ton and Toff values like to increase pulse width increase Ton and same time decrease Toff by same value e.g. Ton+=5 and Toff-=5;

 

 

RSS Recent Posts

  • Battery discharger May 20, 2026
  • Relay question May 19, 2026
  • Phone Charger 5v to 12v May 19, 2026
  • reviving old swordfish program but? May 18, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 18, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise