Project of tactile lamp - Advice before to go

Hello,

I am building my first project : a tactile lamp.

Principle : the lamp has 3 lighting modes :

  • Reading mode (3 Leds to read the book)
  • Night mode (9 Leds close to the floor)
  • Full mode (27 Leds to light the room)

Each of the mode is lighted up with a specific tactile touch (so 1 touch per mode => 3 touching areas).

The lamp is supplied with the mains (220V AC) and the Arduino is controling linked to the touch sensor to light on/off the specific lighting mode needed.

I am using 3 optocouplers MOC3023 linked with 3 triac BTA16-600BW to switch on/off to control the 220V of the 3 LED circuits with the Arduino 5V.

In attachment is the electrical schema with the components characteristics.

My questions :

  • How to calculate the resistance (identified "R" in the electric schema) for each of the LED circuit?
  • Do you see mistakes in my schema?

Thanks a lot for your feedback!

Romaaaaaaaain:
My questions :

  • How to calculate the resistance (identified "R" in the electric schema) for each of the LED circuit?
  • Do you see mistakes in my schema?

What DC voltage do you expect to get from the bridge rectifier?
Remember that you will get approx. 1.4 times as much DC voltage as the AC voltage you input.
What type of LEDs are you using (voltage & current)?
Why are you using triacs to control a DC current?
Triacs are usually used to control AC. A (power?) transistor will do the same job with DC.
A better method would be to use a transformer to step down the voltage to a safe level.
LEDs can be fed with low voltage AC, but they will only light for 50% of the time. At 50 or 60 Hz, there will be no noticeable flicker.

The triac coupled with the capacitor across the bridge rectifier will ensure that once the LEDs are turned on you will never be able to turn them off again without unplugging the mains.

Thanks for your feedback Mike and Henry.

The AC voltage is 220V so I would say 1,4*220=308V.

THE LED are 3,6V / 25mA => Max 225mA (25x9) on the 9 Led branch.

That's true for the Triac... Not needed! I think to switch to a Mosfet IRF520 from the Arduino kit.

I wanted to avoid to use the transformer because of the space needed for it. May be as a first project it is better.

So as conclusion I could :

  • use the transformer 220V=>12V
  • remove the bridge rectifier
  • replace the Triac with Transistor IRF520
  • add diodes 1N4001 to protect the LED from reverse current

Remaining questions :

  • Is the mosfet IRF520 adapted? (Datasheet : http://www.arduino.cc/documents/datasheets/MOS-irf520npbf.pdf)
  • What is the resistance R needed to protect the LEDs?
  • Is the diode strong enough? (Datasheet : http://www.arduino.cc/documents/datasheets/1n4007.pdf) I guess yes since Vrrm = 50V but I would appreciate feedback :slight_smile:
  • @Mike : I will remove the triac so the problem will be solved but for my knowledge : I was thinking that, removing the input on Triac trigger from the optocoupler, the Triac would be "open" and stop to light the LED. Even if the capacitance is there. Why the capacitance would bring this effect and keep the triac closed? The capacitance is not connected to the Triac trigger.

Hi,
Can you explain how your press buttons work?

Your method of mains voltage to LED supply is very dangerous, you need to use a transformer or an off the shelf mains to DC power supply.

What is your electronics, programming, arduino, hardware experience?

Tom.... :slight_smile:

For the press button I use a capacitive sensor with the library "CapacitiveSensor" from Arduino and then my program manages to light the leds through the optocouplers. The software works on the low voltage from Arduino but it is not sufficient to light a room. That's why I am try to plug it with 220V (and now 12V to avoid the safety risks).

For now, and based on the previous comments, I am here :

  • use the transformer 220V=>12V
  • remove the bridge rectifier
  • replace the Triac with Transistor IRF520
  • add diodes 1N4001 to protect the LED from reverse current

Remaining questions :

  • 21 LEDs of 3,6V : will the 12V supply enough??
  • Is the mosfet IRF520 adapted? (Datasheet : http://www.arduino.cc/documents/datasheets/MOS-irf520npbf.pdf)
  • What is the resistance R needed to protect the LEDs?
  • Is the diode strong enough? (Datasheet : http://www.arduino.cc/documents/datasheets/1n4007.pdf) I guess yes since Vrrm = 50V but I would appreciate feedback :slight_smile:
  • @Mike : I will remove the triac so the problem will be solved but for my knowledge : I was thinking that, removing the input on Triac trigger from the optocoupler, the Triac would be "open" and stop to light the LED. Even if the capacitance is there. Why the capacitance would bring this effect and keep the triac closed? The capacitance is not connected to the Triac trigger.

I was thinking that, removing the input on Triac trigger from the optocoupler, the Triac would be "open" and stop to light the LED. Even if the capacitance is there. Why the capacitance would bring this effect and keep the triac closed?

Once a triac switches on through a trigger pulse it stays on even when the trigger pulse is removed. It stays on until the current through the triac drops below a critical value. This normally means when the voltage across the triac drops to zero. By having a capacitor across the bridge rectifier this keeps up the voltage or smooths it in the periods where it would otherwise drop to zero.

21 LEDs of 3,6V : will the 12V supply enough??

No. 21 * 3.6 = 75.6V so you will not be able to light them.

What is the resistance R needed to protect the LEDs?

R = (Vin - Vled ) / 0.02
This assumes 20mA LED current. Where Vin is the total voltage applied and Vled is the total of the forward voltage drops of the LEDs.

Is the diode strong enough?

As you say a 1N4000 is 50V reverse where as the 1N4007 is 1000V

Is the mosfet IRF520 adapted?

Sorry don't know what you mean by that.

Grumpy_Mike:
No. 21 * 3.6 = 75.6V so you will not be able to light them.

My project is finally divided in 3 LEDs branches in parallel :

  • 2 branches of 9 Leds => 9*3,6 = 32,4V for each of these branch
  • 1 branch of 3 Leds => 3*3,6 = 10,8V

=> Shouldn't I consider that a 40V supply is enough to supply the strongest LEDs (and therefore also the weakest)? Then I would add the proper resistances based on the quantitiy of LEDs in each branch ?
=> If thiw works, is a 220V=>40V transformer easy to find?

Grumpy_Mike:
R = (Vin - Vled ) / 0.02
This assumes 20mA LED current. Where Vin is the total voltage applied and Vled is the total of the forward voltage drops of the LEDs.

Based on my comment here upper, and based on the 0,025A from LEDs datasheet :

  • For my branches of 9 LEDs : R = (40-9*3,6)/0,025 = 304 Ohms
  • For my branch of 3 LEDs : R = (40-3*3,6)/0,025 = 1168 Ohms
    => Correct?

My project is finally divided in 3 LEDs branches in parallel :

Note that each parallel branch will need its own resistor.

Those calculations look right for the value.
Note the resistor will burn I2R watts of power.

So that is 0.19W for the 304 Ohm and 0.73W for the 1168 Ohm so the normal 0.25W resistor will not do for the second one.

is a 220V=>40V transformer easy to find?

A lot harder than it used to be. Note that if you get a transformer with a 40V RMS output the voltage once you smooth it will be 56V.

So :
0,19W for the 304 Ohms resistances
0,73W for the 1168 Ohms resistance
=> To be adapted to the standard resistance I will find

Grumpy_Mike:
Note that if you get a transformer with a 40V RMS output the voltage once you smooth it will be 56V.

If I find a 220V AC=>40V DC transformer (so I don't need anymore the rectifier bridge), would it still be 56V at the output?

Thanks a lot Mike for your advices.

If I find a 220V AC=>40V DC transformer (so I don't need anymore the rectifier bridge),

Then it would break the laws of physics because no such thing can exist.

You might find a power supply that gives you 40V DC output but that is not a transformer.

Note the resistor power rating you use has to be greater than the power you hope to dissipate so the 0.73W resistor should be at least a 1W job.

Well.... It seems very difficult to find this 40V power supply...

From your point of view, what would be the best option to get the final result of 9+9+3 LEDs 3,6V / 0,25mA?...

I was trying to adapt the schema here after : http://www.electroschematics.com/3623/ac-powered-white-led-lamp/

From your point of view, what would be the best option to get the final result

It would be to get a power supply with the highest voltage you can get cheaply and then design as many LEDs in series as that voltage will support.

I guess here comes the grumpy Mike

The AC voltage is 220V so I would say 1,4*220=308V.

What do you think will happen to the 25V electrolytic capacitor in your circuit when 308V is put across it?

  • add diodes 1N4001 to protect the LED from reverse current

A LED is a Light Emitting DIODE.
As long as the reverse voltage doesn't exceed the forward voltage, there is no need for another diode.
In an AC circuit the forward and reverse voltages are exactly the same.

30V AC, when rectified, will give you about 42V DC (with no load). The load from the LEDs is only 20mA, so shouldn't reduce it by any noticeable amount. That should be sufficient for your needs.

Henry_Best:
What do you think will happen to the 25V electrolytic capacitor in your circuit when 308V is put across it?

I guess I will get some sparkles :slight_smile:

Henry_Best:
A LED is a Light Emitting DIODE.
As long as the reverse voltage doesn't exceed the forward voltage, there is no need for another diode.
In an AC circuit the forward and reverse voltages are exactly the same.

Are you sure? When I go to the datasheet, it is written "Maximum reverse voltage = 5V" (http://www.produktinfo.conrad.com/datenblaetter/175000-199999/180000-da-01-en-LED_18000_MCD_20GRAD_5MM_WEISS.pdf).

Henry_Best:
30V AC, when rectified, will give you about 42V DC (with no load). The load from the LEDs is only 20mA, so shouldn't reduce it by any noticeable amount. That should be sufficient for your needs.

Sounds good... I found this 48V DC / 520 mA / 25W power supply (i didnt find a 30V) : https://www.conrad.de/de/steckernetzteil-festspannung-mean-well-gs25e48-p1j-48-vdc-520-ma-25-w-1294218.html
=> All the rectifier/capacitor would not be needed any more... Would be great.

I updated my schema based on the discussions :

Hi,
Check your MOSFET, its N-Ch, you have your circuit configured as P-Ch, also mark + and gnd for your 48Vdc.
I don't think it is logic level gate either.

Tom.. :slight_smile:

960 Ohms => 1 MOhms / 0,25W

No.
The closest resistor to 960R is 910. The next one higher is 1K. If you put 20mA through a 1M resistor it would dissipate 400 W.

Romaaaaaaaain:
Are you sure? When I go to the datasheet, it is written "Maximum reverse voltage = 5V"

Hopefully, the forward voltage across each LED will be 3.2V, so the reverse voltage across each LED in an AC circuit will also be 3.2V.
3.2V is less than the 5V Max., but I see you're going with a DC supply.
NB. 1000 Ohms is 1K Ohm, not 1M Ohm (k = 1000, M = 1,000,000).

Grumpy_Mike:
No.
The closest resistor to 960R is 910. The next one higher is 1K. If you put 20mA through a 1M resistor it would dissipate 400 W.

It would keep him warm, though. :fearful: