DC Motor Remote Control Using RS485 Protocol

by xanthium-enterprises in Circuits > Microcontrollers

7810 Views, 10 Favorites, 0 Comments

DC Motor Remote Control Using RS485 Protocol

motors-RS485-Protocol.jpg

In this Instructable We are going to control two DC motors remotely using RS485 Protocol from a x86 PC.

A Cross platform Master Control Program running on Windows/Linux will communicate with a MSP430 Launchpad using RS485 Protocol. The Computer user will be able to control the two motors connected to the MSP430 Launchpad from PC using RS485 Protocol .

Source Codes and Circuit Diagram can be downloaded from the original article.

This Instructable can be used as a starting point for developing your own remote control robot or Industrial control system.

The Project is divided into two sections

1) PC side

2) Microcontroller Side

PC Side

Control Program running on the PC acts as Master and Communicates with the Slave MSP430 Launchpad . The Control Program running on PC is written in

C#

Python (Python 2.7 and Python 3.0)

The PC uses a USB to RS485 Converter to convert the USB signals from PC to RS485 signal levels which is then used to communicate with the slave.

Microcontroller Side

MSP430 Launchpad along with Motor Control/RS485 Booster Pack acts as a slave and operates the two motors in accordance with the signals send by the PC .

The MSP430 Booster Pack and the USB to RS485 Converter used in this tutorial is available on our Store

Materials Required

Things-needed.jpg

For this Instructable you will require the following

1) A USB to RS485 Converter,Here I am using USB2SERIAL

2) MSP430 Launchpad

3) MSP430 Motor Control/RS485 Communication Booster Pack (Robot Shield V1.0)

4) Twisted Pair Wire for RS485 Communication

5) DC Motors ,2 Numbers

6) USB Cable

7) Screw Driver

Connection Diagram

RS485-connection-robot-shield-block-diagram.jpg

MSP430 Slave Unit With Motors

motors-RS485-Protocol-620px-mrkd.jpg

Slave Unit consists of a MSP430G2553 microcontroller interfaced with a L293D Motor Control Chip and MAX485 RS485 communication Chip.

Two motors are connected to the L293D chip terminals .The MSP430 waits for commands from PC send through the RS485 cable, On Receiving the commands the controller Switches the Motors on and off.

A detailed explanation of the slave unit as well as the explanation of the Source code can be found here.

PC Side Master

code-running-windows.jpg

The Master unit consists of a x86 PC running a Linux or Windows Operating system and a USB to RS485 Converter.

Since most PC's do not have a RS485 port, we are using a USB to RS485 converter based on FT232 chip and MAX485 chip to translate the USB signal to RS485 differential signals.

The control code running on the PC is written in C# and Python .

The code, both C# and Python can be made to run on Windows and Linux Platforms without any modifications.

A Detailed explanation of the Master Control Program can be found here.

Cross Platform Code

running-CSharp-code-Linux.jpg

Screenshot of the C# code running on Linux using Mono Framework.

Details about running the code using Mono framework can be found here.