Hi
I am going to connect my pi to my arduino using i2c. I know that the pins on the pi are 3.3v and the arduino 5v so some sort of level shifter will be required on the arduino pins to protect the pi.
Assuming that a resistor voltage divider is to a good idea then can anyone suggest what ic level shifter I need to do the job and do I need one for the sda and scl lines
-
- Posts: 46
- Joined: Thu May 31, 2012 9:14 pm
- Location: UK
Re: I2c to arduino
You would be better off using something like this:
http://www.skpang.co.uk/catalog/logic-l ... p-511.html
It's bidirectional so will work for the SDA signal on i2c. In fact you don't need the two resistive dividers at all , just the two mosfet channels.
I'm using one of these between RPI and some MCP23017s running on 5V.
PeterO
http://www.skpang.co.uk/catalog/logic-l ... p-511.html
It's bidirectional so will work for the SDA signal on i2c. In fact you don't need the two resistive dividers at all , just the two mosfet channels.
I'm using one of these between RPI and some MCP23017s running on 5V.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
-
- Posts: 46
- Joined: Thu May 31, 2012 9:14 pm
- Location: UK
Re: I2c to arduino
Thanks PeterPeterO wrote:You would be better off using something like this:
http://www.skpang.co.uk/catalog/logic-l ... p-511.html
It's bidirectional so will work for the SDA signal on i2c. In fact you don't need the two resistive dividers at all , just the two mosfet channels.
I'm using one of these between RPI and some MCP23017s running on 5V.
PeterO
I have had another idea, I was going to use the arduino to run some one wire sensors but I have some DS2482-800 one wire bus devices that I believe will run at 3.3v and are i2c so I guess I could dispense with the arduino and just use these with the pi without the level shifter
Re: I2c to arduino
I wrote a 2 articles connecting the RaspberryPi to an Arduino using I2C, these might be helpful:
http://www.natmorris.co.uk/2012/09/i2c- ... ino-part1/
http://www.natmorris.co.uk/2012/09/i2c- ... ino-part2/
The next part will cover sending data from an Arduino back to the Pi.
Nat
http://www.natmorris.co.uk/2012/09/i2c- ... ino-part1/
http://www.natmorris.co.uk/2012/09/i2c- ... ino-part2/
The next part will cover sending data from an Arduino back to the Pi.
Nat
Re: I2c to arduino
Useful stuff there Nat. I'll be giving this Pi <-> Arduino stuff a try myself soon.
I'm building a board for a project that has several 23017s on it to monitor ~ 50 push buttons.
Using i2c I'll be able to connect it to my RPi or my Arduino-Mega. Hopefully the code will be very similar on both platforms.
PeterO
I'm building a board for a project that has several 23017s on it to monitor ~ 50 push buttons.
Using i2c I'll be able to connect it to my RPi or my Arduino-Mega. Hopefully the code will be very similar on both platforms.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
-
- Posts: 30
- Joined: Sun Jan 22, 2012 10:35 pm
Re: I2c to arduino
The new Arduino Due runs at 3.3 V http://arduino.cc/en/Main/ArduinoBoardDue
I am not sure, but does this mean we could wire an Arduino Due to a RaspberryPi without mosfets, level converters or that kind of staff? just wires and pull up resistors.
Thank you very much in advance
I am not sure, but does this mean we could wire an Arduino Due to a RaspberryPi without mosfets, level converters or that kind of staff? just wires and pull up resistors.
Thank you very much in advance
Re: I2c to arduino
There's no need for level shifters if both systems are 3.3V, so you can connect the RPi I2C straight to Arduino Due. I'm sure the RPi can only be a I2C master so you'll need to set the Due to be a slave.raspberrypivictim wrote:The new Arduino Due runs at 3.3 V http://arduino.cc/en/Main/ArduinoBoardDue
I am not sure, but does this mean we could wire an Arduino Due to a RaspberryPi without mosfets, level converters or that kind of staff? just wires and pull up resistors.
Tony
Re: I2c to arduino
As both 3V3 just connect them together and ensure Arduino Due set as slave with NO pullup resistors.raspberrypivictim wrote:The new Arduino Due runs at 3.3 V http://arduino.cc/en/Main/ArduinoBoardDue
I am not sure, but does this mean we could wire an Arduino Due to a RaspberryPi without mosfets, level converters or that kind of staff? just wires and pull up resistors.
Thank you very much in advance
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
or http://www.pcserviceselectronics.co.uk/pi/