sketch written using uno does not work on nano

Hy

I'm working on a project involving communication between a Lidar lite sensor and a lego mindstorms EV3. First I used an arduino uno for testen my code, but now that my code works I tried to use instead an arduino nano however it seems not to work anymore.

I use an arduino nano with ATMEGA328P so in fact it should be the same as an arduino uno.
The arduino microcontroller uses I2C communication between the Lidar lite and UART between the EV3,
but it seems like the arduino nano cannot receive data anymore from the EV3. Does somebody maybe know where the problem may lie?

I connected my EV3 to the arduino uno by using the digital pins 10 and 11 (10 as Rx of the arduino and 11 as Tx). And I used the SDA and SCL for the connection with the Lidar lite sensor.
However for using the arduino nano I use the same digital pins (10 and 11) but now I have found from the internet that I have to use the analog pins A4 and A5 (A4 being the SDA and A5 being the SCL).

I also have the grounds connected.

I also tried to find whether the problem might be a too low voltage. I measured an voltage (when the board and EV3 is doing nothing but the board is connected to my laptop) of around 4.73V on the D10 and D11 pins of the arduino nano while for the arduino uno this voltage is around 5.03V. Is this maybe the problem that the voltage is too low for the arduino to recognize the communication comming from the EV3?

Thanks

(deleted)

No there are no resistors connected to the I2C bus, but I don't see why that would be a problem since it worked with an arduino uno. And it is especially the UART communication that does not work (I have not yet tested the I2C communication). But there is however an resistor connected between the 5V pin and the digital pin 2 (I don't think that that could cause any problem).

Hi,
Does your UNO have separate SCL and SCA pins.

If so they are connected to A4 and A5, your board, just out of convenience provides an extra pair of pins to use.

Tom.. :slight_smile:

Yes my uno has seperate SDA and SCL pins, but that I already knew.

I think that I found my problem, when I used another nano microcontroller (one where nothing is connected to), then it does work. So that would mean that there are 2 possibilities why it didn't work with my previous nano microcontroller:

  1. the microcontroller might be broken?
  2. the resistor which is connected to pin 5V and pin D2 causes this trouble?

I also measured the voltage that is delivered with my new nano microcontroller on the 5V pin, and this voltage is even lower than for the previous one. The voltage now is only around 4.3V

Anything above 3.8V is sufficient for 16 MHz operation.

The High voltage on an input pin from another source needs to be >= 0.6 x Vcc. If the EV3 is outputting levels of at least 3V to meet Vcc of 5V, then the lower voltages will be satisfied as well (4.7V, 4.3V).

Found the problem. The problem did not lie with the arduino nano, but instead with the breadboard where it was mounted on.
Thanks for the help