go_away

Author Topic: LED Fade In/Out wrt Input Signal? No MCU  (Read 339 times)

0 Members and 1 Guest are viewing this topic.

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
LED Fade In/Out wrt Input Signal? No MCU
« on: May 29, 2014, 06:41:13 AM »
Hey all,

I want to make a very simple circuit that uses the analog output of a force sensor to make an LED change it's brightness (fade in/out) wrt the amount of force applied. I know how to easily do this with an Arduino and PWM but using a MCU seems like overkill. Google hasn't been much help since most results are for timed fading using a 555 timer or using an Arduino.

Been racking my brain all week trying to think of a way to do this. Anyone have any suggestions?

Thanks!

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: LED Fade In/Out wrt Input Signal? No MCU
« Reply #1 on: May 29, 2014, 10:50:22 AM »
What is the "timing" part? Could you draw a diagram of the expected input and output values you want?

The easiest might be to feed the base of a BJT from the force sensor, with an appropriate resistor and capacitor to generate an RC filter to apply time delay, and have that BJT control the brightness of the LED.

However, small MCUs are 50 cents, and even "big" MCUs like the ATTiny85 are less than $2. I would just drop one in; problem solved!

Offline OcelotTopic starter

  • Jr. Member
  • **
  • Posts: 45
  • Helpful? 0
Re: LED Fade In/Out wrt Input Signal? No MCU
« Reply #2 on: May 29, 2014, 11:45:57 AM »
What is the "timing" part?
The Google results that used a timer were for pulsing LEDs like without respects to an input signal (e.g. like the twinkle mode of Xmas lights). I do not want this. I want the LEDs to brighten/fade in response to external signal.

Could you draw a diagram of the expected input and output values you want?
Input = analog signal (0-Vs); Output = LED brightness that changes in response to the input voltage level. I think I've read that our eyes percieve LED brightness in exponential levels rather than linear so a exponential/logarithmic mapping between the input and output would probably be ideal.

The easiest might be to feed the base of a BJT from the force sensor, with an appropriate resistor and capacitor to generate an RC filter to apply time delay, and have that BJT control the brightness of the LED.

However, small MCUs are 50 cents, and even "big" MCUs like the ATTiny85 are less than $2. I would just drop one in; problem solved!


I don't want to use MCUs =) The cost isn't the problem; it's the fact that you have to program them.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: LED Fade In/Out wrt Input Signal? No MCU
« Reply #3 on: May 29, 2014, 12:20:06 PM »
So, if you need no timing delay, they all you want is to control the brightness of a LED based on an analog input signal.
This is what BJTs are for.
Get a 2N2222, a suitable base current resistor, and a suitable collector current limiting resistor, and you should be golden.
I'd start with a 10 kOhm base resistor and a 470 ohm collector/LED resistor, and tune from there.

 


Get Your Ad Here

data_list