Problems with PWM and CNY17-3

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey,

my first post to the forum.

I am trying to get PWM through CNY17-3 optocoupler. Can someone tell what's the problem of my circuit. Is it saturation or what?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Should get about a 2.5V square wave? Voltage divider with 32K and 43K?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is your frequency ?
According to the datasheet the output transistor has a rise time of about 400us for a 30k load.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What's limiting the current out from the uP pin when it goes high? A better way to hook up that part of the circuit would be to connect the cathode of the optocoupler LED to the microprocessor pin, and drive the pin low when you want the LED to be on.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hope your widget does not need to operate across a wide range of temperatures. Especially the LED is very temperature sensitive and this will change the current transfer ratio; net effect is the pulse shape at the receiving end will vary considerably with temperature.

You can partly optimize the LED drive current and the transistor load to minimize the effect. You don't want to drive the LED too hard or the transistor has trouble getting rid of the charge, too low and at higher temperature the CTO drops so much the signal can disappear completely.

I do not know know what the receiving end is going to do with the signal; if you only need to discriminate between two or three discrete duty cycles there's likely no problem; if you want to use it to generate an analogue voltage for example, I highly recommend to look for a much faster and better optocoupler.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have connected it wrong.

When AVR output pin is low, it sinks 10mA and LED is off because it is shorted to ground.

When AVR output pin is high, there is nothing to limit current, and most likely you have blown the LED or AVR IO pin.

I believe you want the 330R resistor in series between AVR output pin and LED, not parallel to 3V3.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your help.

Would 4n26 optocoupler be better than this CNY17-3?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Give us the Big Picture. You might not need the opto. What is it driving?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am driving a FET. Opto is only for protect the uC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Against what?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Depends what kind of FET and what the FET is driving.