Problem in serial communication and i2c lcd display not working togeather


This is image of serial data received on second arduino. So,basically problem is that I am using two arduino one to display data of sensor to lcd and second to send data on blynk application so I communicated both arduino with serial communication and it works fine but as soon as i transfer data to lcd serial communication stops right away. i run my lcd code separately it work fines but not works with serial communication. So, can any one help me.

It seems that you are having trouble with your code and/or your hardware. We can not help with that which we cannot see.

Read the forum guidelines. Post the code that does not work.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

If there are compile errors, please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Post a schematic of your wiring.

I have used serial and LCDs together many times with no issue.

Thank you so much for your response. The lcd is connected to master arduino so is there any issue with that? Because i want to use slave arduino with esp 01 to send data on blynk application.

I don't know what type of LCD that you have. I do not know what interface the LCD uses. I do not know how the LCD is wired. I know nothing of your hardware setup or your code. I do not know how you expect for me to give intelligent help.

Post your code.

Post a schematic.

Post photos of your wiring.

Ideally we need enough information to entirely duplicate your project to give the best informed assistance.

@mujahid-akber-ali, your topic has been moved to a moe suitable location on the forum. Please don't post screen shots of the serial monitor (or your code when you get there).

I can't share my code as it isn't ready but to clear things i am using i2c lcd and its connected with A4 and A5 and further serial communication is done by 6 and 7 pin of first arduino to 0 and 1 pin of second arduino and other than that sensors are connected. These data shown above are temperature, ph and turbudity Now, I want to print data on lcd using lcd.print command and with my first arduino which is sending data serially so as I use this command in code lcd not works and serial communication stops although before serial communication lcd code was working fine. So I just want to get clear if some one has used both kindly help me.

That does not make it any clearer. Draw it !! A reasonable sized photo (200kB to 300kB) of handdrawn one is IK.

Yes you can. Both sides. Just write simple programs that show the problem and post them here.

I told you what we need in order to help you. Without the code and a clear understanding of the wiring I cannot offer any informed advice.

The LCD is slooow and so you are probably missing bytes on the serial
See Arduino to Arduino via Serial for a SerialComs class the is very tolerant of loooong delays on either side provided you can send your messages in 60bytes or less.
SerialComs also works well with SoftwareSerial connections.
SerialComs in included in my SafeString library library

Thank you for your response. Problem is solved. Actually problem was that i was using pin 0 and 1 which are hardware serial pins to communicate but now i used software serial on both arduino's and now i send data to lcd its working fine and data is also going serially to second arduino as well.

Which we possibly would have picked up if you would have posted your code.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.