Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need Guidance with HB100 radar SENSOR AND Arduino code (Vehicle speed Detector)

Status
Not open for further replies.

Osagie

New Member
Hello, I am working on a vehicle speed detection system using the hb100 doppler radar sensor. I am simulating on proteus first before I start the construction process, i couldn't find the library of the hb100 sensor to add unto proteus, so i made use of an astable circuit to act as the HB100 sensor. I also added an led and an oscilloscope to display output of the astable circuit, which is also connected to the amplifier circuit. I found a code to use, but I noticed that when I connect my astable cct output to the amplifier cct the LCD display is empty(No output shown). However on connecting my astable cct directly to the Arduino digital pin 8 my frequency and speed are displayed. The questions i need to ask are.
1. Why is my output not displaying when I connect my astable cct to the amplifier cct.
2. I want to make modification to the code to display "Ovr Spd" when the speed is above 50km/hr and "Norm Spd" when speed is equal and less than 50km/hr.

Screenshot 78-82 are with amplifier cct and no output display.
Screenshot 83-85 are without amplifier cct and output display.
screenshot 86 is a clear view of the amplifier cct.

Note: I recently changed my 5v battery to 9v to test something.

I am new to coding and cct design. I will appreciate all the help I can get. Thanks
 

Attachments

  • Screenshot (78).png
    Screenshot (78).png
    140.4 KB · Views: 935
  • Screenshot (79).png
    Screenshot (79).png
    140.5 KB · Views: 566
  • Screenshot (80).png
    Screenshot (80).png
    119.3 KB · Views: 533
  • Screenshot (81).png
    Screenshot (81).png
    180.7 KB · Views: 488
  • Screenshot (82).png
    Screenshot (82).png
    234.4 KB · Views: 515
  • Screenshot (83).png
    Screenshot (83).png
    140.3 KB · Views: 564
  • Screenshot (84).png
    Screenshot (84).png
    119.1 KB · Views: 566
  • Screenshot (85).png
    Screenshot (85).png
    224 KB · Views: 522
  • Screenshot (86).png
    Screenshot (86).png
    139.7 KB · Views: 738
Hello, I am working on a vehicle speed detection system using the hb100 doppler radar sensor. I am simulating on proteus first before I start the construction process, i couldn't find the library of the hb100 sensor to add unto proteus, so i made use of an astable circuit to act as the HB100 sensor. I also added an led and an oscilloscope to display output of the astable circuit, which is also connected to the amplifier circuit. I found a code to use, but I noticed that when I connect my astable cct output to the amplifier cct the LCD display is empty(No output shown). However on connecting my astable cct directly to the Arduino digital pin 8 my frequency and speed are displayed. The questions i need to ask are.
1. Why is my output not displaying when I connect my astable cct to the amplifier cct.
2. I want to make modification to the code to display "Ovr Spd" when the speed is above 50km/hr and "Norm Spd" when speed is equal and less than 50km/hr.

Screenshot 78-82 are with amplifier cct and no output display.
Screenshot 83-85 are without amplifier cct and output display.
screenshot 86 is a clear view of the amplifier cct.

Note: I recently changed my 5v battery to 9v to test something.

I am new to coding and cct design. I will appreciate all the help I can get. Thanks

C++:
/* FreqMeasure - Example with LCD output
   http://www.pjrc.com/teensy/td_libs_FreqMeasure.html

   Slightly modified by @3zuli for use with HB100 doppler radar module

   This example code is in the public domain.

   Frequency input pin: 8. Connect the IF pin from the preamp board to this pin.
   This should work with Arduino Uno, Nano, Pro mini and simillar.
   For other boards, see the FreqMeasure documentation (link above).

   16x2 character display is connected exactly as in the LiquidCrystal library examples:
   LCD RS pin to digital pin 12
   LCD Enable pin to digital pin 11
   LCD D4 pin to digital pin 5
   LCD D5 pin to digital pin 4
   LCD D6 pin to digital pin 3
   LCD D7 pin to digital pin 2
   LCD R/W pin to ground
   10K resistor:
   ends to +5V and ground
   wiper to LCD VO pin (pin 3)
*/


#include <FreqMeasure.h>
//#include "FreqMeasure/FreqMeasure.h"
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
  Serial.begin(57600);
  lcd.begin(16, 2);
  lcd.print("Freq:");
  lcd.setCursor(10, 0);
  lcd.print("Speed:");
  FreqMeasure.begin();
}
double sum = 0;
int count = 0;
void loop() {
  if (FreqMeasure.available()) {
    // average 30 readings together
    sum = sum + FreqMeasure.read();
    count = count + 1;
    if (count > 30) {
      float frequency = FreqMeasure.countToFrequency(sum / count);
      float spd = frequency / 19.49; //conversion from frequency to kilometers per hour (sorry, imperial guys :)
      //to improve speed, we update only the bottom row of the LCD
      lcd.setCursor(0, 1);
      lcd.print("                ");
      lcd.setCursor(0, 1);
      lcd.print(frequency);
      lcd.print("Hz");
      //lcd.print("       ");
      lcd.setCursor(8, 1);
      lcd.print(spd);
      lcd.print("km/h");
      sum = 0;
      count = 0;
       if(spd > 50){lcd.print("Ovr Spd");}
            else{lcd.print("Nor Spd"); }
    }
  }
}
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top