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…
  • 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
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to elizabethmath

    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 by the USB controller, not the ATMEGA328

    image

    SO this is not a worry.

     

    Back to your sketch, what makes you think it is not working (Aside from the TX/RX LEDS not doing what you expect.)

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

    Hi Mr. Oakes,

     

    Okay, that helps clear some things for me. Thank you

    Actually, I wouldn't know then.

    The thing is, the lights of the scanner behave very differently the second they are disconnected from computer. They are slightly dimmer and more often.

    I spoke to someone from technical support, who mentioned that the lights on the scanner are dictated by certain commands in the code.

     

    Would you have any idea in mind as to how I could check the functionality of the fingerprint scanner without the serial monitor?

     

    Again, I really appreciate your help here. It was heartening to note that there are very nice people out there to help out!

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

    To add on, ( not sure if i mentioned already )the lights are dimmer and its flickers more often when the system is connected in the absence of the computer.

    Also when the enrolled finger is placed, there is no change in the blinking activity, as it did when it was connected to the laptop

    Would that be an indication of crippled functionality?

    Or do you think it might be working, but required a bit of tweaking to the code.

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

    I tried using leds as an indicator to idenitfy what was happening along the way.

    I placed the digitalwrite (led, HIGH) command after the conversion process. I then turned out the led after the fingerprint was matched

    this worked perfectly with my code.

    But when I disconnected it from the laptop, the leds didnt work anymore either. So i'm guessing nothing is really happening inside?

    • 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