1

Recently, I have been trying to build a project where I need to connect an ev3 to a raspberry pi. I have decided doing it by i2c after reading (and successfully replicating) an article about connecting an ev3 to arduino by i2c https://www.dexterindustries.com/howto/connecting-ev3-arduino/. However, after setting it up with raspberry pi, I realized a huge problem that I am facing, both of these devices acted as masters and I could not get them to connect to each other.

So, I decided to use an Arduino between those two which transports the data that it receives to the other device, which I couldn't get working. I have no idea how to get it working anyways, it was just a hopeless try.

Is such a project possible or should I just give up? If I should, what type of communication do you suggest that I use?

If you know any way of putting the Raspberry Pi into the slave mode, I would really appreciate if you share it.

Aurora0001
6,3773 gold badges25 silver badges39 bronze badges
asked Jun 10, 2018 at 23:35
4
  • I'm using TCP over USB to connect to my EV3. It allows me to ssh into EV3, it's a level I feel more comfortable with than i2c. Commented Jun 11, 2018 at 9:08
  • What exactly is an ev3 Commented Jun 11, 2018 at 17:10
  • What exactly did you "successfully replicate"? Commented Jun 21, 2018 at 7:00
  • Lego Mindstorms EV3. Commented Feb 19, 2020 at 5:04

1 Answer 1

1

pigpio has limited support for the Pi to act as an I2C slave.

See http://abyz.me.uk/rpi/pigpio/python.html#bsc_i2c

That example is Python.

Note that when acting as a slave device you need to use GPIO 18 (SDA) and GPIO 19 (SCL). You also need to fit external pull-ups to 3V3. For reference the ones on GPIO 2/3 are 1k8 pull-ups to 3V3.

If you look through the documentation you will see several examples in C, Python, and the command line (pigs).

It is what it is - that means you will have to work around its limitations or find another solution.

See my post for background information and a usage example.

answered Jun 11, 2018 at 7:22
2
  • Wow, thanks man, you literally saved my life, though I need to ask, can I connect 43 K to 4.7 V since that worked with arduino. Sorry for the noob question, I am quite new to electronics. Commented Jun 11, 2018 at 7:35
  • I do not know what you mean by 43 K to 4.7 V. Remember ALL the Pi GPIO are only tolerant to a voltage between 0 and 3.3V. Anything outside those limits risks damaging the GPIO and the Pi. Commented Jun 11, 2018 at 10:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.