I am needing help regarding using the Arduino Uno Tx and Rx pins. I am trying to use the serial connection pins on the board without using the USB port on the board. Instead, I would like to use the MiniUSB/Serial adapter that the website offers. Is this possible? Do I connect the Tx pin on the Uno to the Tx pin on the adapter and the Rx pin on the Uno to the Rx pin on the adapter or vice versa? Are there any additional lines of code I need to add to use these pins instead of the USB port?
Sure, you can do that.
The FTDI Basic is what you are referring to?
Connect its Tx to the Uno Rx, Rx to Tx, Gnd to Gnd, CTS to Gnd, +5 to +5, and DTR to Reset:
FTDI UNO
Tx Rx
Rx Tx
DTR Reset
+5 +5
GND GND
CTS GND
In void setup(), add:
Serial.begin(speed, such as 9600); // library takes care of defining D0, D1 for you. Data format used is 1 start bit, 8 bits, no parity, 1 stop bit (8N1)
In void loop(), use commands such as
if (Serial.available() >0){ //take action when a byte is received
incomingByte = Serial.read(); // read the byte
}
and
Serial.print (your_outgoing_byte); // your data will go out as a Serial monitor displayable character
or
Serial.println (your_outgoing_byte); // your data with a "carriage return"
or
Serial.write (your_outgoing_byte); // your data goes out as-is, may not be a displayable character in the Serial monitor.
What does DTR and CTS do and why connect them to Reset and Ground. Also, do I need to supply the adapter a supply voltage or can it use the voltage supplied by the USB?
These are called hand shaking lines and they give information about the serial link.
CTS - Clear To Send it tells the sending bit that it has something to send to.
DTR - Data terminal ready is used on the arduino to reset the processor.
I am using the RX and TX pins on the Arduino Uno and moving the USB connection to a different location away from the microcontroller instead of the plugging the USB directly into the microcontroller. I have the the serial to USB adapter from Arduino and have hooked it up this way:
Hi
I was trying to do more or less the same thing : make the arduino do Serial.println("something") and connect the TX pin to a serial port to duplicate the serial output (no real project behind, just tinkering)
Where is the +5 pin on the serial port ? I don't find it on any documentation
Also, I didn't understand why I should connect the reset of the arduino to the DTR pin
What serial port?
Serial ports on a computer are RS232, that means they are +12 / -12V signals and inverted so that when the arduino gives a logic 1 (+5V) a computer's serial port expects a -12V signal.
To convert to these voltages and inverted logic levels you need something like a MAX202 or similar chip.
Where is the +5 pin on the serial port ?
What serial port? - for a PC then there is no +5V.
I have a USB to 9 pin serial port and I was trying to connect wires from arduino+breadboard to the 9 pins (not all 9 pins). I have minicom listening to it.
in addition to this, I have the arduino usb cable + on the computer the arduino platform and its serial port monitor.
when I do Serial.println("a"), I hope to see the "a" on the arduino monitor (I see it) and on minicom, but I have problems making connexions from the arduino to the 9 pin serial port.
So do I need to do all these things ? (the 12V -> 5V conversion + inversion, ...)
or just plug in the TX pin of the arduino to the TX of the 9 pin serial ?
I hope I am clear, please don't hesitate if you need some reformulation
Thanks
mr_johansen, is this the USB-to-Serial adapter you're using?
If so I'm not sure it will work with an Uno. The Rx pin on the Uno's processor has a 1k pull-up (via the on-board USB adapter), which any external adapter has to overcome. And I don't think the Arduino USB2Serial "Light" will be able to, because it's Tx pin is connected via a 500 Ohm resistance meaning it won't be able to pull the Uno's Rx pin below the threshold for logic-zero.
I'm a bit confused about these pins, what if I want to use the usb to communicate with arduino and tx and rx pins to talk to esp8266?
What are these pins for?
mtrax:
I'm a bit confused about these pins, what if I want to use the usb to communicate with arduino and tx and rx pins to talk to esp8266?
What are these pins for?
See reply #3 for the function of the pins. Note that DTR and CTS are not available on the Arduino connectors.
Be aware that if you send something to the PC over the USB, it will also be send to the esp8266. And when both the PC and esp8266 are sending something at the same time to the Arduino, you might get corrupted data.
You might be better of using SoftwareSerial for the esp8266.