Page 1 of 55 123456789101151 ... LastLast
Results 1 to 10 of 541

Thread: Anyone interested in serial controlled Relay/Input card?

  1. #1
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823

    Anyone interested in serial controlled Relay/Input card?

    Im thinking of designing and making a Relay/Input card controlled by sending a command via the serial port. Im not gonna work on it yet but hopefuly when Im all done with the outstanding/overdue project Ill look deeply into it.

    Anyway, Im thinking of something along this line :

    The card support 8 relays, 5 digital inputs and 3 analog inputs.

    The relays can be used to control electric windows, central locking, boot lock...etc.

    The 6 digital inputs can be used to sense opened door, boot, ignition on, acc on...etc.

    The 3 analog inputs can be used for sensing car battery voltage, temperature...etc.



    Operating the relay is done by sending a command to the serial port :

    $RELAY1,ON = this turn relay 1 on
    $RELAY1,OFF = this turn relay 1 off
    ...the same goes for RELAY2 - RELAY8





    The card also output the current state of each relays as well as the 8 inputs.
    Example is as follows :

    $RELAY1,OFF = {Relay 1 is currently off, boot is locked}
    $RELAY2,ON = {Relay 2 is currently on, door is open}
    .
    .
    .
    $RELAY8,OFF
    $INPUT1,HIGH = {Door is closed}
    $INPUT2,HIGH = {Bonnet is closed}
    .
    .
    .
    $INPUT5,HIGH = {Driver seatbelt is on}
    $INPUT6,201 = {Main battery voltage is 12.8V}
    $INPUT7,192 = {Backup battery voltage is 12.0V}
    $INPUT8,128 = {CarPC temperature is 40deg C}


    The status of the cards is serialy outputed at lets say 9600,N,8,1 or higher. The update rate can be 1 per sec or more. Input 6-8 are the analog inputs, the measured analog values is represented by decimal values from 0-255. The PC can then decide what to do with these values.



    Those are just some ideas I came up with. The controller is to be based on PIC MCU. If anyone is interested in the project please make a comment. Otherwise Ill just simplify the design just purely for my own need


    Cheers

  2. #2
    Maximum Bitrate fantomas's Avatar
    Join Date
    Nov 2003
    Location
    CT
    Posts
    754
    what is your estimate for a price? would you do every single one completely by hand?
    rebuilding carpc... kinda..

  3. #3
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    what is your estimate for a price? would you do every single one completely by hand?

    The controller shouldnt cost too much to make. Probably 15USD for all the parts or even much less. The relay can be expensive so Ill make that an add on...since not everyone need 8 relays. If only 4 relays is needed then just plug 4 relays in

    Yup Ill start from scratch, the PCB deign and the electronics shouldnt be too hard to do...its coding the PIC that will take most of the time.


    Im not trying to sell it, Ill publish the whole design when done. But someone has to do the windows software for it...cant do those stuff Maybe frodo will integrate it

    I just thought no one has came up with this idea before.

  4. #4
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    Sounds fantastic! I can and would love to do the software for it too.

    I could easily do a C dll plugin callable from any application.

    Expect a PM.
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  5. #5
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    Sounds fantastic! I can and would love to do the software for it too.



    I may simplify the outputs to binaries if that make the software easier to write...no need to filter out the $RELAY1...$INPUT1

    So the output may look like this :

    1st byte = Relay status
    01010011 {1 = relay is on, 0 = relay is off}

    2nd byte = Digital input status
    XXX10110 {1 = input is high, 0 = input is low}

    3rd byte = Hex value of analog Input 1
    201 {decimal value of analog input 1}

    4th byte = Hex value of analog Input 2
    192 {decimal value of analog input 2}

    5th byte = Hex value of analog Input 3
    128 {decimal value of analog input 3}


    From the above examples, the controller then outputs the HEX values into the PC as follow :

    53
    16
    C9
    C0
    80



    I was only planning to output the status of the card in ASCII so it can easily be viewed in hyperterminal. But either way I dont mind at which format its outputed at as long as theres an agreement which value represent what. The ASCII format may be better for readabilty...abit like the NMEA sentences in GPS receiver.

    If you have any ideas then let me know...maybe more relay supports? more digital or analog inputs? I need to find out which is the best PIC MCU to use

  6. #6
    Maximum Bitrate kiltjim's Avatar
    Join Date
    Feb 2004
    Location
    PA, USA
    Posts
    805
    I was gonna try my hand at a similar project. I was thinking some sort of shift register setup that would take a stream from a serial output turn on the corresponding outputs. The outputs obviously linked to a whole bunch of relays. If I am right, the amount of relays would be only limited space and budget. The more relays needed, the longer the serial string, and the more clock pulses. I haven't yet figured out all the electronics yet, but I'm working on it.

    As for the controller, I was going to use the Basic Stamp as my processor, since it handles serial output, and I have experience with programming it. Some sort of software on the computer, serial output to the stamp, then some programming on the stamp, serial output to the board of relays.
    2000 Subaru OBS

    Dell P3 @ 900 Mhz
    7" Lilliput TS w/DigitalWW in-dash mount
    80GB External HD

    I am Zero Bitrate....

  7. #7
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    Theres really no need for a shift register. I dont know much about what BASIC stamp are available but the one with the hardware UART the received byte can be directed to a register that control the relays...lets say eight relays.

    Depend how much relay you want to control. If you are talking about 32 relays or more and dont have enough outputs on the MCU then you do need to decode the received bytes and switch that specific relay on/off as dictated by another bit.

    Let say bit 7 is the relay control bit this turn the relay on/off depend if the value is 1 or 0. Bit 0-6 is the relay address to be controlled by bit 7.

    So sending a command in HEX {represented in binaries} :

    1000000 = turn relay 0 on
    1000001 = turn relay 1 on
    0000001 = turn relay 1 off
    ..and so on.

    Of course you can control up to 128 relays which is probably overkill. You need to have 7 bit inputs decoded into 128 latchable lines to hold each relay states.

    But then its up to you how you want to make up your own protocol/commands. But thats how I would do it if I need that much relays. Another things is probably better to make the design cascadable since some may only require 10 relays. In this case you may want to define an ID for each relay card. The PC will then need to send an ID saying which relay board it want to control before a command is sent. Only the board with the correct ID will respond to it


    Good luck...let us know how the results goes

  8. #8
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    As for the controller, I was going to use the Basic Stamp as my processor, since it handles serial output,

    It is also possible to use an MCU without a built in hardware UART. Theres alot of bit-banged software UART routine floating around the net. Ill rather use the one with a built in one to simplify the software...it can get a bit messy when trying to emulate hardware with software.

  9. #9
    Low Bitrate
    Join Date
    May 2004
    Posts
    82
    what about use the parallel port? and also more analog inputs so i can eliminate my ODB II .

  10. #10
    Raw Wave
    Join Date
    Jun 2003
    Posts
    1,823
    what about use the parallel port? and also more analog inputs so i can eliminate my ODB II

    Because the parallel port uses too many pins and speed is not an issue here. Its far more compact/cheaper/efficient to use a PIC with built in com port...less pins, smaller connector, etc.

    More analog inputs? yup thats possible. Some PIC do have like 16 ADC built in. But then I dont think using this card to get rid of the OBD2 interface is a good idea.

    Its original function is just to control 8 or so relays, but then I though why not add some inputs from the spare I/O ports, then why not add analog inputs too.

    The idea had already turned into something more than I original wanted. I think I have to stop there

Page 1 of 55 123456789101151 ... LastLast

Similar Threads

  1. Ewww sound card + video card on dual pci mini-itx reiser card = audio interference
    By psyclobe in forum Software & Software Development
    Replies: 7
    Last Post: 01-23-2008, 01:59 AM
  2. anybody tv/fm card troubles
    By marsjell in forum Software & Software Development
    Replies: 1
    Last Post: 09-01-2005, 07:08 AM
  3. Via Mini-ITX Epia 5000 serial port not working
    By vash in forum General Hardware Discussion
    Replies: 2
    Last Post: 08-13-2002, 08:48 PM
  4. help - video card problems
    By Cliff in forum General Hardware Discussion
    Replies: 4
    Last Post: 04-15-2002, 05:25 PM
  5. 2 db-9 serial ports PCI and credit card remote
    By moahdib in forum Classified Archive
    Replies: 0
    Last Post: 07-24-2001, 11:41 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
  •