Keep losing arduinos with optocoupler input

Cannot figure it out. Out of 100 devices or so, about 4 of them just died for some reason.

Here is the opto section of the circuit.

OPTP is representing the opto coupler.

I’m using the TLP621

lmnopqrs:
Cannot figure it out. Out of 100 devices or so, about 4 of them just died for some reason.

Clearly not the optocoupler then.

You are powering them with a well-regulated 5 V supply are you not? Not something foolish such as using “Raw” or “Vin”. :cold_sweat:

Paul__B: Clearly not the optocoupler then.

+1

Some tips though. 22mA trhough the opto LED and only switching 0.5mA is rather crude. 1mA should be more than enough. Can replace the 470ohm resistor with a 4k7 or 10k resistor.

The pull up resistor can go if you enable internal pull up with pinMode. pinMode(optoPin, INPUT_PULLUP);

Are you sure the 'pulse' is long enough for the opto, and to discharge that 47n cap. Could also remove that cap, and 'fix' things with code. Leo..

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .

  • What is the application?
  • What is model Arduino?
  • What are you using for a power supply to the Arduino?

Thanks… Tom… :slight_smile:

|500x261

based on the drawing, there is full and complete isolation.

did you tie any wires together ? grounds or any other lines ?

Automotive environment.

Paul__B: Clearly not the optocoupler then.

You are powering them with a well-regulated 5 V supply are you not? Not something foolish such as using "Raw" or "Vin". :cold_sweat:

Hey Paul, the power is from the USB itself.

Wawa: +1

Some tips though. 22mA trhough the opto LED and only switching 0.5mA is rather crude. 1mA should be more than enough. Can replace the 470ohm resistor with a 4k7 or 10k resistor.

The pull up resistor can go if you enable internal pull up with pinMode. pinMode(optoPin, INPUT_PULLUP);

Are you sure the 'pulse' is long enough for the opto, and to discharge that 47n cap. Could also remove that cap, and 'fix' things with code. Leo..

I tried up to 1K and it worked, the 4k didn't. The datasheet showed 15ma as the typical current for the LED in the opto, and 50ma as the max. I might just go back to the 1K, but unsure if it would affect higher speed readings.

About the cap, I tried to fix it with code as well, but seems some static or stray current gets into the opto and triggers the transistor, cap filters it out.

I currently have both the Input pullup and the 10K pullup. I'm wondering if it's any at all possible the mechanism behind the Input_pullup could harm the pin due to the number of pulses this thing would see?


TomGeorge: Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html .

  • What is the application? Automotive
  • What is model Arduino? Nano 328p
  • What are you using for a power supply to the Arduino? USB [/list]

Thanks.. Tom... :)


dave-in-nj: |500x261

based on the drawing, there is full and complete isolation.

did you tie any wires together ? grounds or any other lines ?


Thanks. I have to ensure nothing gets grounded in the high voltage side, so I feel confident I didn't ground anything.

Automotive environment.

Paul__B: Clearly not the optocoupler then.

You are powering them with a well-regulated 5 V supply are you not? Not something foolish such as using "Raw" or "Vin". :cold_sweat:

Hey Paul, the power is from the USB itself.

Wawa: +1

Some tips though. 22mA trhough the opto LED and only switching 0.5mA is rather crude. 1mA should be more than enough. Can replace the 470ohm resistor with a 4k7 or 10k resistor.

The pull up resistor can go if you enable internal pull up with pinMode. pinMode(optoPin, INPUT_PULLUP);

Are you sure the 'pulse' is long enough for the opto, and to discharge that 47n cap. Could also remove that cap, and 'fix' things with code. Leo..

I tried up to 1K and it worked, the 4k didn't. The datasheet showed 15ma as the typical current for the LED in the opto, and 50ma as the max. I might just go back to the 1K, but unsure if it would affect higher speed readings.

About the cap, I tried to fix it with code as well, but seems some static or stray current gets into the opto and triggers the transistor, cap filters it out.

I currently have both the Input pullup and the 10K pullup. I'm wondering if it's any at all possible the mechanism behind the Input_pullup could harm the pin due to the number of pulses this thing would see?


TomGeorge: Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html .

  • What is the application?
  • What is model Arduino?
  • What are you using for a power supply to the Arduino?

Thanks.. Tom... :)


dave-in-nj: |500x261

based on the drawing, there is full and complete isolation.

did you tie any wires together ? grounds or any other lines ?


Thanks. I have to ensure nothing gets grounded in the high voltage side, so I ensure I didn't ground anything.

Automotive environment....

Hey Paul, the power is from the USB itself.

USB in car? Is it powered from a USB charging-port? Maybe there's a spike in the 5V power? That seems unlikely but...

Or maybe it's something on the output? Are they in an enclosure so they can't be touched and "zapped" by a static discharge? Or, maybe you just got unlucky and they died. Are they legitimate Nanos or cheap clones?

lmnopqrs:
Automotive environment.

Obvious risk.

Wow! You actually managed to post the same reply twice! Generally the forum software prevents that. Perhaps there is some sneaky change - I can’t be bothered checking all the detail.

I can’t see why you would be using a Schottky diode with a low reverse breakdown voltage in this application - a 1N4007 would be more appropriate if your intent is to protect against reverse voltage impulses although a 1N914 in reverse parallel across the optocoupler input would be even better.

If the optocoupler is physically close to the Arduino, the 10k pull-up would itself be unnecessary as the internal pull-up of about 45k would do the job. The input resistor could then be 10k.

The capacitor value is not properly labelled. What is it there for?

But clearly the optocoupler provides isolation of the input circuitry so that cannot be the cause of the failure.

It is absurd to suggest that the frequency of logic transitions could “harm” a microprocessor.

Powered through the USB input (or “5V” pin), you would worry that a failure of whatever 5 V regulator you are using would smoke the Arduino. Of all the matters so far revealed to us, that is the (single and only) most likely cause of failure. Some people here have reported random failures of cheap Nano “clones” but most have found them perfectly reliable.