Shop OBEX P1 Docs P2 Docs Learn Events
serial port on the basic stamp — Parallax Forums

serial port on the basic stamp

TammyTammy Posts: 5
edited 2007-09-23 21:04 in BASIC Stamp
I would like to add the optical isolator between serial port from computer to 3 line SOUT, SIN and ATN of the basic stamp.· This isolator would help to protect ground loop and noise problem from the computer source.·
Does any one have any idea how to do it?

Thanks,

Tammy

Comments

  • dandreaedandreae Posts: 1,375
    edited 2007-09-20 22:35
    You can use the .1uf capacitors on the ATN and Ground line.· On page 28 of the BASIC Stamp Syntax and Reference manual it will show you the connections.· Here is a link for the download of the manual:· http://www.parallax.com/detail.asp?product_id=27218

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support

    Post Edited (Dave Andreae (Parallax)) : 9/20/2007 10:52:56 PM GMT
  • TammyTammy Posts: 5
    edited 2007-09-20 22:42
    Thanks Dave. But how the 0.1uF cap on the ATN and ground will help to isolate the ground loop and the noise from the computer? How does it work?

    Tammy
  • dandreaedandreae Posts: 1,375
    edited 2007-09-20 22:50
    The capacitors act as a filter for noise.· You're not powering the stamp through the serial port.

    Dave




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • TammyTammy Posts: 5
    edited 2007-09-20 23:06
    Thanks Dave.

    However, we have to isolate the ground from computer and the ground with basic stamp because the ground from computer can generate random noise and it can cause our sensitive system (signal with the gain of 6000) failed.

    Any other input, please let me know.

    Thanks,

    Tammy
  • dandreaedandreae Posts: 1,375
    edited 2007-09-20 23:16
    Can you provide details on your set up, meaning are you using a straight serial port?· What type of board is your stamp in?· What are you using to power up the stamp?



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • TammyTammy Posts: 5
    edited 2007-09-20 23:23
    I am using straight D9 serial port to basic stamp BS2p40. I am using 10V (where it's respect to DGND) to power basic stamp. VSS is connected to DGND.

    Hope this is clear. Let me know if you need another input.

    Thank,

    Tammy
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-21 02:16
    Here's a circuit that might do what you want. On the Stamp side, it uses your 10V supply going into Vin. On the PC side, it steals power from the positive excursions of TxD and DTR to feed RxD. This may be inadequate, though. If it is, you may be able to find a positive supply voltage on pin 9 of the DB9 (which would actually be way better). Otherwise, you'll need a separate supply. A nominal 5-9V wall transformer should work fine. Just make sure the unloaded output voltage is under 12V. Connect the negative wire to pin 5 of the DB9 and the positive wire to the positive side of the electrolytic cap.

    If the power-stealing circuitry works for uploading programs, you will need to keep DTR high during communication with the PC afterwards, if you're not sending a lot of data to the Stamp. Otherwise the cap will drain.

    Note: This circuit is completely untested, and some of the component values are just guesses, so there may be some gotchas I'm not aware of.

    -Phil

    Update: Added a resistor to the ATN circuit to discharge the caps in the absence of DTR.

    Post Edited (Phil Pilgrim (PhiPi)) : 9/21/2007 2:30:31 AM GMT
    586 x 447 - 5K
  • StampNut2StampNut2 Posts: 224
    edited 2007-09-21 07:13
    Phil, the DB9 plug, I take it that is looking at the back of the plug for wiring?.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong.

    robosapienv2-4mem8.page.tl/
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-21 07:30
    Pin 1 is as marked in the schematic. Most DB9 connectors have the pin numbers molded into the insulation between pins.

    -Phil
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-21 14:34
    Hello,

    Inherently opto-isolators in this system would invert the signal and therefore require a lot of extra circuitry to remove what has, to date, never been an issue we have heard of. The signals on a PC Serial Port are well suited for communication and pretty immune to noise. The amount of noise it would take to interfere with the host PC would most likely cause the BASIC Stamp to experience issues (such as resets) first. Have you measured this noise? Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-21 16:48
    Chris,

    In the circuit I presented, the optos, wired as emitter followers, maintain the correct signal polarity. Whether it's a potential solution to a non-existent problem or not is hard to say. As you rightly point out, RS232 circuitry is pretty forgiving, and such measures are almost never necessary. But I can imagine situations in a laboratory or industrial environment where isolation is desireable, either to break a ground loop, to block noise, or to bridge two systems with a wide common-mode voltage discrepency.

    Tammy's system, with a "gain of 6000" sounds like a laboratory measurement situation, but it would be nice to know more. I wonder in particular about the 10V power source and whether it's contributing to the noise level. This may be a good candidate for battery power, just to eliminate that variable.

    -Phil
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-21 17:08
    Phil,

    I understood what your schematic was doing and wondered if it was more worth it to put that added complexity into noise reduction or perhaps to identify the source of the noise and address it there. That is what I would be inclined to do if possible. I understand there would be numerous situations where noise would be an issue for the host PC, but I can’t think of one where it wouldn’t also be an issue for the BASIC Stamp, an issue the optos would not solve. Of course we are all responding without the benefit of all the available information. In a situation like this there is never “too much” information and more would help identify and reduce problems, possibly without isolation. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • TammyTammy Posts: 5
    edited 2007-09-21 17:12
    Hello,

    Our system cannot share the same ground from the serial port (pin 5)(from the computer) because of minimum gain of 6000; highest of 48000. A little tiny noise from the computer can cause the signal to noise decrease significantly. I am using the battery 10V power source for the basic stamp to reduce minimum noice from this power source. I have bought RS232 isolator module to test the system out and I can see huge difference S/N ratio with and without the RS232 isolator.

    We love to put the RS232 isolator inside the board. I will test out the circuit from Phil. Thanks a lot for all supports and helps here.

    Tammy
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-21 17:36
    Tammy,

    One thing you might consider before testing my circuit is whether the RS232 interface would be the natural place to provide isolation. If, for example, your sensitive analog circuitry is connected to the Stamp via a serial analog-to-digital converter, the serial clock and data lines (assuming they're not bidirectional) might be an easier place to break the ground. And since you're dealing with logic levels at that point in the circuit, and not RS232 voltage swings, other kinds of isolation are possible. Analog Devices, for example, makes miniature digital isolators that use transformer coupling. This might further improve your S/N by isolating any noise produced by the Stamp itself.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 9/21/2007 5:41:14 PM GMT
  • KorbenKorben Posts: 5
    edited 2007-09-23 10:22
    Hello !

    This is my old opto project:
    1646 x 1160 - 493K
  • Desy2820Desy2820 Posts: 138
    edited 2007-09-23 12:13
    Not an expert, but are you locked into RS232?

    I think RS422 or RS485 may be better options, especially if you connect them with cat5 cable.· The twists within the cable will help reduce noise.· I think these depend on a balanced current flow and don't require a common ground.· This may also help with ground loops and stuff.

    I know there were some recent posts about this, maybe in the Sandbox?· I can't find them now, just because I'm looking for them.· There may be some information available from the EME Systems website too.

    My other idea would be some type of fiber optic setup.· Convert the signals to light, then back into voltage/current.· May need two cables for bi-directional comms.· I have no idea how to do this though.....

    I hope this helps!
  • KorbenKorben Posts: 5
    edited 2007-09-23 21:04
    Hi!

    Absolut isolated RS485 project:

    ADM483 Excellent Noise Immunity and TME0505S absolut isolated 5VDC power


    1647 x 1162 - 526K
Sign In or Register to comment.