Go Down

Topic: SRF08 Max Analogue Gain (Read 70 times) previous topic - next topic

Johazzz

Can somebody please explain what does it mean by Max Analogue Gain, how does it work in SRF08 and how do you decide which of it to use? Help.

Much appreciated!

TomGeorge

Hi,
To get answers about specs you need to post the spec or a link.

http://www.robot-electronics.co.uk/htm/srf08tech.shtml

The maximum analog gain refers to the gain of the ultrasonic receiver.
It is chosen to help stop stray reflections from previous pings from begin detected.

As the time from the ping transmit increases, the receiver automatically becomes more and more sensitive (gain goes up), as the the longer time for the return echo will mean it will be weaker to detect.

If you are getting spurious measurements from the detector, it may be from objects way in the background of the object you are aiming to detect, these returns will however be a lot weaker than expected.

You can, by adjusting the Max Gain for your application, if you have false readings, to lower the gain and make the receiver not detect the weaker signal.

I hope that makes sense.

Tom..... :)
Everything runs on smoke, let the smoke out, it stops running......VK3DMK

Johazzz

You can, by adjusting the Max Gain for your application, if you have false readings, to lower the gain and make the receiver not detect the weaker signal.

I hope that makes sense.

Tom..... :)
But how to adjust the Max Gain in my coding? Do i have to add a few more coding or change anything?
Here's the attached code:
Code: [Select]

#include <Wire.h>

byte highByte = 0x00;
byte lowByte = 0x00;

void setup()
{
  Wire.begin();                // join i2c bus (address optional for master)
  Serial.begin(9600);          // start serial communication at 9600bps
}

int reading = 0;

void loop()
{
  // step 1: instruct sensor to read echoes
  Wire.beginTransmission(112); // transmit to device #112 (0x70)
                               // the address specified in the datasheet is 224 (0xE0)
                               // but i2c adressing uses the high 7 bits so it's 112
  Wire.write(byte(0x00));      // sets register pointer to the command register (0x00) 
  Wire.write(byte(0x51));      // command sensor to measure in "inches" (0x50)
                               // use 0x51 for centimeters
                               // use 0x52 for ping microseconds
  Wire.endTransmission();      // stop transmitting

  // step 2: wait for readings to happen
  delay(70);                   // datasheet suggests at least 65 milliseconds

  // step 3: instruct sensor to return a particular echo reading
  Wire.beginTransmission(112); // transmit to device #112
  Wire.write(byte(0x02));      // sets register pointer to echo #1 register (0x02)
  Wire.endTransmission();      // stop transmitting

  // step 4: request reading from sensor
  Wire.requestFrom(112, 2);    // request 2 bytes from slave device #112

  // step 5: receive reading from sensor
  if(2 <= Wire.available())    // if two bytes were received
  {
    highByte = Wire.read();  // receive high byte (overwrites previous reading)
                             
    lowByte = Wire.read(); // receive low byte as lower 8 bits
    reading = (highByte << 8) + lowByte;
    Serial.println(reading);   // print the reading
  }

  delay(250);                  // wait a bit since people have to read the output :)
}

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy