user8769: I have a wire with a 0-5v current. I want to detect if the current is there or not (HIGH/LOW.)
I'm using an optocoupler to avoid putting too much current into my micro, as it is only a 3.3V micro. I'm nervous about powering this on as one of my other micros stopped working although it's not clear if it could have been the circuit? 

I could not find my optocoupler in fritzing. This is it:
http://www.amazon.com/gp/product/B00CGXK1RG?psc=1&redirect=true&ref_=oh_aui_detailpage_o07_s00
This is my plan.

The microcontroller is a spark/particle core 3.3v. It the yellow wire connects to the analog pin A6. The screw terminals connect to the wire with the 5v current that I'm trying to detect.
I based my circuit on this:

But I don't know if it will do the same thing.


user10794: Based on the revised information given above I present a different answer. Use the opto-coupler as shown here:
Your kettle LED will be in series with the optocoupler (note the polarity, not reversed like in your question).
If the LED is on the transistor in the PC817 will conduct and the Arduino pin will be LOW. If the LED is off the transistor will not conduct and the Arduino pin will be HIGH.

Note: The Arduino pin will be the reverse of the kettle LED.
I'm leaving the other answer there because I think it is a reasonable answer to the question of "detect a voltage".

user10794: Wouldn't this be simpler?

Note: amended answer increases R1 to 10 k.
The 10 k resistor limits current to 0.17 mA. The 3.3 V zener diode clamps the input voltage to 3.3 V (I measured 2.3 V on mine so that is well within spec). The other end of the zener diode goes to the Arduino ground pin.
I originally had R1 as 1 k however if you had a high voltage input (like 20 V) it didn't quite clamp the pin to 3.3 V (more like 3.8 V). This is a bit high for an input pin, so I tried 10 k instead. 
This gives:

For an input voltage of 5 V -> 2.3 V on the Arduino input
For an input voltage of 10 V -> 2.6 V on the Arduino input
For an input voltage of 20 V -> 2.9 V on the Arduino input
For an input voltage of 30 V -> 3.1 V on the Arduino input

This is all within spec for the Arduino.
Now the question is, will 2.3 V on the input pin register as HIGH? The answer is "yes" because high is considered to be 0.6 * VCC. 
3.3 * 0.6 = 1.98

Thus any voltage of 1.98 or above is considered HIGH, and it will successfully read 2.3 V as high.

8769: <p>I have a wire with a 0-5v current. I want to detect if the current is there or not (HIGH/LOW.)</p>

<p>I'm using an optocoupler to avoid putting too much current into my micro, as it is only a 3.3V micro. I'm nervous about powering this on as one of my other micros stopped working although it's not clear if it could have been the circuit? </p>

<p><img src="https://i.stack.imgur.com/hnbMR.jpg" alt="enter image description here">
I could not find my optocoupler in fritzing. This is it:
<a href="http://rads.stackoverflow.com/amzn/click/B00CGXK1RG" rel="nofollow noreferrer">http://www.amazon.com/gp/product/B00CGXK1RG?psc=1&amp;redirect=true&amp;ref_=oh_aui_detailpage_o07_s00</a></p>

<p>This is my plan.</p>

<p><img src="https://i.stack.imgur.com/aUsOB.jpg" alt="The microcontroller is a spark/particle core. It the yellow wire connects to the analog/digital pin A6. The screw terminals connect to the wire with the 5v current that I&#39;m trying to detect."></p>

<p>The microcontroller is a spark/particle core 3.3v. It the yellow wire connects to the analog pin A6. The screw terminals connect to the wire with the 5v current that I'm trying to detect.</p>

<p>I based my circuit on this:</p>

<p><img src="https://i.stack.imgur.com/sL3r6.jpg" alt="enter image description here"></p>

<p>But I don't know if it will do the same thing.</p>

<p><img src="https://i.stack.imgur.com/D1vAE.jpg" alt="enter image description here"></p>
 10794: <p>Based on the revised information given above I present a different answer. Use the opto-coupler as shown here:</p>

<p>Your kettle LED will be in series with the optocoupler (note the polarity, not reversed like in your question).</p>

<p>If the LED is on the transistor in the PC817 will conduct and the Arduino pin will be LOW. If the LED is off the transistor will not conduct and the Arduino pin will be HIGH.</p>

<p><img src="https://i.stack.imgur.com/D14NA.png" alt="enter image description here"></p>

<p>Note: The Arduino pin will be the reverse of the kettle LED.</p>

<p>I'm leaving the other answer there because I think it is a reasonable answer to the question of "detect a voltage".</p>
 10794: <p>Wouldn't this be simpler?</p>

<p><img src="https://i.stack.imgur.com/F7gdx.png" alt="3.3v voltage detector"></p>

<p><em>Note: amended answer increases R1 to 10 k.</em></p>

<p>The 10 k resistor limits current to 0.17 mA. The 3.3 V zener diode clamps the input voltage to 3.3 V (I measured 2.3 V on mine so that is well within spec). The other end of the zener diode goes to the Arduino ground pin.</p>

<p>I originally had R1 as 1 k however if you had a high voltage input (like 20 V) it didn't quite clamp the pin to 3.3 V (more like 3.8 V). This is a bit high for an input pin, so I tried 10 k instead. </p>

<p>This gives:</p>

<ul>
<li>For an input voltage of 5 V -> 2.3 V on the Arduino input</li>
<li>For an input voltage of 10 V -> 2.6 V on the Arduino input</li>
<li>For an input voltage of 20 V -> 2.9 V on the Arduino input</li>
<li>For an input voltage of 30 V -> 3.1 V on the Arduino input</li>
</ul>

<p>This is all within spec for the Arduino.</p>

<p>Now the question is, will 2.3 V on the input pin register as HIGH? The answer is "yes" because high is considered to be 0.6 * V<sub>CC</sub>. </p>

<pre><code>3.3 * 0.6 = 1.98
</code></pre>

<p>Thus any voltage of 1.98 or above is considered HIGH, and it will successfully read 2.3 V as high.</p>
