LED Blinking and LED intensity control if input signal is digital rectangular pulse

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeAa_335316
Level 4
Level 4
First like received

 I am developing one device where i need to turn on  LED when signal become high and turn off LED when signal become low .during the LED blinking i have to control the LED light intensity through push up/down botton or  (through capsence).

   

i have attached a jpg of my input signal which is for turn OFF and ON 10 times in 1 sec .

   

0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Then I would consider using a comparator (simplest) to detect level

   

and in turn in code use that to enable a PWM. When PWM active

   

use its compare value to control duty cycle, hence brightness of

   

LED.

   

 

   

Set PWM period so that it is ~ 100 Hz or more to avoid flicker in LED.

   

 

   

Note timer would work here as well. Or SSDM module, it will result in

   

better EMI reduction.

   

 

   

Regards, Dana.

View solution in original post

0 Likes
14 Replies