How to transmit data from an analog multiplexer to an RS232

Post here to discuss ADC with digital ports.

Moderators: Chuckt, Garth, bitfogav

Post Reply
Posts: 3
Joined: Thu Aug 25, 2016 11:48 am

How to transmit data from an analog multiplexer to an RS232

Post by mkioiu » Tue Dec 06, 2016 5:51 pm

I am having trouble understanding how to design a circuit that will transmit multiple analog data signals to a computer through one RS232 COM port.

The analog data is a simple voltage reading from 12 different LEDs. The LEDs are triggered by relays that are controlled with software from the same computer that I will use to monitor the LEDs. Other software will be developed to read which LEDs have been triggered and if they are operating within a specified voltage range. For now I am just trying to understand the hardware aspect of transferring 12 analog signals through a single COM port.

My understanding is that an analog multiplexer can be used to combine the voltage signals and transmit them to the computer's com port through a voltage converter/serial interface like the MAX232ECD. Is this possible without using a microcontroller chip such as MAX232ECD? If not, what chip should I use to perform this task? I am trying to avoid using a microprocessor in the interest of keeping things as simple as possible.

Ultimately, I am looking for the simplest way to transmit multiple analog signals through a single COM port on a PC. Thanks in advance.

I practically live here!
I practically live here!
Posts: 232
Joined: Wed Jan 16, 2013 1:17 pm

Re: How to transmit data from an analog multiplexer to an RS

Post by Garth » Tue Dec 06, 2016 6:54 pm

The MAX232 and many other line driver/receiver ICs are for converting digital logic levels, for example from the 0-5V or 0-3.3V to the ±12V of RS-232. This is not a microcontroller. The RS-232 line drivers are inverters; so a 5V input results in a -12V output, and a 0V input results in a +12V output (give or take a few volts—it's not critical at all). The receivers are also inverters, and work in the opposite direction, converting back to the voltages used by the logic of the computer. They are not analog devices at all. RS-232 is digital. If you want to communicate the analog voltages by RS-232, you'll have to use an analog-to-digital converter, then take the resulting digital number and convert it to the RS-232 protocol of start bit, data bits in reverse order (a minimum of 5 data bits, but usually at least 7 if not 8), then the stop bit, all governed by strict timing requirements; for example, at 9600bps (one of the standard speeds), a bit period is a hair over 104 microseconds. This is normally done by a UART (universal asynchronous receiver/transmitter), which may go by another name or two like ACIA (asynchronous communications interface adapter). These virtually always have a microprocessor interface, or in the case of a microcontroller, are built into it and interface to the microprocessor that's at the heart of the microcontroller. The job can be done in software, but it is seldom justifiable to do it that way. I have an RS-232 primer at .

I don't think there's any way to do what you want to do without a microprocessor or microcontroller, plus an analog-to-digital (A/D) converter, or ADC. The program will select the input to measure typically via an analog switch which could even be an IC like a CD4051 analog switch which I've used many times, or the selector may be built into a microcontroller with several analog input pins. Then the software will tell the A/D converter to begin a conversion, and usually it will take it several instructions' time to finish, after which the program can fetch the result and send it to the built-in UART. The UART's transmit output pin gets connected to a line driver like in the MAX232, and the digital number gets sent over the RS-232. You'll probably want to send some housekeeping bytes too, so if you send a bunch of numbers over and over, the receiving end will know which one goes to which LED. Also, if you want more than 8 bits of precision (which you won't for just LED voltages), you need to devise a way to spread the whole number of bits, for example 10 or 12, over two RS-232 frames in such a way that the receiving end will know which frames are the beginnings of each number.

I don't like to discourage anyone. I think this stuff is an awful lot of fun, but there's a lot more required than you were hoping. lots of 6502 resources

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest