I have a DC-DC boost converter:

enter image description here

where the mosfet is driven by PWM signal generated with a PIC18F4550.

However, the PWM isn't directly feed in the mosfet. It passes through an opto-coupler first. Since I didn't find the specific component I'm using (TLP250), I tried my best to draw it: enter image description here

So, basically we have "3 grounds":

  • PIC GND

  • Opto supply GND (supply of 15 [V])

  • Converter supply (5 [V])

In the practice, the supply is a dual supply one feeding 15 [V] and the other 5 [V] and the PIC is being powered from USB (computer).

The first ground (PIC GND) isn't the same as the last two grounds. The latter two grounds are CONNECTED and the same point in the real circuit. My question: is that ok? should 3 of them be connected? all of them separated?

For reference: the circuit is now mounted in a breadboard: enter image description here

up vote 1 down vote accepted

The usual reason for using an optocoupler there is to allow the PIC circuit to be electrically isolated from the FET circuit, so the PIC Ground doesn't have to be connected to the other grounds, but it may be.

The optocoupler +15V ground must be connected to the FET circuit ground.

Peter is correct, no need to connect the grounds, but it would make debugging easier. Also it looks like you have 500 Ohms on the plug board that are not shown in the schematics. It is usual to drive the cathode of the optocoupler (active low) from the PIC rather than the anode because the low drive can source more current.

  • So, the out PWM would be in pin 3 and GND in pin 2? (considering my drawing in the original question) – Miguel Duran Diaz Dec 3 at 3:14
  • PWM on pin 3 and VCC(the PIC's supply) on pin 2. The PWM would then be active low instead of active high (see PWMxPOL reg). The 500 Ohm resistor can be connected between the GPIO and cathode or between the VCC and anode. Note: this is a suggestion for improved performance, it may work the way you have it, just not as well. – skeptonomicon Dec 3 at 3:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.