4 years, 7 months ago.

Mbed LPC1768 with optocoupler for 5 V output

I am generating a PWM at 20kHz to drive a motor. The signal goes into a motor controller which range is from 0 to 5 volts.

Since the PWM output is 3.2 volts I need to amplify it. For that I am using this optocoupler.(http://www.kynix.com/Detail/1234910/HCPL2630.html)

This is the electronic circuit I am using:

/media/uploads/jeremycool/d59b0ea20d37a8faf69553b1092c2691aa2dfd7d_1_429x500.png The optocouplers are inverted, pin 1 is down-right. The capacitors are 0.1uf as specified in the datasheet and the resistors are 330 ohms. The optocoupler output is not working, it gives me less than one volt.

I already try supplying the optocouplers Vcc with an external power source, but the result is the same. /media/uploads/jeremycool/fc43bc17338fc7f5f5542aee5d850578cc5029cf.png

In addition to the pullup already mentioned in the answers you also need a flyback diode on that relay or you risk blowing up the mbed.

posted by Andy A 24 Mar 2017

I know a search for components on the site, and I often use it and hope to help you www.findic.us/?lnk=lt

posted by tom hanks 08 Sep 2017

3 Answers

3 years, 12 months ago.

I know a website of components, hope it can help you http://www.findic.us/?lnk=lt http://de.findic.com/?lnk=lt

4 years, 7 months ago.

PullUp "PWM out" to 5V with a 4K7 resistor.

4 years, 7 months ago.

The optocoupler has an open collector output which means the output needs a pullup to show a high level. Note that means the input signal is inverted, so your PWM at 100% duty would stop the motor. Also note that by using a common ground for both sides of the optocoupler you no longer have galvanic isolation between the mbed and the motor which typically is the reason for using an optocoupler in first place..