Have you ever walked into the supermarket and wondered how that automatic door opening sensor works? Well its not a camera, its a microwave doppler radar sensor. These sensors send out a high frequency wave which bounces off nearby objects. If any nearby objects are moving, the sensor is able to notice that the reflected waves have a different frequency due to the doppler effect. The innerds of these sensors are widely available to electronics hobbyists and cheap versions can be found on eBay under the names CDM324 and HB100 for just a few dollars each. Although cheap, the output of the sensors is difficult to work with. The sensors output a sine wave whose frequency and amplitude changes depending on the object's speed and reflection. Various DSP algorithms can be used to process this signal into useful information but the programming is not trivial and a simple controller like the Arduino is hardly fast enough to do the job. Analog circuits guru Dale Heatherington came up with a circuit that amplifies and filters the sine wave and outputs an analog value that represents the intensity of the returned signal. This analog voltage can be easily read by an Arduino. Setting a threshold value in the software would let the Arduino quickly decide if an object is there and to take action. Putting two of these sensors together would allow an Arduino to compare the two signals and decide which direction the signal is coming from. With such a sensor mounted to the front of a moving robot, the robot could sense objects in the way and decide which way to turn. My contribution to this endeavor was to take Dale's circuit and turn it into a compact breakout board. Two copies of the circuit are on one board, and there are mounting points where two of the 24GHz style sensors (CDM324, IPM165) can be directly mounted to the board. Connections to the breakout board are as follows:
The analog output connections will output an analog voltage determine by the strength of the reflected 24 GHz wave off any nearby object moving towards or away from the sensor. The analog pins must be connected to a high impedance load such as a microcontroller analog input pin. The digital output connections will output pulses at a frequency determined by the speed that the nearby object is moving towards or away from the sensor. For a 24 GHz sensor, the frequency of the pulses will be about 72.3 Hz per MPH of the moving object. Any of the analog or digital output pins can be left unconnected if not used. Schematic Layout - Top Layout - Bottom (as viewed from the top) Parts List
Resistors R1 and R2 are optional. Note from the schematic that R1 and R2 are in parallel with R8 and R4, respectively. Leaving these off will result in a high gain amplifier circuit that may sense objects up to 20ft away. For indoor robotic application it is often better to limit the sensing range to a few feet. Setting R1 and R2 equal to 470k is a good starting point, but your results may vary. Lower values of R1 and R2 will result in a shorter sensing distance. I'm sure many of the above components could be substituted but I haven't made any effort to investigate this. The LMC6484 is a great op-amp but is definitely not cheap. Any decent voltage comparator should work fine in place of the TLC3702, I just happened to have one leftover from my Analog Line Follower project. The DMP2305 is also overkill for the PFET as the radar sensors only draw about 50ma each and much less than that for the rest of the circuit. Capacitor C7 is probably unnecessary but you never know when you might end up sharing a power supply with one of those noisy SharpIR distance sensors. The graph below shows the analog output of the breakout board using two sensors being read by an Arduino and plotted using the Serial Plotter tool. The code below can be used to create a graph like that shown above. It also calculates the difference between the two signals averaged over time. This value diffAvg can be used to determine whether an object is seen on the right or left side. // This demo code shows how to use two microwave dopper radar sensors to determine the direction of a moving object // The difference in signal intensity returned from two CDM324 sensors is computed and averaged over time // This requires each CDM324 to be connected to Dale Heatherington's circuit shown at // http://www.wa4dsy.com/robot/radar-motion-detector // This was tested using the CDM324, although the HB100, IPM165, IPM365 should also work void setup() { Serial.begin(9600); } void loop() { // Define a location to store a running log of differential sensor readings static unsigned int difference[16]; for(int i = 15; i > 0; i--){ difference[i] = difference[i-1]; } // Take the readings from the CDM324 sensors unsigned int leftIn = analogRead(A1); unsigned int rightIn = analogRead(A2); // Compute the difference difference[0] = 512 + leftIn - rightIn; // Compute the average of the differences unsigned int diffAvg = 0; for(int i = 0; i < 16; i++){ diffAvg += difference[i]; } diffAvg = diffAvg >> 4; // Print to Serial Port. Can be viewed with Serial Plotter by hitting Ctrl + Shift + L (Arduino 1.6.7 or newer) Serial.print(leftIn); Serial.print(" "); Serial.print(rightIn); Serial.print(" "); Serial.print(diffAvg); Serial.print(" "); Serial.println(512); } The .sch and .brd files are attached below. |