Results 1 to 8 of 8

Thread: Use temperature sensor to trigger RR command

  1. #1
    Constant Bitrate deus ex machina's Avatar
    Join Date
    Mar 2006
    Posts
    136

    Use temperature sensor to trigger RR command

    I have the four-input temperature sensor connected my comm port. Since I only use two of the sensors, I came up with the idea of using one of the others to monitor the IGN wire of my car so that I can do things in software when the ignition goes on or off.

    A simple way of rigging this would be to put a relay on a temperature sensor so that it is only connected when the IGN is on, so RR will only receive data from this sensor when the IGN is on.

    But I have no idea how to monitor this sensor with RR. I do not understand how this "tmr" or "timer" function works. "tempX" is going to be either a number or null, I guess. I'd need to execute a command both when this changes from a number to null and vice versa.

    (My goal with this is to trigger a preexisting phidgets relay to keep the RMS wire of my power supply high, so that it doesn't turn off when I turn off the ignition. Instead it will turn off the screen, pause the music, and wait a half hour before hibernating. If the RMS goes high again before that time, it will turn on the screen and resume the music. Right now I run a command to turn on the relay manually when I have run in a store or whatever.)

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,818
    When RR reads a temperature sensor, it keeps that number as the current temperature until it gets a new reading from it. So, if you plug the temperature sensor, it will change from "N/A" to the current number, when you unplug it, it will stay at that value until a new temperature value comes in OR until you restart RR or unplug the whole temperature sensor board altogether for at least 10 seconds (so RR resets the COM port connection).

    All I'm saying is that unless you read the temperature sensor yourself (plugin/script/application), you won't have the ability to make such detailed control when a temperature stops being transmitted. The built-in code in RR is optimized to display temperatures and nothing else. Either you figure out a way to show specific values for the temperatures and then compare those values in the skin to determine the state of something outside OR you write your own code (plugin/app) to check for those situations of the sensor presence -- and then you can just send to RR the 2 temperatures you want to display in it.

    If you have a free serial port, I'd suggest you look into this thread:
    http://www.mp3car.com/vbulletin/rr-p...rsion-3-a.html

    You can definitely do things based on the indicator states provided by the 3 inputs (standard) on any serial port.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    Constant Bitrate deus ex machina's Avatar
    Join Date
    Mar 2006
    Posts
    136
    Thanks, guino. I'm going to write a separate application to handle this and send the temperatures to RR. If it works well I'll post it.

  4. #4
    Variable Bitrate
    Join Date
    Jul 2006
    Location
    Brisbane, Australia
    Posts
    346
    If you know enough to write an application, the Aduino used in this thread is an interesting beast:

    http://www.mp3car.com/vbulletin/hard...ort-carpc.html

    It costs about the same as the temperature module in this country. I had a look at the tutorials and programming guide and there is enough about sensors in this to allow you to build a USB based device that could do the temperatures and all sorts of other things such as control relays, read voltages, turn switches and is really simple to program (but a basic understanding of C would help). I have considered using one to do the phone thing as discussed in the thread above. You could configure it to send messages back to the PC via the USB com port and have a number of messages that is parsed by the application you write that then interfaces with RR. I thought messages might look something like:
    TEMP1=19.5c
    TEMP2=22.0c
    BATT1=12.2V
    BATT2=13.8V
    PHONE=RINGING
    AUXRADIO=ON
    DOOR=OPENED

    One interesting feature is to be able to feed it a reference voltage (say the regulated 19 volts my laptop runs on and then measure a voltage (say my starting battery or my Aux battery) in 255 steps from 0-19 volts (eg in increments of 0.07 volts). This is a good range for vehicle applications.

    You could also use it to trigger a device on an event occurring without involving the PC at all or set it up as stand alone without the PC to control whatever you wanted. eg. When Door opens, turn PC on.
    To my mind, it seems much more flexible than the fusion brain if you have basic electronic knolwedge and can do a bit of programming (both on the PC and on the Arduino)

    Rod
    RodW
    2007 Toyota Hilux with a CarPC..

    Worklog: http://www.mp3car.com/vbulletin/work...ota-hilux.html
    OziExplorer GPS Embedded in RR: http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

  5. #5
    Constant Bitrate deus ex machina's Avatar
    Join Date
    Mar 2006
    Posts
    136
    rodweb, the goal here is to do this with minimal pain and zero further outlay of cash. It actually only took a few minutes to get this working in a separate VB application.

  6. #6
    Constant Bitrate deus ex machina's Avatar
    Join Date
    Mar 2006
    Posts
    136
    Guino, or anybody, where can I find a VB6 example of how to send data to RR? The only link I've found to the source containing the SDK is dead. I found this but there's nothing about how to send data using the COM object method and there's no example of how to use the sendMessage method.

  7. #7
    Constant Bitrate deus ex machina's Avatar
    Join Date
    Mar 2006
    Posts
    136
    Never mind, I found it.

  8. #8
    Variable Bitrate
    Join Date
    Jul 2006
    Location
    Brisbane, Australia
    Posts
    346
    No worries, I have not bought the temp sensor yet and am keen to do the phone thing, so might go the arduino route after I get a few more things sorted out with my install. I may add a temp sensor as well (as I have a dual battery and a fridge for the beer in my rig) but I thik the Arduino can do it all.

    I did find a good thread once where the COM model was demonstrated and described in detail. It was not about programming but a specific topic which I am sorry I totally forgot.
    RodW
    2007 Toyota Hilux with a CarPC..

    Worklog: http://www.mp3car.com/vbulletin/work...ota-hilux.html
    OziExplorer GPS Embedded in RR: http://www.mp3car.com/vbulletin/sb-s...iexplorer.html

Similar Threads

  1. Lsx Void 3.0
    By liquid_smoke in forum RR Skins No Longer Supported
    Replies: 3171
    Last Post: 12-11-2013, 03:05 AM
  2. RR and telnet command
    By nws@basti in forum Road Runner
    Replies: 0
    Last Post: 06-10-2008, 08:38 AM
  3. RR Temperature Sensor - Ready out of box?
    By thestoogeo in forum Road Runner
    Replies: 7
    Last Post: 10-15-2005, 10:59 AM
  4. Temperature Kit for RR: output format?
    By soundoff in forum Road Runner
    Replies: 2
    Last Post: 08-14-2005, 10:25 PM
  5. Anyone understand Java ? I need help.
    By frodobaggins in forum Software & Software Development
    Replies: 31
    Last Post: 05-24-2004, 10:53 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
  •