Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Variable speed drive for an alternating current motor with PIC18F4431


Apr 5, 2024
Reaction score
Trophy points
Activity points
I'm designing a control board for a three-phase motor speed controller using a PIC18F4431. I've used an inverter powered by 24V DC to convert the voltage to 24V AC to power the motor. Additionally, I've included an LCD display for showing information, along with push buttons. However, I've encountered issues while simulating the circuit with Proteus ISIS. Here's the schematic and the problematic points:
I'm unsure how to choose the resistance values associated with the optocoupler.
What frequency should I use for the quartz and the PIC?
How do I configure the motor to operate at 24V?
Can anyone help me identify the issues?

also tried simulating a basic code to start and stop the motor, but when i press RUN the motor turn just one tour and stop without i press any other button,
can anyone help me to creat the code to contrôle the speed, using "mikroC pro for pic" in programmation


Too many mistakes.

Are you sure you want to start with that complex circuit?
I recommend to start with rather basic circuits, then step by step approach your motor drive.


Too many mistakes.

Are you sure you want to start with that complex circuit?
I recommend to start with rather basic circuits, then step by step approach your motor drive.

Hi Klaus,

Thank you for your feedback.

Could you please point out the specific mistakes you noticed in the circuit or the approach? Understanding these will help me improve.

Regarding your suggestion to start with basic circuits, could you provide examples of simpler circuits that would be more suitable for learning? Also, which components or features should I exclude initially to simplify the learning process?

Your guidance is appreciated.

* Your high-side NPN )Q1 Q3 Q5) motor drivers have 24v supply but they cannot conduct fully-On unless their bias gets sufficient voltage. This can be done by adding a resistor from +24V to bias terminal. The adjustment gets delicate because you also want NPN to shut fully Off.

Low-side NPN's conduct at the proper time. Again it's a delicate adjustment of bias (voltage & current) so that low-side NPN's fully Turn-on-and-off.

* Although led's usually accept maximum 20mA, there's a brightness (?) limit when their influence on the phototransistor is great enough to work correctly without a need to increase brightness. I think the led inside the optoisolator should only get 10 mA. Just enough current to work correctly because the led's lifetime may be finite.

I built a brushless spinning magnet from one spinning trio of this gadget:

3 spinning magnets.jpeg

A photosensor caught the momentary reflection from a glossy magnet, activating a transistor turning On a coil (hand wound) about 2 inches diameter near another magnet. No load was attached. I could adjust speed holding the photosensor 1/8th of an inch sooner or later than a magnet passed it. So the trio of magnets spun on one pivot. The project took me an evening to build. I felt a sense of victory. Later I disassembled it. It was a small victory since just one magnet was repelled or attracted (depending whether I held the large coil's N or S pole). Nevertheless everything had to be right in order for just one circuit to work. One simple circuit.

Start with just correctly connecting LEDs and push buttons.
Then use the simulation to check voltage levels, currents and timing.
I guess there are many thousands of tutorials a d documents telling how to.

Write the correct code including denouncing.

After this do simple hardware simulations on how to drive low side BJTs. Also with analysing voltages, currents and timing.

high side BJTs.


combine optocouplers with BJTs

What I don't understand ... it seems you are not very experienced .... so why don't you look on example designs and application notes? There is plenty good informations in the internet.


LaTeX Commands Quick-Menu:

Part and Inventory Search

Welcome to