DC motor control with Joystick and PIC16F877A

This is one project that i’m doing, now I’m going to show how to do it only for one motor, but i’m using and DEMUX to in the future use 4 motor.
The project is simple, it uses the pic to control the DEMUX and the DEMUX control the H-BRIDGE that control the motor forward or backward.

DC motor control with Joystick and PIC16F877A

Step 1: Part List

The itens that you will need is in the picture below.
Board not in picture, but you will need right?

Part List

Step 2: Schematic

The H-Bridge schematic, sorry about the mess.

Schematic
The print version is in PDF file

My motor works with 15V, but with the TIP31 I can put much more than that.

Step 3: Schematic

This is the schematic for the connections with the PIC16F877A.
DC motor control with Joystick and PIC16F877A
The JP1 is VCC and GND, the JP2 is where you connect the motor, inverter is necessary for this, because the DEMUX work in logical level low, but if you have one thats work in high you can remove inverters ports.

The Pot is the ANALOG input, where I will connect my Joystick.

The PWM is the port RC2/CCP1 and goes to DEMUX.

The DEMUX is very simple, look in the link below for the datasheet.
http://www.datasheetcatalog.com/datasheets_pdf/7/4/L/S/74LS138.shtml

Step 4: The Code

After everything is connected, make sure the supply for PIC is 5V, for my case, supply for the H-Bridge is 15V and the ground of both must have the same GND.

Now my code is very simple. It recive the Voltage from the Joystick that works igual a potentiometer, and calculate PWM duty and the direction of the rotation of the motor.

Donwload the PDF or the TXT file.

Step 5: Conclusion

Conclusion

This is the video demostrantion of the project working, its hard to see but belive me, if every thing is correct the motor will rotate to both directions.

http://www.youtube.com/watch?v=GIPJ-SR7aXI

Source: DC motor control with Joystick and PIC16F877A

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter