element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 Arduino Project just not fully working looking for help.
  • 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 Verified Answer
  • Replies 34 replies
  • Answers 2 answers
  • Subscribers 420 subscribers
  • Views 4710 views
  • Users 0 members are here
  • uno
  • arduino
Related

Arduino Project just not fully working looking for help.

mntlvr.66
mntlvr.66 over 12 years ago

Hello

I am trying to build a Distance measuring device using an Arduino UNO with a I2C LCD and Wiznet 5100 Ethernet shield and SD all combined.

I have succeeded in the W5100 part but when I add the I2C LCD library and the Wire library for the LCD,the SD part of the Ethernet  shield no longer works properly , as far as the web page is concerned. I am using "ajax" and my SD to display a dial on the web page but the part that fails, with no error codes of any kind is the web page dial. The dial will not load from the SD card. I know that I am trying to use 2 SPI devices along with a I2c device but loading the wire and the LiquidCrystal_I2C libraries and then trying the program the display has no data and neither does the web page as far as the dial goes.

Can anyone give me some insight as to why the SRF05 and the W5100 and SD and LCD don't get along. If I rem out the Wire and the I2C libraries the web page works just fine.

I have attached 2 files for my project, 1 is the code and the other is the htm file for the gauge.

 

I have uploaded the working sketch as far as the Ethernet and SD is concerned but This is only part of what I want. I would like to add the I2c LCD with its libraries and still have the Ethernet part still work.

Probably the best way to see what issue I am having is to bread board this project for youself and see if you can make it work with Ethernet card and SD card and I2C LCD. If you get it to work like I am trying then please let me know.

Thanks for I can use the help on this one.

 

Problem now solved.

Thanks much for all the insights.

 

Message was edited by:Bob Warren

  • Sign in to reply
  • Cancel

Top Replies

  • e14 Contributor
    e14 Contributor over 12 years ago +1
    I think this thread is a lesson to all of use really. Back in the day when programming on 286 based PC's with 640Kb RAM, the memory problem was forever an issue. My suggestion is to always use the "example…
Parents
  • booran
    0 booran over 12 years ago

    It looks like you're using the same pin for the LCD and for the sonar?

     

    Line 24      ->     LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

    and

    Line 30     ->     #define  TRIGGER_PIN  7

    Line 35     ->     NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

     

    The LCD i would believe is using digital pin 4 while I2C on the UNO is using analog pin 4 so I don't think you would have an issue there.  Can you include schematic/wiring diagram?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mntlvr.66
    0 mntlvr.66 over 12 years ago in reply to booran

    Nick

    If you look closely the lcd is "//" remmed out of the program so has no bearing on the working part.

    But thanks for looking to see if you could help.

    Have a great day

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 12 years ago in reply to mntlvr.66

    OK, so not that then, back to the drawing board as they say

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 years ago in reply to mntlvr.66

    Robert

    Pin 10 needs to be made an output, but I haven't seen anything saying it should be forced HIGH.

     

    You might want to look at a couple of the SD examples that appears under File - Examples - SD to see what you're missing

     

    void setup()
    {
      Serial.begin(9600);
      Serial.print("Initializing SD card...");
      // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
      // Note that even if it's not used as the CS pin, the hardware SS pin 
      // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
      // or the SD library functions will not work. 
      pinMode(10, OUTPUT);
    
      if (!SD.begin(4)) {
        Serial.println("initialization failed!");
        return;
      }
      Serial.println("initialization done.");
    
      if (SD.exists("example.txt")) {
        Serial.println("example.txt exists.");
      }
      else {
        Serial.println("example.txt doesn't exist.");
      }

     

     

    My suggestion is see if you can get the SD card working, then try to integrate it.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mntlvr.66
    0 mntlvr.66 over 12 years ago in reply to mcb1

    Mark

    Thanks but the SD card works just fine if I don't load the libraries I mentioned it is a fully working program until I add the I2C and Wire libraries.Thanks for the suggestion. Perhaps the confusion is coming from the assumption that the program does not work at all. If I just use the I2C and Wire Libraries and the LCD it works , If I use just the Ethernet shield and not the 2 libraries I mentioned it works it is trying to get both the Ethernet shield and the LCD with it libraries to work. I have tried serial lcd as well as I2C lcd neither work along with the SD card and the Ethernet shield. I hope I am making myself a little bit more clear as to what the issue is.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 years ago in reply to mntlvr.66

    Robert

    Just confirm for me you aren't trying adding this one  ... AT ALL

    // LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

    This is NOT for an I2C display.

     

    Your libraries should look like this

    #include <SPI.h>
    #include <Ethernet.h>
    #include <SD.h>
    #include <NewPing.h>
    #include <LiquidCrystal_I2C.h>
    #include <Wire.h>

     

    if you can, detail where the shield is from, along with the sd card

     

    mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • booran
    0 booran over 12 years ago in reply to mntlvr.66

    I'm aware that line was commented out but I was under the impression that the problems arose when you added the LCD back in with the other components.  I just wanted to verify that you weren't using that line anymore.  Can you point us to which shields you are actually using and possible include the libraries you are using (at least the ones that aren't included in Arduino already)

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mntlvr.66
    0 mntlvr.66 over 12 years ago in reply to mcb1

    mcb1

    Right now I am not using any LCD of any kind.

    I only left these lines in the program for my ease. I remmed everything out I didn't need to make it work with out the LCD.

     

    I will upload the Working sketch but it does not have any LCD displays of any kind in the sketch.

    I want to use a I2c LCD but like I said earlier if I load the I2c liquid crystal library and the wire libarary then the Ethernet card does not load the "htm" file from the SD card and they display shows no data. The sketch will compile without error.

    Thanks

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

    Can I ask a simple question, (In the absence of an immediate answer I will proceed with a yes image )

     

    What happens when the LCD is included in the program, does everything else except the LCD work or do other devices like the SD card, start to fail

     

    also what is the chip on the LCD serial to parallel board, there are many versions and I have been bitten in the past assuming it was the one in the standard library

     

    Please take a picture or draw on paint if necessary your layout with all the connections

     

    I have all the parts your using and will replicate the issue and see what I can find

     

    Peter

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

    building it our now so hope to have an answer later today

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mntlvr.66
    0 mntlvr.66 over 12 years ago in reply to Robert Peter Oakes

    When the Serial LCD and Librarys , Liquid_Crystal_I2C and Wire, are added the SD card fails and so does the LCD.

    I am using a 16x2 generic

    LCD bought on Ebay QC1602Awith built in I2C board. Now that works if I don't include the SD card and Ethernet.

    Hookup is simple give the display the proper hex address eg:0x3F that is just an example. Hookup Vcc,Gnd,SLA,SCK on the UNO board and then add the proper statements in the sketch and the SRF05 and the display will work wonderfully.

    Now if you add the Wiznet 5100 Ethernet board and the Ethernet and SD libraries and then try the Display fails to work and so does the SD.

    I thank you for your help in this matter.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • booran
    0 booran over 12 years ago in reply to mntlvr.66

    Are the libraries you're using the standard ones included with arduino or are they downloaded with your purchases? Can you include them here?

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • booran
    0 booran over 12 years ago in reply to mntlvr.66

    Are the libraries you're using the standard ones included with arduino or are they downloaded with your purchases? Can you include them here?

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • mntlvr.66
    0 mntlvr.66 over 12 years ago in reply to booran

    I will upload the libraries I use. None are downloaded with the devices I use. All are available on the Arduino forum site and probably other sites also.

    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube