1

I'm developing an computacional module to create risk maps in agriculture, I am using one arduino mega as "GreenSeeker", generating "fake" data to transmit via RS232 connection to one Raspberry PI, where she is process the data and generate the maps with GPS coordinates.

But, I have this cable.

enter image description here

I need to transmit data throught Arduino mega, and catch this data in the Raspberry PI.

I`ve have doubt about where connect the Serials pins on Arduino, the USB go on connect on the Raspberry PI USB, and the Serial go on Arduino, i need the right pins and where to connect them, and some code example.

  • Do you need a full 9 pin connection with hardware handshaking, or just an Rx/Tx? The latter is a simple affair with just a bit of soldering, but the former is going to be an ordeal. – RubberDuck Jan 5 '17 at 19:27
  • Please edit the question and add an explanation of whatever might be the meaning of “I need connect the Raspberry PI in one GreenSeeker, and the connector of this machine uses RS232 connection” – James Waldby - jwpat7 Jan 5 '17 at 20:41
  • better this way? – user29740 Jan 5 '17 at 21:06
  • The device pictured in the question Must Never be directly connected to a modern Arduino, as it uses RS232 levels, while an Arduino can only tolerate lower voltage "logic level" serial signal which are additionally inverted in sense. Essentially you bought the wrong cable, and getting an adapter to make it work will be more awkward and expensive than getting the right cable. – Chris Stratton Jan 6 '17 at 1:39
  • You can indicate me the right cable? – user29740 Jan 6 '17 at 1:43
1

I think you just want a normal USB A-B cable, exactly like you'd use on a PC.enter image description here

You probably could use the cable you picture, but you'd need a female DB-9 connector. If you really want to do that for some reason, you need to connect the Tx pin on the DB-9 (pin 2) to the Rx pin on the Mega, and the Rx pin on the DB-9 (pin 3) to the Tx pin on the Mega.

  • I really want to do that, because, I need connect the Raspberry PI in one GreenSeeker, and the connector of this machine uses RS232 connection. – user29740 Jan 5 '17 at 18:52
  • @Avoxy way to spin this question and suddenly add other info. Where does the Mega come in? You can connect the greenseeker via this usb-to-rs232 adapter directly to the Pi. – Gerben Jan 5 '17 at 19:24
  • I is using arduino to simulate the GreenSeeker data, i am is on University holidays, and the GreenSeeker machine is available only in my university, which is in other city. – user29740 Jan 5 '17 at 20:58
  • The cable pictured in the this answer has possibility, but the one pictured in the question cannot and must not be used without an inverting level translator. Attempting to use it without will destroy the Arduino. – Chris Stratton Jan 6 '17 at 1:41
  • 1
    @ChrisStratton Do you believe they run at full RS232 voltages? I suppose one should presume they might - but in reality I think many of them run at 5v. But it's a fair point - Avoxy, you should definitely check before you connect it. – Mark Smith Jan 6 '17 at 12:09

Your Answer

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