Controlling DC motors with PC via PIC microcontroller

Thread Starter

killerpiraat

Joined Feb 17, 2020
18
I work at a company that tests wiperblades for cars, trains, boats etc. They want to make a small testroom with 4 windows and 4 wiper motors, which can be controlled by 1 PC.
The PC will be used to select the speed of each individual motor, turn each motor on and off individually etc. etc. (not all motors are always used at the same time).

Since i have some experience with programming i decided i would take this task upon me, or at least try, instead of hiring an external company.

They want to be able to control all the motors via the PC in the room. I want to use a PIC microcontroller, which controls all the relays towards the DC motors.
There are some variables that the end user wants to change, depending on what kind of test he wants to run.
For instance: How long does the test have to run? Turn the wiperfluid on or off. High speed or low speed selection and some more.

My Question: How can i give input or signals from the PC to the PIC. The software that controls the motor will not be the problem, i just dont know how to make the connection between the PC and the PIC, so that the PC can give input to the PIC. What would your suggestion be on how to do this?
Myself i was thinking on some kind of .csv file where the user can enter some variables, but the next question is, if a test of wiper #1 have been running for an hour, and a new test is started on window #2, the test on window #1 should keep going, and not reset.
 

John P

Joined Oct 14, 2008
2,026
The easiest way to communicate from computer to PIC is via a USB-to-UART interface cable, which you can buy very cheaply from lots of vendors, including on eBay or AliExpress. Make sure that it's compatible with your version of Windows (assuming your PC runs Windows).

You would need to have software on both the PIC and the PC. In your situation of running tests, you'd probably want to have the PC creating files of when the various tests began and ended, etc. That's all pretty simple stuff.
 

MrChips

Joined Oct 2, 2009
30,821
The first decision would be to choose the app you want to run on the PC.
There are many options, Labview, MATLAB, python, VB Studio, etc.

The second decision will be the kind of interface you need.
For example, a wired interface, USB, UART, serial COM port, parallel, ethernet, RS-485, etc.
Or you can go wireless, IR, bluetooth, WiFi, LAN, internet, etc.
 

nsaspook

Joined Aug 27, 2009
13,306
I would use something more robust than USB. I've not found it very reliable in industrial applications with lots of motor driven noise.
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
On the PC end, you probably want to provide a recipe function, along with a simple interface for users to create, edit, delete their recipes, and send them off to the PIC. I’d go USB to Uart for its simplicity. Think about torque data being collected. We knew when an extrusion screw was approaching end of life from torque readings, and I’d be willing to bet that a wiper blades friction would speak volumes about its condition.
 

Spectric

Joined Jun 5, 2023
6
Hi

Having worked in automotive design I can say that Labview is a great enviroment for controlling and collecting data from test rigs and can be very quick to get up and running. They suppy a large range of hardware which is very intuitive and would allow you to come up with the design you require.
 

ustaad

Joined Jun 21, 2023
4
I would go with an industrial comm interface such as RS232/485. On the software side you can easily build a GUI with tkinter provided you have a little experience with python. Protocol wise you can build your own protocol since its very basic communication or preferably go with an industry standard such as Modbus that will give you built in data integrity checks
 
Top