I've been struggling with some code that was failing to "begin()" any devices on my i2c bus. I've uploaded a scanner program from arduino playground which lists the addresses of any i2c modules found. With a single sensor connected the whole arduino freezes but when I unplug the wires from the a4 and a5 pins it continues. Plug them back on and it locks. I've tried with the SDA / SCL wires reversed as I've seen mention of things being backward.

Anyone know what I'm missing?

  • Maybe missing pull-ups? – Sim Son Apr 16 '19 at 15:56
  • So I've watched a video on pullups and what they do but I can't find anything about specifically what I need to do on the Nano. Am I using internal pullups on the 5v pin connecting the I2C devices or am I changing something on A4 or A5? – Stephen York Apr 16 '19 at 16:00
  • I don't know if the nano has internal pullups, just try adding extra 4k7 as it's a simple thing to do – Sim Son Apr 16 '19 at 16:08
  • If it still freezes, determine the voltage on scl in a stucked state. If possible, monitor scl with an oscilloskope – Sim Son Apr 16 '19 at 16:09
  • Sorry, my electronics knowledge is limited let alone integrating with microcontrollers.So far I've managed to build this device with all my modules plugging straight onto sda/ scl and voltage pins with little theory required. What do I connect with the 4.7k ohm resisotor to, is it between the voltage pin (in this case 3.3v) and SCL? – Stephen York Apr 16 '19 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.