how to transmit data serially from Raspberry Pi to Arduino through USB cable?
Show older comments
Basically, my objective is to: Take a snapshot from an USB camera connected to Raspberry Pi and detect a particular object and followed by some calculations, serially transmit a 1x3 vector to Arduino Uno through USB cable.
Now , I created two models, one is to serially transmit the data from Raspberry Pi, while the other is used to serially receive the data and to flag the led on/off. These models were deployed to their respective hardwares, but I was unable to get the results. Please help me to fix this problem. I have attached both the Simulink models with this question.
Also, do I need to connect the two boards ground and vcc pins(through voltage divider bridge) together for this?
8 Comments
Walter Roberson
on 16 Dec 2018
what would be the purpose of tieing the voltage and ground between the two ?
Omkar Bhanap
on 16 Dec 2018
Walter Roberson
on 16 Dec 2018
using the same voltage ground for the devices is not necessary for serial communication . Serial communication methods provide a ground line for the purpose of interpreting signal voltage but that does not require that the devices be operating at the same ground. It would be fine for hardware to use optoisolators on the serial lines for example .
Omkar Bhanap
on 17 Dec 2018
Edited: Omkar Bhanap
on 17 Dec 2018
Walter Roberson
on 17 Dec 2018
Your Arduino receive is configured for port 0. You then transmit the data to Arduino on port 1 to be output on pin 13.
I do not know if the mismatch in ports is responsible for what you are observing.
Could you confirm that the serial port of the arduino and raspberry are connected?
shivam sahil
on 25 Dec 2018
How do we test so?
Walter Roberson
on 25 Dec 2018
The connection between the two cards would be a physical connection. Both of them are USB, but they are both probably USB slave not USB master. But you can do it if you have a device like is shown at https://www.instructables.com/id/Read-and-write-from-serial-port-with-Raspberry-Pi/
Omkar Bhanap
on 25 Dec 2018
Answers (0)
Categories
Find more on Raspberry Pi Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!