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 5013 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
  • 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 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
Reply
  • 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
Children
  • 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
  • elizabethmath
    0 elizabethmath over 9 years ago in reply to alexev

    Hi,

    Sorry, I'm quite new to the arduino( and electronic) platform, so apologies in advance if my queries seem silly.

    But does that mean i would need to replace the serial.print commands with serial.write or since I would no longer require the laptop interface, can I just get rid of all the serial.print commands in my code?

     

    I am working on getting rid of my laptop interface and just uploading the code onto my arduino board. unfortunately, even after getting rid of all the serial.print commands while retaining all the other essential parts of the code, I dont seem to have it working without the usb to pc connection.

    May I know what I'm doing wrong? Am I expected to ADD certain code now ( like the serial.write command) into my code now?

     

    Many thanks for any help with regard to me query! image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • neilk
    0 neilk over 9 years ago in reply to elizabethmath

    Hi elizabethmath

     

    I think we need to know a little bit more about what you are trying to do with your Arduino program.

     

    A block diagram and/or your code would be very helpful.

     

    Neil

    • 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 elizabethmath

    Please provide the sketch your using,

     

    There is no reason you need the PC connected to run you sketch but there may be something in you code that will help us to help you

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • elizabethmath
    0 elizabethmath over 9 years ago in reply to neilk

    Hi,

    Thank you so very much for taking time out to assist me with this. I really appreciate the help!

     

    image

    imageimageimageimage

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

    Hi,

    Thank you so very much for taking time out to assist me with this. I really appreciate the help!

     

    image

    imageimageimageimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • elizabethmath
    0 elizabethmath over 9 years ago in reply to neilk

    the code i'm using is found on the adarfuit fingerprint repository library :

     

    #include <Adafruit_Fingerprint.h>

    #include <SoftwareSerial.h>

     

    int getFingerprintIDez();

     

    // pin #2 is IN from sensor (GREEN wire)

    // pin #3 is OUT from arduino  (WHITE wire)

    SoftwareSerial mySerial(2, 3); 

     

    Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

     

    On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white

    //Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1);

     

    void setup() 

    {

      while (!Serial);  // For Yun/Leo/Micro/Zero/...

     

      Serial.begin(9600);

      Serial.println("Adafruit finger detect test");

     

      // set the data rate for the sensor serial port

      finger.begin(57600);

     

      if (finger.verifyPassword()) {

        Serial.println("Found fingerprint sensor!");

      } else {

        Serial.println("Did not find fingerprint sensor :(");

        while (1);

      }

      Serial.println("Waiting for valid finger...");

    }

     

    void loop()                     // run over and over again

    {

      getFingerprintIDez();

      delay(50);            //don't ned to run this at full speed.

    }

     

    uint8_t getFingerprintID() {

      uint8_t p = finger.getImage();

      switch (p) {

        case FINGERPRINT_OK:

          Serial.println("Image taken");

          break;

        case FINGERPRINT_NOFINGER:

          Serial.println("No finger detected");

          return p;

        case FINGERPRINT_PACKETRECIEVEERR:

          Serial.println("Communication error");

          return p;

        case FINGERPRINT_IMAGEFAIL:

          Serial.println("Imaging error");

          return p;

        default:

          Serial.println("Unknown error");

          return p;

      }

     

      // OK success!

     

      p = finger.image2Tz();

      switch (p) {

        case FINGERPRINT_OK:

          Serial.println("Image converted");

          break;

        case FINGERPRINT_IMAGEMESS:

          Serial.println("Image too messy");

          return p;

        case FINGERPRINT_PACKETRECIEVEERR:

          Serial.println("Communication error");

          return p;

        case FINGERPRINT_FEATUREFAIL:

          Serial.println("Could not find fingerprint features");

          return p;

        case FINGERPRINT_INVALIDIMAGE:

          Serial.println("Could not find fingerprint features");

          return p;

        default:

          Serial.println("Unknown error");

          return p;

      }

     

      // OK converted!

      p = finger.fingerFastSearch();

      if (p == FINGERPRINT_OK) {

        Serial.println("Found a print match!");

      } else if (p == FINGERPRINT_PACKETRECIEVEERR) {

        Serial.println("Communication error");

        return p;

      } else if (p == FINGERPRINT_NOTFOUND) {

        Serial.println("Did not find a match");

        return p;

      } else {

        Serial.println("Unknown error");

        return p;

      }  

     

      // found a match!

      Serial.print("Found ID #"); Serial.print(finger.fingerID);

      Serial.print(" with confidence of "); Serial.println(finger.confidence);

    }

     

    // returns -1 if failed, otherwise returns ID #

    int getFingerprintIDez() {

      uint8_t p = finger.getImage();

      if (p != FINGERPRINT_OK)  return -1;

     

      p = finger.image2Tz();

      if (p != FINGERPRINT_OK)  return -1;

     

      p = finger.fingerFastSearch();

      if (p != FINGERPRINT_OK)  return -1;

     

      // found a match!

      Serial.print("Found ID #"); Serial.print(finger.fingerID);

      Serial.print(" with confidence of "); Serial.println(finger.confidence);

      return finger.fingerID;

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • elizabethmath
    0 elizabethmath over 9 years ago in reply to elizabethmath

    #include <Adafruit_Fingerprint.h>

    #include <SoftwareSerial.h>

     

    int getFingerprintIDez();

     

    // pin #2 is IN from sensor (GREEN wire)

    // pin #3 is OUT from arduino  (WHITE wire)

    SoftwareSerial mySerial(2, 3);

     

    Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

     

    On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white

    //Adafruit_Fingerprint finger = Adafruit_Fingerprint(&Serial1);

     

    void setup() 

    {

      while (!Serial);  // For Yun/Leo/Micro/Zero/...

     

      Serial.begin(9600);

      Serial.println("Adafruit finger detect test");

     

      // set the data rate for the sensor serial port

      finger.begin(57600);

     

      if (finger.verifyPassword()) {

        Serial.println("Found fingerprint sensor!");

      } else {

        Serial.println("Did not find fingerprint sensor :(");

        while (1);

      }

      Serial.println("Waiting for valid finger...");

    }

     

    void loop()                     // run over and over again

    {

      getFingerprintIDez();

      delay(50);            //don't ned to run this at full speed.

    }

     

    uint8_t getFingerprintID() {

      uint8_t p = finger.getImage();

      switch (p) {

        case FINGERPRINT_OK:

          Serial.println("Image taken");

          break;

        case FINGERPRINT_NOFINGER:

          Serial.println("No finger detected");

          return p;

        case FINGERPRINT_PACKETRECIEVEERR:

          Serial.println("Communication error");

          return p;

        case FINGERPRINT_IMAGEFAIL:

          Serial.println("Imaging error");

          return p;

        default:

          Serial.println("Unknown error");

          return p;

      }

     

      // OK success!

     

      p = finger.image2Tz();

      switch (p) {

        case FINGERPRINT_OK:

          Serial.println("Image converted");

          break;

        case FINGERPRINT_IMAGEMESS:

          Serial.println("Image too messy");

          return p;

        case FINGERPRINT_PACKETRECIEVEERR:

          Serial.println("Communication error");

          return p;

        case FINGERPRINT_FEATUREFAIL:

          Serial.println("Could not find fingerprint features");

          return p;

        case FINGERPRINT_INVALIDIMAGE:

          Serial.println("Could not find fingerprint features");

          return p;

        default:

          Serial.println("Unknown error");

          return p;

      }

     

      // OK converted!

      p = finger.fingerFastSearch();

      if (p == FINGERPRINT_OK) {

        Serial.println("Found a print match!");

      } else if (p == FINGERPRINT_PACKETRECIEVEERR) {

        Serial.println("Communication error");

        return p;

      } else if (p == FINGERPRINT_NOTFOUND) {

        Serial.println("Did not find a match");

        return p;

      } else {

        Serial.println("Unknown error");

        return p;

      }  

     

      // found a match!

      Serial.print("Found ID #"); Serial.print(finger.fingerID);

      Serial.print(" with confidence of "); Serial.println(finger.confidence);

    }

     

    // returns -1 if failed, otherwise returns ID #

    int getFingerprintIDez() {

      uint8_t p = finger.getImage();

      if (p != FINGERPRINT_OK)  return -1;

     

      p = finger.image2Tz();

      if (p != FINGERPRINT_OK)  return -1;

     

      p = finger.fingerFastSearch();

      if (p != FINGERPRINT_OK)  return -1;

     

      // found a match!

      Serial.print("Found ID #"); Serial.print(finger.fingerID);

      Serial.print(" with confidence of "); Serial.println(finger.confidence);

      return finger.fingerID;

    • 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 elizabethmath

    It should make no difference if the PC is connected or not, the hardware serial (Pin 0 and 1) will still flicker one of the LEDs as it will still transmit to the USB controller. it just won't receive serial data from the PC or ultimately send serial to the PC from the USB interface. For the fingerprint reader you're using a software serial on separate pins (2, 3)

     

    What is my first thought is that the power is affecting it. When the PC is connected your providing 5V nominal through the USB port and everything is working from this

     

    What is the battery voltage and where are you connecting it, you should be connecting something like 6-9 V on the barrel connector, 5V via a USB lead or the 5V pin on the headers. or 6-9V via the header pin marked Vin.

     

    Please provide this info

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

    Hi Mr. Oakes,

     

    The problem is that neither of the led lights signalling Rx and Tx communication flicker when the system is not connected to a laptop.

    I think thats the part I'm having most trouble figuring out.

     

    With the voltage supply, I have tried both the barrel connector for the 9v battery as well as connecting the 9v battery supply into the Vin pin. I get the same response from both.

    I also tried checking to see if the battery was supplying enough voltage as per the fingerprint scanner requirement.

    Using a multi meter, I established that the fingerprint scanner was indeed receiving between its allowed range of 3.66- 6 V.

    It was on these grounds that I ruled out a problem with the electrical set up.

     

    What are your thoughts?

    Do you think it could still be a problem with the power supply?

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