Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 08:08:01 20:08


Login with username, password and session length


Pages: [1]
Print
Author Topic: Connecting Blue LED to ARM32 3V microcontroller  (Read 959 times)
0 Members and 1 Guest are viewing this topic.
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« on: November 03, 2015, 09:33:27 09:33 »

I want to connect one moc3021 internal led and one blue led (vf >= 3.35v ) in series + one resistor for current limiting to ARM32 3V microcontroller
The microcontroller pin is not 5V tolerant so is there any failure occur by connecting with my method.
Please check the attached schematic.
Logged
UncleBog
Junior Member
**
Offline Offline

Posts: 86

Thank You
-Given: 107
-Receive: 136


« Reply #1 on: November 03, 2015, 10:22:45 10:22 »

The combined VF of the LEDs is 1.5 + 3.35 = 4.85 V so the 75R resistor will limit IF to 0.15 / 75 = 2 mA. In order to turn on the triac the current in the optocoupler LED needs to exceed 15 mA so you need a lower value resistor. The LED forward voltages will vary a bit so having them in series and having a small voltage left to drop across the resistor makes it difficult to choose a resistor value that will reliably yield 20 mA.

To answer your question; the micro's port will not be driven over 3V3, however have you checked that it can sink 20 mA ?
Logged
motox
Active Member
***
Offline Offline

Posts: 113

Thank You
-Given: 142
-Receive: 129



« Reply #2 on: November 03, 2015, 11:50:22 11:50 »

Connecting different leds in series doesn’t seem a good idea, because they work at different currents.
Connect individual current limiting resistors on both leds and place them in parallel. Use an external transistor (NPN or N-FET) on the negative side.
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #3 on: November 03, 2015, 12:36:42 12:36 »

I measured VF of MOC3021 LED is 1.07 V and blue led vf = 3.2 v so total 4.27v
by using 75R resistor it will flow approx 9.733ma and its sufficient to drive moc3021 as per it's datasheet.

Now my main concern is that if I connect all these design to 3V tolerant microcontroller pin will it damage the pin ?
Logged
UncleBog
Junior Member
**
Offline Offline

Posts: 86

Thank You
-Given: 107
-Receive: 136


« Reply #4 on: November 03, 2015, 01:22:36 13:22 »

Whilst a particular MOC3021 may turn on with IF = 10 mA the data sheet specifies IF >= 15 mA to guarantee turn on (I've checked TI and Fairchild). The Fairchild version of the data sheet makes this clear with Note 2 below the Transfer Characteristics section. If your design is a 'one off' and your MOC3021 switches on with IF = 10 mA then that should be fine, however if you build a number of similar circuits like this then it's likely that some won't work properly. Also the transfer ratio of opto-couplers reduces with age so it makes sense to add a little IF margin to allow for this.
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #5 on: November 03, 2015, 01:32:02 13:32 »

Ok I will change resistor value to 33R that gives approx 22 ma

and what about microcontroller pin damage issue ?
Logged
UncleBog
Junior Member
**
Offline Offline

Posts: 86

Thank You
-Given: 107
-Receive: 136


« Reply #6 on: November 03, 2015, 02:58:22 14:58 »

As I said in my first reply (#1) the micro' pin won't be driven over-voltage by the LED string but you should check that the pin can sink > 22 mA.

My point regarding variation in VF due to manufacturing spread is still valid though.

For the case where the LED VFs are both low, say 1.2 V and 3.2 V then the voltage across the resistor is 5 - (1.2 + 3.2) = 0.6 V and 33R will set IF at 18 mA, however is both VFs are high, say 1.5 V and 3.35 V then the voltage across the resistor is 0.15 V and IF is 4.5 mA.

You can make IF less dependent on VF by dropping more volts across your current limiting resistor, to do this you'd should consider putting the LEDs (each with a resistor) in parallel as motox suggested. This allows you to set each LED current separately but will increase the overall current requirement such you may need two micro' outputs (if you have spare), or one output and two transistors.
Logged
CocaCola
V.I.P
Senior Member
*****
Offline Offline

Posts: 397

Thank You
-Given: 108
-Receive: 182


« Reply #7 on: November 03, 2015, 10:59:34 22:59 »

This allows you to set each LED current separately but will increase the overall current requirement such you may need two micro' outputs (if you have spare), or one output and two transistors.

Why two transistors?  One should suffice unless I'm missing something?
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #8 on: November 04, 2015, 06:50:03 06:50 »

I have simulated circuit in proteus it shows approx 4.36 Volt appear on microcontroller pin and it's higher then pin's max allowed high voltage level so it's not suitable for 3 v tolerant microcontroller pin
Logged
UncleBog
Junior Member
**
Offline Offline

Posts: 86

Thank You
-Given: 107
-Receive: 136


« Reply #9 on: November 04, 2015, 07:36:32 07:36 »

In your schematic you have the MOC3021 triac in your circuit rather than the LED.

CocaCola is right, I should have written 'or one output and a transistor'.

Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #10 on: November 04, 2015, 07:45:35 07:45 »

Oh... Sorry...!!!

I have updated in the simulation now it produce 4.24 v at port pin that is till higher for 3V tolerant microcontroller pin
Logged
UncleBog
Junior Member
**
Offline Offline

Posts: 86

Thank You
-Given: 107
-Receive: 136


« Reply #11 on: November 04, 2015, 09:13:33 09:13 »

In your circuit IF is zero so the LED VFs will be very low, hence the 4.24 V you're seeing at the voltmeter, as soon as you draw a small current through the LEDs their VFs will rise sharply and the voltmeter reading will fall. Since your micro' pin is not 5V tolerant I've assumed that it has an internal ESD clamp diode to the 3V3 rail. If added to your circuit this diode will allow sufficient current to flow through the LEDs to increase their VFs and reach equilibrium with the clamp diode at 3V3 (due to the low current the clamp diode VF will also be small). The IF current required to do this is tiny, much less than a uA.

If your micro' pin doesn't have an ESD clamp diode then you could add an external Schottky diode clamp, or a transistor buffer as previously suggested.
Logged
vern
Junior Member
**
Offline Offline

Posts: 62

Thank You
-Given: 7
-Receive: 10


« Reply #12 on: November 04, 2015, 03:19:38 15:19 »

The ARM pin probably has an ESD clamp diode to your VCC 3V, if the output is high there will be a small current flowing through the clamp diode into your VCC.
You can figure it out pretty simple by connecting your optocoupler and your LED to the VCC 3V source with a small diode (like 1N4148).
This way you can check the current that would flow into your ARM pin in the "off" state.
Just check the database for maximum allowed input current.
You should also check if this current is low enough that your optocoupler is really tuning off.
The cleanest solution of course is a transistor with the optocoupler and the led in  parallel with a separate resistor each.
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #13 on: November 05, 2015, 11:17:34 11:17 »

I have simulated circuit by adding 4148 and BAT46 as diode clamp

Now it's voltage is microcontroller's pin MAX allowed voltage range.

Logged
vern
Junior Member
**
Offline Offline

Posts: 62

Thank You
-Given: 7
-Receive: 10


« Reply #14 on: November 05, 2015, 10:39:29 22:39 »

looks good, and the current is so small it won't cause any problems. It will be more though if the circuit gets warm, but I don't see any problems.
Logged
Kombinator
Junior Member
**
Offline Offline

Posts: 67

Thank You
-Given: 20
-Receive: 26


« Reply #15 on: November 07, 2015, 12:40:12 12:40 »

The optimum Res for the scheme is R = 210om. for 8mA.
How strong will light diode ....?
« Last Edit: November 07, 2015, 01:05:40 13:05 by Kombinator » Logged
vern
Junior Member
**
Offline Offline

Posts: 62

Thank You
-Given: 7
-Receive: 10


« Reply #16 on: November 07, 2015, 05:32:43 17:32 »

The data sheet for the MOC3021 shows the trigger input current as typical 8mA, however the maximum is 15mA, therefore the device might not turn on depending on the necessary current.
You should buy the MOC3022 (typ. 5mA, max 10mA)  or MOC3023 (typ. 3mA, max 5mA)
The blue LED will probably be bright enough, depends on the type of diode.
Logged
bobcat1
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 1126
-Receive: 29


« Reply #17 on: November 08, 2015, 09:25:20 09:25 »

Why not simply drive an NPN or MOSFET transistor who will drive the BLUE led and the MOC3021 with the necessary current and voltage?
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #18 on: November 09, 2015, 10:57:46 10:57 »

Why not simply drive an NPN or MOSFET transistor who will drive the BLUE led and the MOC3021 with the necessary current and voltage?

I do not want to use any external transistor. It also makes circuit smallest and very less part count.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC