0

I am using a Raspberry Pi to send data to an Arduino Nano using I2C and it was working fine by just connecting the SDA, SCL and GND pins together from the Pi and the arduino.

I then tried to get data to be sent back to the Pi from the Arduino and ever since then I get an errno 110 when I run my python code on my Pi. I have tried the I2C detect tool on the Raspberry Pi and it will work fine straight after you have reset the Arduino, showing the Arduino on the 0x07 port. However when I try doing it for a second time it takes a very long time to scan each serial port and when it gets to the 0x07 port it shows that there is nothing on that port.

Does this mean I have fried my I2C port? If so is there any alternative GPIO pins which I could use? I now have 2 voltage level shifters which I would use.

Code:https://github.com/mbh1620/Autonomous-Car-Code/blob/master/ArduinorecievecodeV2.ino and https://github.com/mbh1620/Autonomous-Car-Code/blob/master/HMI.py

  • I now have 2 voltage level shifters - does that mean you didn't before? – Jaromanda X Nov 13 '18 at 21:39
  • Yes I had the Pi connected directly into the Arduino. I now realise that the Arduino runs off 5v logic and the raspberry is 3.3v but I read somewhere that you do not need logic level shifters if you are running the raspberry pi as a master. – mbh16 Nov 13 '18 at 22:11
  • Try some PARAGRAPHS! – Milliways Nov 13 '18 at 23:12
0

You have not asked an answerable question (no code, no connection details, just an incomplete error message).

However I will answer your I²C question.

Assuming the I²C does not have pullups you can connect 5V devices to the Pi without level shifters - the Pi has on-board pullups. (The unspecified Arduino should NOT have pullups.)

BUT the Pi voltage levels may be marginal; I have used the Pi with many 5V devices using I²C (not an Arduino - there are better ways of interfacing to the Arduino).

You MAY or may not have damaged the Pi though other causes. You should TEST the GPIO pins NOT using I²C there are tools to do this (search this forum).

  • Yes I am away from the raspberry pi and the Arduino at the minute so can't give the exact code/wiring diagrams. I will have a look for a pin testing program. What better ways are there to interface to the Arduino? Is SPI fairly straightforward to use in terms of the python code used? – mbh16 Nov 13 '18 at 23:51
  • @mbh16 There is no "better" - any solution to an engineering problem needs to be appropriate for the requirements and different solutions have different characteristics. I²C is, in fact, a poor solution - it is designed for short range on-board communication. – Milliways Nov 14 '18 at 0:09
  • Ok so if the I2C ports are damaged which method would you then recommend? – mbh16 Nov 14 '18 at 0:12
  • @mbh16 You specify your requirements (edit into your Question) and I may be able to make a sensible comment. – Milliways Nov 14 '18 at 0:14
  • So i worked out that the I2C port hadn't been fried as I connected a different I2C device which runs on 3.3V and it showed up on the I2C detect. I need to still work out why the arduino won't work with I2C. Maybe it might be a coding issue. – mbh16 Nov 17 '18 at 15:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.