arduino standalone without usb

hello
i have a problem
i want use arduino with serial port number 1 without power supply from usb
i use arduino serial port number 1 with power supply usb
first i use arduino with out usb and arduino run
now when i use arduino serial port1 run with power supply from usb
i want use without usb

this is test project with image

String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete

void setup() {
// initialize serial:
Serial.begin(9600);
Serial1.begin(9600);
Serial.flush();
Serial1.flush();
// reserve 200 bytes for the inputString:
inputString.reserve(200);
}

void loop() {
// print the string when a newline arrives:
if (stringComplete) {
Serial1.println(inputString);
// clear the string:
inputString = "";
stringComplete = false;
}
}

void serialEvent1() {
while (Serial1.available()) {
// get the new byte:
char inChar = (char)Serial1.read();
// add it to the inputString:
inputString += inChar;
// if the incoming character is a newline, set a flag
// so the main loop can do something about it:
if (inChar == '\n') {
stringComplete = true;
}
}
}

i have ask help to you withuot response
thank you
bye

the arduino must have power so if you want to eliminate the usb power it must come from somewhere else. either a dc power supply or batteries. a promini for example can run from a 9v or 12v dc source into the "raw" pin or 3v-5v into the "vcc" pin. 3 aa cells make a good source for the latter. it is also possible to use just the 5v dc part of usb. in that case the two outside contacts make an excellent current limited source of 5v. my favorite benchtop power supply is made from a usb cable that has been cut in half.

The USB-TTL module does more than just connect the port. This link explains the signal-level conversion, etc.

You may all so want to look at how the PICAXE download circuit (two resistors) function with the PC serial port and a microcontroller.

Ray

i use your serial arduino adapter

and 12V power supply

can i link the gnd of arduino serial adapter to gnd of the arduino mega board 2560 i think this is the problem
because when i attach the esternal link of usb to arduino the serial go good
sorry for my english

You MUST connect the grounds of all devices in the system (unless optical isolation is being used).
The system needs a common reference point, GND provides that.

what use for optical?
i can link directly gnd to serial and mega 2560?
thank you

i have try
to connect only external usb part to arduino and this run correctly

Optical would be used if you needed the power supplies totally separated.

can you give me a schematic please?
i connect arduino 2560 with port1 to usb arduino serial adapter then with usb
i use power supply 12V
thank you

I think we should be asking you for the schematic!
You have 12V/Gnd to barrel jack connector.
You have Rx/Tx from Serial1 connected to Tx/Rx of Arduino and Gnd to Gnd.
What else do you have? 5V from Mega 2560 supplying power to Arduino (Uno?) ?

At worst, draw it out by hand, take cell phone picture, edit to resize to ~1000 wide. Use Additional Options below the Reply box and attach it to your response.

now i have 12V to jack connector
and txrx1 from arduino 2560 mega to txrx to arduino serial adapter
only this

Need Gnd from mega to the adapter also.

now run thank you!!!!!!!!!!!!! :slight_smile: :slight_smile: :slight_smile: :slight_smile:
great job
also i don't understand first run without gnd

thank you very much :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:
but i don't understand why first run without gnd

Didn't see what you had wired to start, hard to say.