Go Down

Topic: General interfacing advice using optocouplers (Read 1 time) previous topic - next topic

dtokez

Hi, thanks for the reply's.

Thanks for the detailed advice Lefty! I will try that :) Should I use resistors on the arduino digital pins also? If it is written HIGH via the internal pull ups and I ground the pins, how much current would flow? I know the pins supply about 30mA but how much would it sink?

Apparently the 13V output from the alarm can supply up to 200mA so I plan to run the arduino & ethernet shield from that. Would you simply run 13V into the Vin or step it down first?

Thanks!

retrolefty


Hi, thanks for the reply's.

Thanks for the detailed advice Lefty! I will try that :) Should I use resistors on the arduino digital pins also? If it is written HIGH via the internal pull ups and I ground the pins, how much current would flow? I know the pins supply about 30mA but how much would it sink?

No need for any external resistors for the digital input pins. The internal pullups are like 40K to 50K ohms, so very little current flows when the output transistor of the opto conducts to ground.

Output pins can sink current to an external circuit when they are commanded to a LOW state and can source current to an external circuit when commanded to a HIGH state. But an input pin is just a very high (many megohm) input sensing pin that draws no current to speak of from what ever is supplying voltage to the pin.

So lesson here is that output pins and input pins are two totally different animals on a arduino board. Most of the rules and limits for output pins are different then the rules for input pins, but both do have rules and limits of course.


Apparently the 13V output from the alarm can supply up to 200mA so I plan to run the arduino & ethernet shield from that. Would you simply run 13V into the Vin or step it down first?

I suspect not as ethernet boards are somewhat current hungry as I recall, but don't know directly. The basic Uno type arduino board draws about 50ma, so add that to whatever the ethernet shield requires plus anything else you are wiring to the arduino board like leds, etc and see what the total works out to.

Thanks!

Zapro





So that's 13V -1,25V = 11,75 / 0,03 = 391

So yes, 390 Ohms are perfect ;-)

// Per.


No it's not, it will burn up the output pin of the alarm module that has a 10ma maximum rating.


Sorry, my bad ;-(

LarryD

I have to visualize, getting to old.
I would definitely lower the voltage from 13 Volts so as to keep the Arduino regulator cool.
Note: lowest Vin is 7 Volts for the Arduino regulator to work.
The way you have it in your schematic isn't the same as how you have it wired up!

retrolefty

That R? 4.7k ohm resistor is really not required, just enable the internal pull-up resistor for the input pin being wired to.

pinMode(Pin#, INPUT_PULLUP);

Go Up