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 5035 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…
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago

    Can you provide a block diagram of what your describing, ie. do you have two arduino's one in the car and one for the remote control, both with radios , the one in the car connected to the speed and steering im assuming with PWM control. the other with buttons or something to act as user controls because without the connection to the PC there is no commands going to the transmitter.

     

    also (And sorry if this is obvious), if the one connected to the PC was powered by the PC then it wont have power once disconnected ?

     

    hence a block diagram would help us help you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • alexev
    0 alexev over 11 years ago

    You're a bit confusing, serial communication means sending data on a single communication channel bit by bit, hence it's name. Usb also does serial communication as rs232 but at a way faster rates and using different protocols. You want your robot to be controlled from a computer or from a remote control? If you want to get rid of your arduino's and just use the microcontrollers (atmega328), well you can either way (pc or remote), you just have to adapt the software on both microcontrollers and setup the fuses for external clock to use without arduino boards. Here's a useful link Arduino - ArduinoToBreadboard

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

    image

    This is the block diagram of the system I wanted to build. the remote control contains the buttons I require and the receiver end is mounted on my car.

    I used the command Serial.print to transmit the data and the command Serial.read to receive the data. These two commands work only when the serial monitors are open. I wanted to know if there is a way to use these two commands without keeping the serial monitor open.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to alexev

    Thank you sir, the link was helpful. I wanted to use my arduino as remote control and receiver on the car which works without a computer. I want my robot to be controlled by a remote control. Sorry for the confusion with the serial communication, I just wanted to tell about the Serial.print and Serial.read commands.

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

    What are the radio modules and also the Arduino models, there are many alternatives but I would be reluctant  to say without knowing what your working with

     

    And to answer your original question, yes there is a way to do it without the PC connected, just need the info requested to get it right for you

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • alexev
    0 alexev over 11 years ago in reply to Former Member

    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)

    -have you used the virtualwire library?

    -it's well known that cheap 434MHz rf modules are "what you pay is what you get" so you might aswell get delays and corrupted transmission from them even with the increase of the length of the antenna, when you have obstacles and interference. Don't expect large distances operations, these modules work in amplitude shift keying for low performance applications (http://en.wikipedia.org/wiki/Amplitude-shift_keying)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • 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
  • DAB
    0 DAB over 9 years ago

    When working with wifi or RF communication devices, you should first make sure that they work over a hardline, where it is easier to resolve the protocol and message traffic.

     

    Then you can go to freespace with a level of uncertainty eliminated so that you only need to debug the RF devices.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
>
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