Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Discrete I/O to Serial and Vice Versa

Status
Not open for further replies.

DJWilliams

Mechanical
Aug 18, 2015
3
Hello,
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 ( 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.

[URL unfurl="true"]https://res.cloudinary.com/engineering-com/image/upload/v1439926943/tips/150818134022_0001_cfct4v.pdf[/url]

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!

DJWilliams
 
Replies continue below

Recommended for you

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
Footwell%20Animation%20Tiny.gif
 
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
 
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


 
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
 
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.


-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"It's the questions that drive us"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
"...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.

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

DJWilliams

 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor