Go Down

Topic: IC2 Scanner stops and finds nothing (Read 2410 times) previous topic - next topic


Jan 13, 2013, 06:13 pm Last Edit: Jan 13, 2013, 06:21 pm by AnAmuser Reason: 1

I have a SRF10 range measure thing connected to my Arduino UNO as shown on the attached image. The specs can be found at http://www.acroname.com/robotics/parts/R241-SRF10.html
  - 5v to +
  - Ground to -
  - SDA to A4
  - SCL to A5

I have tried the example program for SRFxxx provided with the Arduino IDE. That did not work. The program stopped at Wire.endTransmission(); and did not go any further.

Then i thinked that it might be the adress that was wrong. Therefore I found a IC2 scanner, which unfortunatly also stops at this point. The output of the program below is

I2C Scanner

, so this also stops at Wire.endTransmission();

Code: [Select]
#include <Wire.h>

void setup()

 Serial.println("\nI2C Scanner");

void loop()
 byte error, address;
 int nDevices;


 nDevices = 0;
 for(address = 0; address <= 127; address++ )
   // The i2c_scanner uses the return value of
   // the Write.endTransmisstion to see if
   // a device did acknowledge to the address.
   error = Wire.endTransmission();

   if (error == 0)
     Serial.print("I2C device found at address 0x");
     if (address<16)
     Serial.println(" !");

   else if (error==4)
     Serial.print("Unknow error at address 0x");
     if (address<16)
 if (nDevices == 0)
   Serial.println("No I2C devices found\n");

 delay(8000);           // wait 8 seconds for next scan

Can you help me find out why things just stops.


I have a SRF10 range measure thing connected to my Arduino

Take a peek at the Products tab on the home page. Count how many different Arduino models there are. Now, which of them have I2C on pins A4 and A5? All of them? No.

So, which model do you have? Are you using the analog pins 4 and 5? A very common mistake is to use digital pins 4 and 5, since I2C is not an analog function.
The art of getting good answers lies in asking good questions.


Jan 13, 2013, 06:54 pm Last Edit: Jan 13, 2013, 07:09 pm by Headroom Reason: 1
If one would look at the photo, which is incredibly easy to do, particularly by a poster with well over 30000 posts, in that case the UNO logo practically stares one in the face ;-)

The UNO has the The I2C pins on Analog Pins 4 & 5.

I2C problems are easiest to track down with an Oscilloscope. I have not looked and the spec sheet, however, are you sure you have pull-up resistors on the SCA and SCL lines ?

Just could not shut my big mouth and missed the pull- up resistors also staring in my face ;-)

Bad contacts are a common issue with breadboards. If you have a multimeter, check at least that electrically everything is OK. 5V power at the sensor and signals at SCA and SCL. Then you can look at the software. Wiring looks OK to me and " should" work.



Cool  :).

I just re-positioned the whole thing down one point on the bread board and now it works.

So the breadboard is not working 100%.


It looks to me from the photo you had the device on one side and the wires on the other.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics


Jan 13, 2013, 10:51 pm Last Edit: Jan 13, 2013, 10:57 pm by Docedison Reason: 1
Many bread boards fail for that reason. frequently re-positioning or pulling out parts and replacing them is required to make them work. Itusually is caused be corroded component leads. I've used LPS (a marine spray lubricant and contact cleaner) on really bad ones, works a charm. @ Nick, The SIRF device has those long R/A pins on it, it does plug into the right places.

--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard


It looks to me from the photo you had the device on one side and the wires on the other.

I agree, you can see the SRF10 is plugged into one side of the centre divider the the wires in the other side. Well spotted Nick.
Don't PM me for help as I will ignore it.

Go Up