Radar Detector...

This is a discussion on Radar Detector... within the Droid Development forums, part of the Droid Hacking category; Glad to hear the arduino isn't causing any lag. I have an old whistler radar in my car but the display unit is broke (missing ...

+ Reply to Thread
Page 4 of 6 FirstFirst ... 2 3 4 5 6 LastLast
Results 31 to 40 of 51

Thread: Radar Detector...

  1. Droid
    1033's Avatar
    Member #
    2550
    Join Date
    Nov 2009
    Posts
    39
    Phone
    Droid - BB 1.1 950Mhz
    #31
    Glad to hear the arduino isn't causing any lag.

    I have an old whistler radar in my car but the display unit is broke (missing also). When i get home ill take the radar remote out of the grill and laser detector off my mirror. Ill post back if I find anything useful. It has an unshielded 3 wire plug from display to remote... hopefully the magic is in the remotes and a little hacking could bring life back into these parts.
    Electronics tools done right: ResistorID.com
  2. Droid
    NaterGator's Avatar
    Member #
    24267
    Join Date
    Jan 2010
    Location
    Gainesville, Fl
    Posts
    88
    Phone
    Moto Droid
    #32
    I'm sure someone's been wondering, so I'll update.

    I've been spending 99% of my time doing schoolwork and haven't touched this in a while. I figured I was bored of the olympics today so I might as well be productive. Wired up the remote display cable in my landcruiser (the hardwire kit was in the headliner and is a pita to get to, which is what was putting me off) so I could test/capture data as I drove.

    Hooked up the 7805 and whatnot, rewrote a little of my BT testing code to read V1 frames and hooked up the display command to the AVR. Everything works like a charm, the remote display command stream is extremely stable and reliable, the bluetooth radio is fast (I'm running at 57600 baud to stay error free in noise), and it all seems to work extremely well. I've just been sending the raw binary command stream over BT via serial to a textview to make sure it is stable and correct, and so far it is. Now I can start fully writing the android app to handle the input and act like a hell of a radar detector

    At this point if you're interested in helping write the Android app (especially if you are good at UI) get on board and shoot me a PM.

    I'll post pics/code soon.
  3. Junior Droid
    mr_goodwrench's Avatar
    Member #
    39607
    Join Date
    Feb 2010
    Location
    Liverpool, NY
    Posts
    27
    Phone
    Droid
    #33
    I love this idea! I don't yet own a V1, but do plan on one in the near future. I am very excited by the prospect of full integration and am anxiously awaiting more advancement!

    subscribed...
  4. Droid
    NaterGator's Avatar
    Member #
    24267
    Join Date
    Jan 2010
    Location
    Gainesville, Fl
    Posts
    88
    Phone
    Moto Droid
    #34
    So, this is pretty much where I stand. I know, not aesthetically too impressive but a) it isn't connected to my car/V1, and b) it's just for my debugging purposes right now.

    Trapster has respectfully (but officially) indicated that they are not interested in supporting autonomous reporting through this project in any way, so we're/I'm pretty much on my own in that respect.

    I'll work on finalizing the remote display stuff, optimizing the most efficient and cheap way for people to build these with "off the shelf" parts, write up a little "how-to" guide, and finish coding up the remote display app so that it is usable for background/driving purposes. I have a big nasty (and important) controls theory midterm this Thursday, and then I start spring break and head to the beach/key west so I doubt I'll get too much work done during then... lo siento!

    For now those of you waiting patiently will have to deal with these snippets of code and a single pic:

    Code:
    /*---------------------------------\
    |      V1 Stream to Bluetooth      |
    | Copyright (c) 2010: Nate Weibley |
    |                                  |
    | If you use or modify this code   |
    | in your own projects I ask only  |
    | that you offer attribution to    |
    | the original authors and code.   |
    |                                  |
    \---------------------------------*/
    
    //Command stream start bit duration (tolerances)
    #define SYNC_BIT_MINL 10500
    #define SYNC_BIT_MAXL 12000
    
    // I/O Pins
    unsigned int commandPIN = 5;
    unsigned int mutePIN = 8; //TODO: implement mute control prot.
    
    unsigned int commandStream[35]; //Stream storage array
    unsigned int i=0;               //Indexing variable
    unsigned long pulseLen=0;       //Pulse length
    
    
    void setup() {
      Serial.begin(57600);          //NOTE: I set BT chip to 57600 baud. Default is 2x
      pinMode(commandPIN, INPUT);
      pinMode(mutePIN, OUTPUT);
      digitalWrite(mutePIN, LOW);
    }
    
    void loop() {
    
      waitForV1stream();
    
      //It's go time.  
      pulseIn(commandPIN, HIGH); //Skip the start bit, it is irrelevant.
    
      //Read the next 35 bits
      for(i=0; i<34; i++) {
        //Check the pulse length of the bit
        int len = pulseIn(commandPIN, HIGH);
        
        //If the length is over 240microseconds, the bit is a 1
        if(len > 240) commandStream[i] = HIGH;
        //Otherwise it is a 0
        else if(len < 240) commandStream[i] = LOW;
      }
      
      //Transmit the frame through the bluetooth modem
      sendFrame();
    
    }
    
    void sendFrame() {
      
      //Give the software the frame start pattern
      Serial.write("$FRAMESTART$");
    
      //Send the first bit
      Serial.print(commandStream[0]);  
      //Send the rest of the bit sequence
      for(i=1; i<34; i++) {  
        Serial.write(",");
        Serial.print(commandStream[i]);
      }
      
      //Give the software the frame end pattern
      Serial.write("$FRAMEEND$");
    }
    
    void sendDisconnected() {
      //The V1 is offline. Bad news, tell the software.
      Serial.write("$FRAMESTART$$NODETECT$$FRAMEEND$");
    }
    
    void waitForV1stream() {
     
      //Loop endlessly waiting for the command stream start sync pulse
      while(true) {
        //Listen for a command stream start sync pulse
        pulseLen = pulseInMax(commandPIN, HIGH, 1*1000000, 1*1000000);
    
        //Check if pulse length matched start bit
        if(pulseLen >= SYNC_BIT_MINL && pulseLen <= SYNC_BIT_MAXL)  return;
        
        //It didn't. Is the pulse driven high? If so the V1 is off and/or not signaling.
        if(pulseLen >= 500000 || pulseLen == 0) {
          //Is this the 3rd off state?
          if( i >= 3 ) {
            //It is. Report the V1's off state over bluetooth again.
            sendDisconnected();
            i=0;
          } else
             //Increment state counter
             i++;
        }
      }
    
    }
    
    
    
    /*
    
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
    
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    */
    Also, the following function needs to be added to the arduino library file wiring_pulse.c
    Code:
    unsigned long pulseInMax(uint8_t pin, uint8_t state, unsigned long timeout, unsigned long maxlen)
    {
        //NOTE: This modified function clamps pulseIn to a max time. -Nate
    
        // cache the port and bit of the pin in order to speed up the
        // pulse width measuring loop and achieve finer resolution.  calling
        // digitalRead() instead yields much coarser resolution.
        uint8_t bit = digitalPinToBitMask(pin);
        uint8_t port = digitalPinToPort(pin);
        uint8_t stateMask = (state ? bit : 0);
    
        
        // convert the timeout from microseconds to a number of times through
        // the initial loop; it takes 16 clock cycles per iteration.
        unsigned long numloops = 0;
        unsigned long pulseloops = 0;
        unsigned long maxloops = microsecondsToClockCycles(timeout) / 16;
        unsigned long maxtimeloops = microsecondsToClockCycles(maxlen) /16;
        
        // wait for any previous pulse to end
        while ((*portInputRegister(port) & bit) == stateMask)
            if (numloops++ == maxloops)
                return 0;
        
        // wait for the pulse to start
        while ((*portInputRegister(port) & bit) != stateMask)
            if (numloops++ == maxloops)
                return 0;
        
        // wait for the pulse to stop
        while ((*portInputRegister(port) & bit) == stateMask)
            if (pulseloops++ == maxtimeloops)
                return 0;
    
        // convert the reading to microseconds. The loop has been determined
        // to be 10 clock cycles long and have about 16 clocks between the edge
        // and the start of the loop. There will be some error introduced by
        // the interrupt handlers.
    
        //NOTE: From estimations adding the conditional check adds 6 cycles
        // thus "fudge factor" upped to 16. 
        return clockCyclesToMicroseconds(pulseloops * 16 + 16); 
    }
    And to wiring.h (in the same directory... ./hardware/cores/arduino/)
    Code:
    unsigned long pulseInMax(uint8_t pin, uint8_t state, unsigned long timeout, unsigned long maxlen); //added by nate


    Obligatory Gator backdrop included. GO GATORS!
    Attached Images
    Last edited by NaterGator; 03-02-2010 at 12:54 AM.
  5. Droid
    Handshake's Avatar
    Member #
    39110
    Join Date
    Feb 2010
    Posts
    41
    Phone
    Enter Current Phone Model Here
    #35
    looks absolutely amazing... if you need any help let me know... id b more then willing to do some testing with you...
  6. Droid
    Hiroller173's Avatar
    Member #
    1075
    Join Date
    Nov 2009
    Posts
    64
    Phone
    Big Bad Droid
    #36
    Interesting that Trapster isn't considering autonomous reporting. IMHO, the integration of these technologies (radar detection, GPS and cellular data transmission) will not only happen, but will be expected in the radar detection market within 5 years. The question is whether it will happen via the detector manufacturers, who will create proprietary solutions (only people with V1's will be able to see indicators from other V1's) or open solutions, which companies like Trapster are in a position to create.

    Trapster is being very short-sighted if they don't get on this soon. Grow or die!
  7. Droid
    NaterGator's Avatar
    Member #
    24267
    Join Date
    Jan 2010
    Location
    Gainesville, Fl
    Posts
    88
    Phone
    Moto Droid
    #37
    Quote Originally Posted by Hiroller173 View Post
    Interesting that Trapster isn't considering autonomous reporting. IMHO, the integration of these technologies (radar detection, GPS and cellular data transmission) will not only happen, but will be expected in the radar detection market within 5 years. The question is whether it will happen via the detector manufacturers, who will create proprietary solutions (only people with V1's will be able to see indicators from other V1's) or open solutions, which companies like Trapster are in a position to create.

    Trapster is being very short-sighted if they don't get on this soon. Grow or die!
    If I had to guess I would suggest the most likely explanation is they are already working on it or have a business partner developing something (like Trapster enabled radar detectors) and have an exclusivity contract.

    Their response was direct but polite and simply said "Trapster is not interested. Good luck." In that sense they don't seem interested in inhibiting the efforts, which is fine. Their official support was not expected when I started working on this. It would have been nice, but it's understandable.

    I'll be spending some time at the beach before I head to the keys, and it's cold so I might get some work done on the Android app. We'll see.
  8. Droid
    Handshake's Avatar
    Member #
    39110
    Join Date
    Feb 2010
    Posts
    41
    Phone
    Enter Current Phone Model Here
    #38
    any progress on this? REALLY wanting to try this out
  9. Droid
    NaterGator's Avatar
    Member #
    24267
    Join Date
    Jan 2010
    Location
    Gainesville, Fl
    Posts
    88
    Phone
    Moto Droid
    #39
    Hey,

    Sorry, unfortunately I spent most of my spring break in the keys getting tan. Now that I'm back up at school I'll put some more time into it.


    Maybe now would be a good time for people to voice their opinions.... would you rather have a list of parts to gather from distributors and do this "DIY" on breadboard/protoboard with step-by-step instructions (but buying individual stuff is up to you) or have me take the time (probably a month or more) to send off some PCBs to be made and to program some AVRs so it is a fully integrated solution (IE: you cannot tinker with it, will probably have to buy it at least partially assembled from me or buy the custom PCB from me and various parts from other channels)?

    At this stage, for example, I've resorted to using a $6.50 winford 6P6C breadboard breakout so I can just stick the phone jack into the protoboard. If I were to do a custom PCB a standard $1 6P6C jack from digikey would work, but then there will be overhead cost from me sending off to have custom PCBs printed.



    Anyways my goal is to write up a complete step-by-step and parts list for the DIY crowd or people who already have arduinos by next week. Still working on the android app, though it is coming along.
  10. Droid
    Handshake's Avatar
    Member #
    39110
    Join Date
    Feb 2010
    Posts
    41
    Phone
    Enter Current Phone Model Here
    #40
    I wouldnt mind making a kit myself... I love soldering and figuring stuff out!!!
+ Reply to Thread
Page 4 of 6 FirstFirst ... 2 3 4 5 6 LastLast

Sponsors

Posting Permissions

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

Similar Threads

  1. EMF Detector for Droid?
    By jrpowell01 in forum Android App Developers
    Replies: 19
    Last Post: 08-05-2010, 05:10 PM
  2. Metal Detector App
    By cereal killer in forum Droid Applications
    Replies: 10
    Last Post: 07-19-2010, 07:20 PM
  3. What Is The Best FREE Weather/Radar App Out There?
    By harlock in forum Droid Applications
    Replies: 39
    Last Post: 05-21-2010, 09:42 AM
  4. Radar animation in the browser????
    By tdog7879 in forum Droid General Discussions
    Replies: 12
    Last Post: 02-16-2010, 10:09 AM
  5. Can't get radar images to animate
    By kdhpga in forum Motorola Droid
    Replies: 2
    Last Post: 11-13-2009, 08:36 AM

Search tags for this page

android app radar detector
,
android police radar app
,

android radar detector

,

android radar detector app

,
best radar detector app for android
,
droid radar detector
,
police detector app
,
police radar android
,

police radar app

,

police radar app for android

,
police radar apps
,

radar detector android

,

radar detector android app

,
radar detector app
,

radar detector app android

,
radar detector app for android
,

radar detector app for droid

,
radar detector apps for android
,
radar detector droid app
,

radar detector for android

Click on a term to search our site for related topics.

Tags for this Thread