Page 1 of 9 123456789 LastLast
Results 1 to 10 of 85

Thread: Simply serial input circuit

  1. #1
    Raw Wave rando's Avatar
    Join Date
    Mar 2004
    Location
    Redondo Beach, CA
    Posts
    1,973

    Simple serial input circuit

    I've been hoping to get a feature added to Frodo to allow it to be used legally in California. Basically I need to implement an automatic mechanism to disable certain features (video playback, applications, etc) when the vehicle is being driven.

    Here is a simple serial port based circuit that will allow you to interface with your brake lights, ebrake switch, gear position switch or whatever you want. It only uses a single SPDT relay. Software must initialize the circuit by setting DTR high and RTS low (unless you want to use the +/-12v or +/-5v rails from your PSU). It can then read the on/off status of the relay over the DSR line. If you want the logic to work in the opposite direction, you can simply set DTR low and RTS high.

    DTR---SWNO
    RTS---SWNC
    DSR---SWPole
    Input --- Coil ---- GND or Input --- Coil --- +V depending on what you're interfacing with.

    I've tested this with a simple vb.net program and it works great. Hopefully one of the major front ends will adopt support for it (or something similar) in a future release.

    BTW, if you need more inputs (upto 4), you can add more relays. The SWPole lines can be hooked up to CD,CTS, and RI also.

  2. #2
    I'm sorry, and you are....? frodobaggins's Avatar
    Join Date
    Jan 2003
    Location
    Ruston, LA
    Posts
    8,846
    I'm confused, can you post a better schematic with explanations ?
    [H]4 Life
    My next generation Front End is right on schedule.
    It will be done sometime in the next generation.
    I'm a lesbian too.
    I am for hire!

  3. #3
    Raw Wave rando's Avatar
    Join Date
    Mar 2004
    Location
    Redondo Beach, CA
    Posts
    1,973
    RS232 uses <-3V and >3V for its logic values. All we need to do is supply one of these voltages on one of the input pins and then read the value in software. The voltages can be taken directly from the PSU output or (more conveniently) directly from a set of RS232 output pins.

    Here is a crude drawing. It's just a relay wired up to 3 pins of the serial port (2 outputs, 1 input). The DTR and RTS outputs supply the logic levels we need. The DTR output is set high and the RTS output is set low (in software). An external input drives the relay coil and loops either DTR or RTS back into the DSR input.

    RTS is on the normally closed relay contact and thus the DSR input will get a low value when the coil is off. When the coil is turned on, the normally open contact will be closed and DSR will go high. Put simply, DSR is true when the coil is closed and false otherwise.

    In my case, I would hook the coil up to the signal in my truck that indicates that it is in the PARK gear. When the truck is in PARK, the coil closes and DSR becomes true. When I move the gearshift to any other position, the coil will open and DSR will be low. Whenever DSR goes low, I'd like the software to disable video playback and external apps (including any that might already be playing/running). Only music playback and navigation controls should remain. When DSR goes high, all features should be re-enabled.

    Make sense?
    Attached Images Attached Images  

  4. #4
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    131
    I want to automatically show the image from the rear-view cam when my car is put in reverse.. Can I do that with this schematic? Just tap into reverse-lights? And if so, how would I do it?

  5. #5
    bsc
    bsc is offline
    Newbie bsc's Avatar
    Join Date
    May 2004
    Location
    Norway
    Posts
    12
    That should work just fine.

    By using the parallell port instead we could dispose of the relays.

    A couple of resistors would be enough I think.
    EPIA CL-6000E mobo powered by 12V 55W PSU
    Creative Audigy 2 NX
    Samsung 152V 15" LCD panel (VGA, 1024x768)

  6. #6
    Constant Bitrate
    Join Date
    Jun 2004
    Posts
    131
    Thank you for the response.. But how would i wire this to the serial port?

  7. #7
    Raw Wave rando's Avatar
    Join Date
    Mar 2004
    Location
    Redondo Beach, CA
    Posts
    1,973
    Quote Originally Posted by FetLyd
    I want to automatically show the image from the rear-view cam when my car is put in reverse.. Can I do that with this schematic? Just tap into reverse-lights? And if so, how would I do it?
    Sure, the circuit could be the triggering mechansim for your camera. Wire the reverse lights up to one side of the coil. Wire the other side of the coil to ground. Write a few lines of code to set DTR high and RTS low. When the software sees DSR go high, it should switch to your camera view. When DSR goes low, it should switch back to normal view.

  8. #8
    Raw Wave rando's Avatar
    Join Date
    Mar 2004
    Location
    Redondo Beach, CA
    Posts
    1,973
    Quote Originally Posted by bsc
    That should work just fine.

    By using the parallell port instead we could dispose of the relays.

    A couple of resistors would be enough I think.
    The parallel port uses TTL logic levels (+5V, 0V). You might be able to use a resistor divider network to get down to the required +5v. Since many RS232 implementations except 0V as a logic low anyhow, you can probably do the same thing on the serial port. Either way, you'd be forgoing the isolation protection that a $3 relay buys you. The circuit I provided is simple AND safe and can be built with whatever relay is appropriate for the voltage levels you're triggering on.

    Also, one of the nice things about the serial solution is the availability of USB to RS232 adapters that are 100% compatible with native COM ports. Since most of us already have USB cables run around our cars/trucks, this could reduce the need for running any additional wires. There are also USB to Centronix devices around but I've read that those are not implemented as standard bidirectional parallel ports (dunno if that's true or not).

  9. #9
    MySQL Error MatrixPC's Avatar
    Join Date
    Sep 2003
    Location
    Beach City, Socal
    Posts
    4,053
    Rando, that is the exactly solution I was thinking before. I don't trust my car voltage sending to the computer serial or parallel port thru couple resistors. A relay is much safer. Now we need software solution.
    2004 Matrix XR A7N8X-VM/400 AMD XP-M 2500+, DS-ATX
    89 Supra Turbo P3 600E@750/Abit BE6 II, Alpine M-BUS Car2PC.
    Y2K Accord Dell GX150
    RoadRunner is the best FE PERIOD
    EmoRebellion is a SCAMMER

  10. #10
    Raw Wave rando's Avatar
    Join Date
    Mar 2004
    Location
    Redondo Beach, CA
    Posts
    1,973
    Ask and ye shall receive.

    The attached archive includes source and binary of a simple demo in VB.NET based on a public domain RS232 class. Hook up the circuit to an available COM port. Run the software. Set the COM port your using and click the Open button. The CD,DSR,CTS, and RI radio buttons will turn black when their corresponding input is selected and turn white when it's not.

    You can use the DTR,RTS check boxes to initialize the RS232 outputs however you want. The default settings is DTR high and RTS low. This corresponds with the circuit I provided.
    Attached Files Attached Files

Page 1 of 9 123456789 LastLast

Similar Threads

  1. Battery based tank circuit (tested)
    By Ricky327 in forum Power Supplies
    Replies: 241
    Last Post: 02-13-2008, 05:43 PM
  2. Replies: 97
    Last Post: 09-18-2006, 02:56 PM
  3. Bad Serial Ports on EPIA M9000
    By wi77iam in forum General Hardware Discussion
    Replies: 6
    Last Post: 05-06-2004, 12:49 PM
  4. Girder vs MSComm, different input through serial, why?
    By InFix in forum Software & Software Development
    Replies: 6
    Last Post: 10-22-2002, 09:49 PM
  5. Via Mini-ITX Epia 5000 serial port not working
    By vash in forum General Hardware Discussion
    Replies: 2
    Last Post: 08-13-2002, 09:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •