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

  • Help please! BLDC driver circuit using the IR2136s and the STP80NF06 MOSFETS November 8, 2025
  • need two ICs November 8, 2025
  • MLT-8530 Buzzer on ESP32: Why Is the Sound Output Lower Than Expected? November 8, 2025
  • Scope Clock CRT Z-Axis - Grid bias positive? November 8, 2025
  • Measuring controller current output with a meter November 8, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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