voltage divider stumped

so i am trying to use the 5V siginal from an arduino nano to supply a voltage divider to drop the voltage down for an optocoupler. I've done the math and i need a 30K resistor and an 11k resistor. For whatever reason i'm getting mV out. Iv used my multi-meter to probe around and check resistance and for something pretty basic i'm lost.

does the arduino have something to do with this problem?

draw the schematic on a blank sheet of printer paper, take a photo and post it.

Assuming 30 + 1 dropper on the output you will get 160mV across the 1k resistor IF there is no further load However if there is any load applied across the 1k resistor then its effective value in the dropper chain decreases and so does the voltage across it.

As previously poster stated, provide a sketch of your circuit (not a picture or drawing of breadboard and components)

image attached

WHAT I/O ?

ive tried 12 and 4 and even just the 5v pin

With the 15Ks,10K, and 1K, the voltage should be right: 5V * (10000 + 1000)/(10000 + 1000 + 15000 + 15000) = 1.34V

What does that have to with an optocoupler tho? Optocoupler is just an LED, use a 220 ohm resistor in series with the optocoupler's LED to drive ~ 20mA thru it and turn on the output resistor.

says that the max input voltage is 1.35 typical for the optocoupler

Make sure you have pinMode (pinX, OUTPUT); as well, otherwise you won't get much current from an IO pin, it'll be like driving the pin thru a 30K resistor: 5V* (10000 + 1000)/(10000+1000 +15000+15000+30000) = 0.77V

Ok, so with the MAX voltage across the LED, and 20ma of current thru it, then the lowest resistance allowed is: (5V - 1.35V)/.02 = 182.5 Ohm

Got a part number or link to a datasheet?

http://www.farnell.com/datasheets/2050347.pdf?_ga=1.59674283.76820634.1419876783

says that the max input voltage is 1.35 typical for the optocoupler

In practice, you provide the correct current and the voltage "falls into place". And with regular-small LEDs, you simply limit/control the current with a resistor.

LEDs including the one inside the opto-isolator are diodes and they are non-linear. That means their resistance changes when the voltage changes.

Below the diode's forward "breakdown voltage" the resistance is high and very little current flows. Above the breakdown voltage (operating voltage for an LED) the resistance falls to a very small value. If you don't somehow limit the current the diode (or LED) will burn-out.

A resistor in series with an LED is a voltage divider, but the LED's resistance changes with the voltage and when everything is working properly, the LED becomes a "constant voltage" part. That means the remaining voltage is dropped across the resistor, and we can calculate the current through the resistor (same as the current through the LED) by using Ohm's Law.

See, page 3 shows characteristics with If or 5, 10, 20mA. Use 220 as I suggested, LED side wired per upper left of sheet 4. What is your load? Collecting emitter to Gnd and the collector to your load, like the - of an LED strip, may make more sense.

long run a 12V mag or mech lock will be the load.

so why then does it say 1.35 is the typical max voltage?

11Trevor11:
long run a 12V mag or mech lock will be the load.

so why then does it say 1.35 is the typical max voltage?

Diodes can be very roughly modeled as a constant voltage load, meaning that you measure the same voltage across it no matter how much (or little) current is flowing through it. It is far from perfectly accurate, but for the ways LEDs are used it is usually good enough. 1.35V is the typical value of that voltage load for the optocoupler’s LED, when the forward current is 60 mA.

Because the model’s I-V characteristic is infinite (current can change infinitely with no change in voltage), an external component is necessary to restrict current. The crudest method is a resistor, though higher power applications (such as for illumination instead of indication) may use a more sophisticated current regulation circuit.

By consequence of Kirchoff’s Current Law (algebraic sum of all voltages in a loop is zero), you get the following equation with a resistor:

5V - IfR - 1.35V = 0

From there, simple algebra will allow you to choose an If value and calculate the resistor you need to get that. Or choose an R value and calculate the resulting If.

"long run a 12V mag or mech lock will be the load."

So why is the optocoupler needed? Just use an N-channel MOSFET to sink current thru the device's coil to turn it on.

well currently we use a THP 120 ( but for some reason are having problems with them getting to hot when the mag lock is on for a long period of time. so im just exploring other possibilities besides a relay, module.

Use a better transistor, or use the transistor to drive a relay coil to drive the larger devices. Part like AOI510 with .004ohm Rds at Vgs of 4.5V will remain cool, dissipating just 100mW with a 5A load for example: Pdissipation = I*I*Rds, 5A * 5A * .004ohm = 0.1W http://www.digikey.com/product-detail/en/alpha-omega-semiconductor-inc/AOI510/785-1487-1-ND/3603498

A darlington transistor, like the TIP120, has a high saturation voltage. That makes it hot.

As CrossRoads said, use a logic level mosfet. I assume you already have a diode across the solenoid. Leo..