Skip to main content

Remote Control Based on the RS232 Protocol

A few weeks ago I was studying PIC Microcontrollers and how to interface them with the computer using the computer serial port. This was possible because many PIC Microcontrollers such as PIC16F628 and PIC16F877 has a built in UART module (Universal Asynchronous Receiver/Transmitter) that enables serial communication using the RS232 protocol.

The tutorial I used suggested the following circuit.

To explain the circuit briefly,
The PIC used is PIC16F628A. The MAX232 IC is used for the logic level translation. This is because the logic levels as well as the voltage levels on which the computer serial port and the microcontrollers work on are different.  These levels are illustrated below,

Logic levels of the computer serial port
Logic levels of the microcontrollers
The MAX232 works as an interface between the microcontroller and the computer translating these logic levels.

I'll discuss the code used for serial communication in the next post.

Comments

  1. Remote Controls are RC5 Protocol not RS232

    ReplyDelete
  2. Yes, normal remote controls use protocols like RC5 or SIRC. This is a personal project of mine to build a remote control based on the RS232 protocol.

    ReplyDelete

Post a Comment

Popular posts from this blog

Selecting the Correct Gauge Wires for your RC Models

When we are building RC models (aircrafts, multicopters etc.), something we typically overlook is what type of wires to use to distribute power in them. Usually, we try to reduce the weight of the model, so we tend to go with smaller wires. But, we cant expect to put in small circuit-wires and have them handle the amount of power needed. If you look at the wires that comes in the output leads of a Li-Po, or the wires that comes on a standard XT Jack, you'll notice that they're quite huge. Large gauge wires on a Li-Po and XT connectors These need to be huge to handle the amount of amperage that goes through them. So, we should also consider the amperage, and the length of wire needed when selecting the size (gauge) of the wires.

What do the prop size numbers mean?

Have you been trying to shop for propellers - either online or at a hobby shop - and got confused of the numbering used to denote the size of the propellers? You see things like " 10 x 4.5 CW ", or " 8055 CCW ". What do these numbers mean? A 8 x 4.5 CW and CCW Propeller Set It's actually quite simple once you figure it out. The first number denotes the diameter of the prop (length from tip-to-tip). The second number denotes the pitch of the prop. Here, the pitch is denoted as a length, not a angle. Let's see how that works.

Calculating the length of an array in mikroC

Note: This is the beginning of a new category on my blog, which it the 'Tips and Tricks' category. This is where I share small tips on all the other subjects I discuss here. On my post about RS232 communication using microcontrollers ( here ), I explained how to send and receive one character (one Byte) at a time. Now I wanted to send a whole string using RS232. Since a string is essentially an array of characters in C, we just have to loop through the array and send one char at a time as usual, which is done in the following code. char *mystr; unsigned int i; void main(){ Usart_Init(9600); mystr = "Testing"; for(i=0; i<5; i++){ Usart_Write(mystr[i]); Delay_ms(500); } } This works well when you know the length of the string and only one string needs to be sent. When there are several strings, writing a loop for each of them isn't a good programming method. The better way is to write a separate method to...