Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Discrete I/O to Serial and Vice Versa

Discrete I/O to Serial and Vice Versa

Discrete I/O to Serial and Vice Versa

I'm a mechanical engineer working in R&D at an aerospace company. I've been tasked with designing and developing a robotic system to offload some of the production at our facility. In the application I'm working on, I have a sensor that uses serial communication (RS-232) and I'd like to talk to it using the 8 channels of discrete I/O (8 inputs, 8 outputs) that my robot controller provides. I'd like to send signals both ways. My thought was that I could use 2 serial to parallel converters to do the job. One for talking to the sensor and one for receiving info from it (http://www.blackbox.com/Store/Detail.aspx/Serial-t...). The data coming through will only be a few bytes every 20 seconds or so giving x, y and positional data from the sensor.

First of all, does this look like a feasible plan? I've attached a block diagram of what I'm thinking.


On the connection between the DO and the P/S converter, I need to drop the voltage from 24V to 5 V. What would be a reasonable way to do this? On the other side I need to step up from 5 to 24V, I believe I could use an OP AMP here? My other question is on the connection to the sensor. Since I will need to switch between input and output to the sensor I would need to have some sort of switching mechanism to do this. Signals coming out of the sensor would go to one parallel to serial converter, and signals going in would come from the other. Anyone recommendations for the type of switch I could use to do this (type, brand, if possible Part Number). I would like to use a digital output to switch the switch from one side to the other if possible.

Trying to recall Electrical Engineering I learned in college 20 years ago =)

Anything else I may be missing?

Thank you for any help!


RE: Discrete I/O to Serial and Vice Versa

You want a level translator, not an op-amp... op-amp's are more built for small A/C signal amplification at low current levels (mostly). Also, consider RS-422 for noise immunity... 232 will quickly get corrupted in a noisy robotic environment or over long hauls.

Dan - Owner

RE: Discrete I/O to Serial and Vice Versa

Given the data rate specified, you don't really need S/P and P/S converters.
You can do it all with one input and one output, and some 'bitbanging' software.
(Most any really old microcontroller handbook will have examples of bitbanging a serial channel.)
I'd suggest optoisolators for the level translation, and a local EE to help you minimize the smoke leakage.

Mike Halloran
Pembroke Pines, FL, USA

RE: Discrete I/O to Serial and Vice Versa

Thanks, MacGyver and MikeH. Bitbanging looks much simpler . . . I'm going to try it out . . . great tip! I will use a level translator instead of the op-amp . . . thanks. I may be back with more questions when the testing has begun.

Regards, Dustin

RE: Discrete I/O to Serial and Vice Versa

Need more details:
=about the 24 to 5 and 5 to 24V :
How much power / current do you need? does it has to be isolated ?

=About the communication ,
do u need to connect it with wires? what about using wireless wifi ? what is the range ?
What is the speed you need the data to flow ?
do you need it one way? or you want to have feedback from the robot?

Assume you have electrical/electronics engineers in your company they will love to help u

good luck-any response? daveross100@gmail.com

RE: Discrete I/O to Serial and Vice Versa

For a recent project where I had to do 5-24VDC and 24-5VDC isolated conversion, I came across this little gem- Animatics OPTO2 16 channel (8 of each) Opto Isolation Board.



"It's the questions that drive us"

RE: Discrete I/O to Serial and Vice Versa

"...8 channels of discrete I/O (8 inputs, 8 outputs)..."

16 pins of I/O.

One wouldn't have 16 I/O pins if trying to use a serial port as a discrete. It would work for some number of pins, but you'd need several serial ports to get 16 I/O pins in total.

Another approach would be to use an external uC such as an Arduino or Raspberry or any of the others. Plenty of I/O pins, easy software, and a serial or other connection to the PC.

RE: Discrete I/O to Serial and Vice Versa

Analogkid2digitalman . . . wow man, thank you . . . that is a great find. I may just need some wire and to write the bitbanging code now . . . sweet!


RE: Discrete I/O to Serial and Vice Versa

I'd investigate a micro PLC that has 24V compatible I/O. Connect digital I/O between your controller and the new PLC and then write the ladder logic to convert the IO to serial port communications. Automation Direct sells a PLC that would likely work for around $125 and they have a limited version of the software which would also likely be enough to work available for free.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


White Paper - How ESI is Helping Move New Medical Device Product to Market Quicker & More Cost Effic
Early Supplier Involvement has long been a strategy employed by manufacturers to produce innovative products. Now, it almost seems like a necessity. Because decisions made in the design phase can positively affect product quality and costs, this can help add value to OEM bottom lines. This white paper will discuss many facets of ESI, including why it’s so valuable today, what challenges limit the benefits of ESI, how cost is impacted, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close