Is it possible to use both external power jack and USB port with Arduino? - arduino

I have the Arduino UNO board and I want to know if it is possible to use both the USB connection (for exchanging data) and the external jack to power supply it.
I will use the following cable: http://ecx.images-amazon.com/images/I/41OMXaj5cPL.SY355.jpg with a AC-DC 5V adaptor in order to power supply the Arduino. However, I want to use also the USB connection in order to send some data from the computer.
Both will be connected at the same time.
In short, I want the Arduino to be able to run even if the computer is OFF and whenever I open the computer to send data to Arduino from USB connection.
Is this possible? Will the Arduino Uno board support it?

Yes. From the official Arduino website:
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External DC power will override USB power if the Arduino detects it. [Source]

as other said, it is absolutely possible to have both usb and power jack plugged in.
but be aware that if you shut down your computer and turn it on after, when reading the usb port you'll restart the Arduino and might loose important data.

yeah both of them can be used. If you want to upload the code in arduino then simply use the usb cable otherwise keep it on adapter. it wont harm the device.
What I personally do is, I keep on plugging the adapter and remove the usb once I am done with uploading and then test it as normally the usb cable is quite small and I normally work on robots so I need long wires.

if you want just plugs it in, it's ok but Arduino board will chose one and usb has priority to other power source.
********* Very important :*****
if you are controlling other circuits, that are connected to an external power supply, with your Arduino and connecting it to your PC's usb, Arduino will have potential difference and it will cause current flow that will damage your PC and Arduino board. if you want to do such thing, you have to shield your Arduino board from your other circuits that you want to control and they have external power source. this could happen with optocouplers for digital ports, non signal analog ports with shield relays, and complex analog circuits for analog signals

Related

Arduino multiple serial/hid output

Hello has anyone found a way to use an Arduino as a serial device and hid device at the same time?
I thought of a few solutions but didn't know the best way to go about it.
my goal is I need a serial device so the computer can send info to the Arduino but I also need an hid device.
can I use them both though 1 USB port? probably not
or
can I rig up another usb or serial port on the Arduino and use that as hid?
or
should I connect the Arduino to a teensy and use that for hid?
Thank you just trying to find the safest solution I'm making a custom fixture for my little laser engraver.
I recommend getting an Arduino Leonardo, Arduino Micro, an A-Star 32U4, or any other Arduino-compatible ATmega32U4 board. These devices act as a USB serial port but they can also be an HID at the same time if you use the Keyboard or Mouse libraries that comes with the Arduino IDE.

Bypassing powered on FTDI. Connect directly to RX/TX pins to drive externally

I'm working with a driver board which communicates with a PC program via USB -> FTDI -> TX/RX into the microcontroller. The serial pins are not broken out on the board and I need to talk to the board from another microcontroller (like Arduino). My plan is to just solder directly to the RX/TX pins on the microcontroller despite the fact that the FTDI is powered on and RX/TX of the FTDI will be electrically connected to those pins. I will not be transmitting anything via USB. My assumption is that the FTDI chip will be passive and I can just drive those pins from my Arduino.
Will this cause me any issues? I'm just concerned if the FTDI passively drives those pins low or high, I'll get "smoke" if I follow through with my plan. Perhaps I should put some resistors on my Arduino's RX/TX just as a safeguard.
It's very possible some of my logic is flawed here. Thanks in advance for your advice!!
Cheers
You need to check with the particular FTDI chip you're using on that board.
Some FTDI chips support RS485 and because of the required multidrop capability they operate as open-drain allowing to connect multiple devices.
Even if this solves your hardware problem, you still need to consider how the (live) FTDI chip may respond to your 'unexpected' incoming (RX) data stream. For example, possible XON/XOFF flow control appearing on TX especially since there won't be a consumer from the PC side and the internal FTDI buffers will eventually fill up.

Is it possible to use Arduino 2560's serial/USB communication without Arduino bootloader?

I have an Arduino 2560 and would like to send serial data to my PC. However, I am currently not using the Arduino Bootloader because I wanted to use a program that I wrote for an Atmega644 before (as far as I understood, one has to use the Arduino language when using the Bootloader?).
Does anyone know if what I am trying to do is possible with reasonable effort?
Connection to PC via 2560's serial0 does not depend on bootloader (if you plan connection when main program is running). You need 16u2 running to bridge 5V serial UART to USB or you can of course use any other option (e.g. MAX232 or so) to convert 5V UART to USB or RS232. But in case of RS232 double check baud rate error because of 16MHz crystal for particular baudrate.
2560 bootloader just implements firmware flash.

What happen when use rs232 instead of usb in arduino?

I just start a project which is very basic actually. But I need an information. It is about arduino serial communication. Here is the question.
If I connect arduino to computer using TTL to RS232 converter without USB cable then can I still use serial monitor to get some data or what happens ? Assume arduino is programmed before using usb cable, and it is powered externally when usb is not used.
for instance the code just
Serial.println("It is working");
delay(1000);
Thansk a lot.
you will fry it. Standard RS232 use a +-12V level, while arduino use TTL level (0-5V), so you still need a RS232 -> RS232TTL converter. If you use it, then using virtual serial over USB or real hardware serial is exactly the same, except that hardware serial port never appear/disappear when you plug in the arduino (there is not something like plug'n'play in rs232, it is always plugged)

WinUSB driver for Arduino

I'm using an Arduino to read data from the web and display it. I can easily pass the data as serial using the supplied drivers, because they identify the COM port so I can send serial to the COM port.
However, I want to use 'real' USB techniques so the device can be plugged in and out like a normal USB device. I'm looking at using WinUSB as the driver. However, USB is all new to me. Is there an .inf file that uses WinUSB and an Arduino (I have an Uno)?
The lack of information on this is making me think I am going about this incorrectly.
Turns out that an Arduino Uno is not a genuine USB device.
It acts as a Serial to USB adapter. Consequently USB drivers don't talk to it.
I got round this by writing a sketch which reported back what device it was when it got the correct query from the PC.
On the PC I just iterated the Serial ports and sent the query to each port. The one that replied was the Arduino.
After that I record the port number and send serial data to the Arduino.
To learn the USB portion, maybe you could combine V-USB and the UNO?
Check out V-USB.
V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip.
While not necessarily Arduino, it may provide you the learning exprience you want, and let you use incorporate your UNO device.

Resources