This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control Arduino through UART txd rxd
#1
I am not yet sure if this is possible, but I was wondering if I can remove the USB cable and go for a more solid connection between the pi and the arduino.
So, my question is, will the motor.ino and pypilot still work when connecting them both through txd / rxd pins? Or does it only work with USB.
I've tried it before, and have set the serial port accordingly in op, but it didn't work then. Tried looking for documentation and see that UART is mentioned, but usually I see that most people use the USB connection.

Looking for some confirmation of some working examples without USB.

Thanks in advance.
Reply
#2
(2020-04-25, 11:08 AM)jamos.tan@gmail.com Wrote: I am not yet sure if this is possible, but I was wondering if I can remove the USB cable and go for a more solid connection between the pi and the arduino.
So, my question is, will the motor.ino and pypilot still work when connecting them both through txd / rxd pins? Or does it only work with USB.
I've tried it before, and have set the serial port accordingly in op, but it didn't work then. Tried looking for documentation and see that UART is mentioned, but usually I see that most people use the USB connection.

Looking for some confirmation of some working examples without USB.

Thanks in advance.

I have Tynipilot runnig without usb .... an arduino mini pro ... rx tx and common ground to the pi zero.
RX of the Pi goes direct to TX of te arduino and vice versa.

Take care that this only is ok if your arduino mini pro is 3.3 v if you use the 5v o e you might need an power diverter like explained from IRONMAN further down

Greetings 
Andreas
Reply
#3
For my prototype, I used a USB cable (look for the blue wire):

      

Since the RPi and nano are in the same box, I felt using the USB cable wouldn't have electrical problems in the short term.

Since then I've made a PCB, and I'm using a chip which provides isolation, and level shifts from RPi's 3.3V to the Arduino nano's 5V (top right corner, circled):

      

@seandepagnier's design uses a CPC5001 (U1 on page 2):

  http://pypilot.org/schematics/hbridge_controller.pdf

I'm using an Si8621, because it's cheaper and easier to get.

  https://au.element14.com/silicon-labs/si...dp/2423245

The RPi and nano are talking through the Si8621 just fine.
Reply
#4
Thanks! That pcb looks great btw. Smile
Reply
#5
(2020-04-25, 11:08 AM)jamos.tan@gmail.com Wrote: Looking for some confirmation of some working examples without USB.

If you don't care about isolation you can simply tie the Pi's TxD output to the arduino's RxD, and tie the arduino's TxD to the pi's Rxd with a simple voltage divider. Remember the pi i/o is 3.3 Volts and the arduino's i/o is 5 volts based. I have this and it works - so far.

[Image: resistive-logic-downshifter.png?resize=210,250]
Reply
#6
Great work!

I did try a few isolation parts and settled on cpc5001 because it worked well and the other parts I tried did not work. I did try a few rf modulated but the higher data rates are also not needed. Now that my quantities are higher, paying $2.50 for each cpc5001 is a lot and I'm going to try other parts (cost 30 cents for each direction) and also use much less power. The si8621 if it works is a great choice, but it also uses 2-3 milliamps correct?
Reply
#7
(2020-05-04, 01:25 PM)Hi, I have tried the same simple approach to connecting my Arduino Uno to my RPi 3 but cannot get the two to communicate.   I wrote a simple sketch to copy received data from the RPi to the serial port but it does not make much sense eg:C7FFFFFFE83FFFFFF9D712E4739FFFFFFC7FFFFFFE83FFFFFF9D6800FFFFFF92FFFFFF9101E20FFFFFFC7FFFFFFE83FFFFFF9DFFFFFFC7FFFFFFE83FFFFFF9D6800FFFFFF921EFFFFFFBE2FFFFFF86FFFFFFC7FFFFFFE83FFFFFF9DFFFFFFC7FFFFFFE83FFFFFF9D6800FFFFFF92FFFFFFC7FFFFFFE83FFFFFF9DFFFFFFA4FFFFFF8717FFFFFF97FFFFFFC7FFFFFFE83FFFFFF9D6800FFFFFF925AFFFFFF8717FFFFFF9AFFFFFFC7FFFFFFE83FFFFFF9DFFFFFFC7FFFFFFE83FFFFFF9D1EFFFFFFBE2FFFFFF866800FFFFFF92FFFFFFC7FFFFFFE83FFDoes anyone have a description of what the data packets should look like? Wrote: If you don't care about isolation you can simply tie the Pi's TxD output to the arduino's RxD, and tie the arduino's TxD to the pi's Rxd with a simple voltage divider. Remember the pi i/o is 3.3 Volts and the arduino's i/o is 5 volts based. I have this and it works - so far.

[Image: resistive-logic-downshifter.png?resize=210,250]
Reply
#8
(2020-05-05, 05:53 PM)seandepagnier Wrote: The si8621 if it works is a great choice, but it also uses 2-3 milliamps correct?

Yeah.  My reading of the CPC5001 and Si8621 say they both draw between 2-5mA, with the Si8621 using somewhat less.
Reply
#9
I have this board for isolation: https://www.sparkfun.com/products/9118
I've connected it, and tested the input and outputs, and properly converts the 3v 5v range.

Only thing is, Pypilot does not talk to it and does not report the Sync status.
So, I've checked the baudrate of the opto board and it is maximum 9600.
So in the motor.ino sketch there is a line "Serial.begin" which has the value 38400.

Should I decrease the motor.ino baudrate to 9600?
I've also tested changing the txd rxd wires.
Reply
#10
(2020-10-05, 12:31 PM)jamos.tan@gmail.com Wrote: I have this board for isolation: https://www.sparkfun.com/products/9118
So, I've checked the baudrate of the opto board and it is maximum 9600.
I think optoisolator chips like that are ok for isolation of control signals, but too slow for communications.  As mentioned above, I've used the Si8621 with no problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)