element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Using serial communication without pc
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 35 replies
  • Answers 5 answers
  • Subscribers 394 subscribers
  • Views 5020 views
  • Users 0 members are here
  • arduino
Related

Using serial communication without pc

Former Member
Former Member over 11 years ago

I just started using the arduino and tried to build a remote control car. I have used the 434MHz RF module for radio transmission. I made a program for both remote and the receiver in the car, it worked fine when I tested it using my pc to send and receive signals. since I used the serial communication, it didn't work when I disconnected the arduinos from my pc. Is there a way to use the serial communication even when it is not connected to the pc, if it can be done, please suggest a way to do so.

  • Sign in to reply
  • Cancel

Top Replies

  • alexev
    alexev over 11 years ago in reply to Former Member +1
    There are many considerations to take in account: -instead of using "serial.print" which is a display command, try using "serial.write" to transmit data ( http://arduino.cc/en/Serial/Print#.UyoIPIXPsvw…
  • Robert Peter Oakes
    Robert Peter Oakes over 9 years ago in reply to elizabethmath +1 suggested
    I just checked with a sketch The serial lights TX or RX do not flicker when the USB is not connected, you can see that the USB Controller knows when the USB is connected and also that the lights are controlled…
  • Robert Peter Oakes
    Robert Peter Oakes over 9 years ago in reply to elizabethmath +1 suggested
    How were yo planning on using the scanner in the original design without the PC ? Suggestions would be LCD Display either attached via I2C or even via the hardware serial port but connected to pins 0,1…
Parents
  • Former Member
    0 Former Member over 9 years ago

    Hi,
    I have same problem.
    what  I am doing.wifi module connect with arduino and use Software serial communication,
    when I plug arduino to pc and open serial monitor then my programe is execute.
    but I dont want this."I want to directly start my program when i applied the power to the arduino".

    so plz suggest me
    thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to Former Member

    The program should always start the moment you connect power, once uploaded

     

    When you plug in a PC is will reset the program and start it again and if your monitoring the hardware serial it will reflect that

     

    If your using software serial for the WIFI then this should not be impacted, so my only conclusion is you may have something in your code testing to see if the hardware serial is connected and if not it waits

     

    Please provide your code so we can check it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to Robert Peter Oakes

    #include <SoftwareSerial.h>

    String str;

    int c=1;

    SoftwareSerial mySerial(10, 11); // RX, TX

    void setup() {

      setpins();

     

    pinMode(13,OUTPUT);

      // set the data rate for the SoftwareSerial port

      mySerial.begin(4800);

     

      wificonnect();

      gotIP();

      delay(3000);

     

     

    }

    void setpins()

    {

      pinMode(1,OUTPUT);

      pinMode(2,OUTPUT);

      pinMode(3,OUTPUT);

      pinMode(4,OUTPUT);

      pinMode(5,OUTPUT);

      pinMode(6,OUTPUT);

      pinMode(7,OUTPUT);

      pinMode(8,OUTPUT);

      pinMode(9,OUTPUT);

    }

    void gotIP()

    {

    if(mySerial.find("GOT IP"))

    {

     

    }else{

      gotIP();

      }

    }

    void wificonnect()

    {

    if(mySerial.find("CONNECTED"))

    {

     

    }

    else{

     

       mySerial.println("AT+CWJAP=\"ganesh\",\"123456789gg\"");

    delay(2000);

    wificonnect();

    }

     

     

    }

     

     

    void loop() { // run over and over

     

     

      delay(1000);

      if(c==1)

      {

       

        mySerial.println("AT+CIPMUX=1");

      }

      if(c==2)

      {

       mySerial.println("AT+CIPSTART=0,\"TCP\",\"GANESH.XP3.BIZ\",80");

      delay(2000);

      }

      if(c==3)

      {

         mySerial.println("AT+CIPSEND=0,50");

    delay(2000);

        mySerial.println("POST /index.php HTTP/1.0");

        mySerial.println("HOST: GANESH.XP3.BIZ");

        mySerial.println();mySerial.println();mySerial.println();mySerial.println();

     

     

      }

     

     

     

    if(mySerial.available())

    {

      String str1=mySerial.readString();

     

     

     

    if(str1.indexOf("OK") and c==1)

    {

     

      c=2;

    }

    if(str1.indexOf("NECT")>0 and c==2)

    {

      c=3;

    }

     

     

    if(str1.indexOf("IPD")>0)

    {int temp1=0,temp=0;

      for(int i=str1.indexOf(";");i<str1.length();i++)

      {

        if(str1[i]==',')

        {

          if(temp1!=0)

          {

        

            if(temp==0){

            digitalWrite(temp1,LOW);         

            }

           

            if(temp==1){

            digitalWrite(temp1,HIGH); 

            }

           

          }

          temp1=0;temp=0;

        }

        else if(str1[i]==':')

        {

          temp1=temp;

          temp=0;

        }

        else

        {

          temp=temp*10+(((int)str1[i])-48);

        

        }

       

      }

      c=1;

    }

    if(str1.indexOf("ERROR")>0 or str1.indexOf("is not valid")>0)

    {

      c=1;

      delay(3000);

    }

     

     

    }

     

    }

     

     

     

    :this code run after serail monitor open......if its close then only LED 13 blink ...no data transfer or receive from the esp8266 module

    thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 9 years ago in reply to Robert Peter Oakes

    #include <SoftwareSerial.h>

    String str;

    int c=1;

    SoftwareSerial mySerial(10, 11); // RX, TX

    void setup() {

      setpins();

     

    pinMode(13,OUTPUT);

      // set the data rate for the SoftwareSerial port

      mySerial.begin(4800);

     

      wificonnect();

      gotIP();

      delay(3000);

     

     

    }

    void setpins()

    {

      pinMode(1,OUTPUT);

      pinMode(2,OUTPUT);

      pinMode(3,OUTPUT);

      pinMode(4,OUTPUT);

      pinMode(5,OUTPUT);

      pinMode(6,OUTPUT);

      pinMode(7,OUTPUT);

      pinMode(8,OUTPUT);

      pinMode(9,OUTPUT);

    }

    void gotIP()

    {

    if(mySerial.find("GOT IP"))

    {

     

    }else{

      gotIP();

      }

    }

    void wificonnect()

    {

    if(mySerial.find("CONNECTED"))

    {

     

    }

    else{

     

       mySerial.println("AT+CWJAP=\"ganesh\",\"123456789gg\"");

    delay(2000);

    wificonnect();

    }

     

     

    }

     

     

    void loop() { // run over and over

     

     

      delay(1000);

      if(c==1)

      {

       

        mySerial.println("AT+CIPMUX=1");

      }

      if(c==2)

      {

       mySerial.println("AT+CIPSTART=0,\"TCP\",\"GANESH.XP3.BIZ\",80");

      delay(2000);

      }

      if(c==3)

      {

         mySerial.println("AT+CIPSEND=0,50");

    delay(2000);

        mySerial.println("POST /index.php HTTP/1.0");

        mySerial.println("HOST: GANESH.XP3.BIZ");

        mySerial.println();mySerial.println();mySerial.println();mySerial.println();

     

     

      }

     

     

     

    if(mySerial.available())

    {

      String str1=mySerial.readString();

     

     

     

    if(str1.indexOf("OK") and c==1)

    {

     

      c=2;

    }

    if(str1.indexOf("NECT")>0 and c==2)

    {

      c=3;

    }

     

     

    if(str1.indexOf("IPD")>0)

    {int temp1=0,temp=0;

      for(int i=str1.indexOf(";");i<str1.length();i++)

      {

        if(str1[i]==',')

        {

          if(temp1!=0)

          {

        

            if(temp==0){

            digitalWrite(temp1,LOW);         

            }

           

            if(temp==1){

            digitalWrite(temp1,HIGH); 

            }

           

          }

          temp1=0;temp=0;

        }

        else if(str1[i]==':')

        {

          temp1=temp;

          temp=0;

        }

        else

        {

          temp=temp*10+(((int)str1[i])-48);

        

        }

       

      }

      c=1;

    }

    if(str1.indexOf("ERROR")>0 or str1.indexOf("is not valid")>0)

    {

      c=1;

      delay(3000);

    }

     

     

    }

     

    }

     

     

     

    :this code run after serail monitor open......if its close then only LED 13 blink ...no data transfer or receive from the esp8266 module

    thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube