1

I know it is possible to use arduino as usb to serial converter https://www.youtube.com/watch?v=qqSLwK1DP8Q). And I know it is possible to communicate with raspberry console from laptop over serial cable (https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/overview).

I have RPi, arduino, 3 equal resistors and breadboard. I want to compose serial cable replacement from the parts I have to communicate from laptop to my raspberry pi console. Is that possible? How to achieve that?

  • that adafruit link doesn't work for me. is this the same resource? learn.adafruit.com/downloads/pdf/… Also, just to clarify are you wanting to go laptop-usb-arduino-serial-pi or lapatop-serial-arduino-usb-pi, both are possible – paddyg Jun 8 '15 at 10:08
  • I want to connect this way: laptop usb - arduino usb; arduino serial - RPi serial – gerkirill Jun 8 '15 at 10:19
  • P.S. PDF you mentioned is exactly the same (that adafruit webpage seems down right now). – gerkirill Jun 8 '15 at 10:29
2

Arduino setup

  1. Make sure Arduino is not powered - we will power it later.
  2. Connect the RESET pin on the Arduino, to the GND pin on the Arduino. This isolates the processor from the IO-pins, so it does not mater if you have some sketch uploaded to your Arduino.

Wiring it all together

  1. Connect Arduino GND to RPi GND
  2. Connect Arduino TX directly to RPi XT
  3. Connect Arduino RX to RPi RX using voltage divider
  4. Connect Arduino to your laptop with USB cable
  5. Power your RPi if you haven't already done so

Voltage divider

Voltage divider allows to connect 5v output of Arduino RX pin to 3v RPi RX pin. This can be done for example with 3 equal resistors. You just need to connect them in series between Arduino RX and Arduino GND. Then you should connect RPi RX to the point shown below:

RX o --| R1 |-- o --| R2 |-- o --| R3 |-- o GND
                ^
             RPi RX

Accessing RPi serial console

Using Arduino IDE

  1. In arduino IDE go Tools -> Serial monitor
  2. In serial monitor window - select "Newline" as line ending and "115200 baud" rate
  3. Press "Send" button - this will send newline to RPi serial console and you'll get login prompt

Using Putty on Windows

  1. Check "Serial" connection type under "Session"
  2. Enter your COM port name into "Serial line" input (e.g. "COM3" - you can look into device manager to find it out)
  3. Enter "115200" into "Speed" input
  4. Press "Open" button, this will open new empty console window
  5. Press enter in console window and you'll be presented with login prompt
1

Some quite explicit instructions here, many others via google search "GPIO serial Raspberry Pi arduino"

http://blog.oscarliang.net/raspberry-pi-and-arduino-connected-serial-gpio/

If you knew before you purchased your arduino that you might need to do this you could have got one with 3V3 logic and avoided the logic level converter (three equal resistors won't be enough) But you can probably buy one on ebay for very little.

EDIT - thinking about it, you probably could use two of your resistors in parallel as the lower resistor and the third as the higher resistor of the voltage divider on the oscarliang.net page

  • That's not what I want. The article you mentioned is about communication between arduino and RPi over serial port. But I want co connect my laptop running windows and putty to RPi serial console using arduino. That's not the same. – gerkirill Jun 8 '15 at 13:43
  • You would need some code on your aduino to read from an IO pin and write to USB and read from USB and write to a different IO pin. You will have to not use the standard tx, rx (pin 0, 1) as in that webpage and you would also need to load SoftwareSerial for communicating with the RPi. I'm sure someone will have done exactly what you are attempting if you search around. – paddyg Jun 8 '15 at 15:36
  • thx. for your efforts, paddyg. I've finally found out how to accomplish my task, will describe it in an answer to my own question – gerkirill Jun 8 '15 at 18:16

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.