Problem with 4N35 optocouplers

Hello

I am working on my first project which involves my Canon SLR being triggered by PIR Sensor. I started with an Arduino UNO which utilized 2 relays to operate the shutter and focus switch. Everything worked as intended.

I wanted to shrink my project down so i bought myself a NANO and decided on 2 4N35 optocouplers to do the job of the relays.

The problem i have is the 4N35's don't seem to be working.

Here's my schematic. This is a basic view of just the 4N35's with other, non-related, components left out:

When I check voltage on the outputs for the 4N35's I measure only 1v. I've tried using different outputs which made no difference.

Am i using the correct resistors? An Arduino tutorial for the 4N35 suggest 220 ohm, others have suggested 330 ohm.

Thanks for your time

Lawrence

Here's my BIGGER schematic

you wouldn't expect to measure voltage on the output side
try resistance instead!
make sure you know which way round your ohm-meter works
you want + to pin 5 and - to pin 6
when activated you should read very low resistance
when not - high resistance

if you do get polarity wrong, the low resistance won't be quite so low

220 or 330 on the input side is fine

Sorry for the confusion, I meant to say that im only getting 1v when i measure the nano outputs (D3, D4) when they should be 5v. The 4N35 outputs are high resisance (open circuit), as expected, and do not change when nano outputs fire.

OK, i've set up a LED circuit connected to the 4n35 output to test.

If i connect the 4n35 input to 5v supply LED lights up. This proves to me the 4n35 works.

If i connect the 4n35 input to my Nano digital out (3), when the pinout is activated nothing happens. I can measure voltage between Nano digital out and ground but i only get 1volt.

If i disconnect the 4n35 from digital out and again measure voltage between digital out and GND it goes back to 5v.

Can someone explain why output voltage of my nano digital out drops from 5v to 1v when it is connected to the nano digital out.

I feel like i doing something stupidly wrong. What is it?

  1. First, check that you have made the correct pinMode(pin, OUTPUT) calls in your sketch.

  2. Next, check the values of R1 and R2 with a multimeter. If they really are 220 ohm and you are setting the pni modes to OUTPUT, then when you write HIGH to them you should be getting nearly 5V at the output pin and 1V at the 4N35 input.

Are these SMD resistors? If so, 220 means 22 and no zeros, so that's 22 ohms. For a surface mount resistor, 221 means 220 ohms.

Otherwise, it sounds like perhaps a short somewhere in the wiring?

What happens if you replace the optoisolators and resistors with visible LEDs and different resistors?

dc42:

  1. First, check that you have made the correct pinMode(pin, OUTPUT) calls in your sketch.

This is it!

I checked my code, it turns out i had in my void setup for the related pins:

pinMode(focPin, LOW);
pinMode(shtPin, LOW);

I changed to:

pinMode(focPin, OUTPUT);
pinMode(shtPin, OUTPUT);

Now my test LED is working!! I thought using LOW or HIGH value would designate the pin an OUTPUT, at least it worked when i was using relays on my Uno.

Anyway, thanks for your help guys. Time to crack on!

Unless it's old topic i want to reply, because there is an error in pinout of 4N35. I've found this post in Google, made the same circuit and was curious about why it doesn't work... Correct pinout is: 6 = B, 5 = C, 4 = E.