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 16*2 LCD getting weird characters
  • 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
  • Replies 34 replies
  • Subscribers 401 subscribers
  • Views 9717 views
  • Users 0 members are here
  • lcd
  • arduino
Related

16*2 LCD getting weird characters

jrcs
jrcs over 9 years ago

Hi all.

 

This is my first post so I hope it is at the right place.

 

I'm working on a project whose objective is to control two ac loads (one ac fan, controlled by phase angle control and one ac motor controlled by a 5V relay) and output to an LCD the room temperature and the % of fan speed.

 

 

The code I wrote seem to work fine without the AC loads connected. I tested it for long periods of time (+12 hours) and everything is ok.

 

The problem is when I connect both (or just one) AC loads, I always end up with my LCD info corrupted like this:

 

image

 

https://1drv.ms/i/s!Ah12lhUG5VG8g9FOhR9Y0ccFTsq2Rg

 

Sometimes past 2 minutes, sometimes past 10 minutes... It's random but it always end up like this.

 

 

I'm guessing it's noise problems due to the loads switching TRIAC/Relay. The TRIAC its connected trough a optocoupler but the relay it's directly connected to the arduino.

 

 

First, I put the lcd.clear() function in my code to "rebuild" the info from time to time but it doesen't work 100% and it's not a "clean" solution for the pourpose.

 

 

The AC loads are connected to the grid but the arduino is powered from my computer's usb port. Already put an EMI filter into AC main input of my loads but no solution.

 

Is there a solution to this problem? Any help?

Sorry for my poor english but I'm a little bit rusty.

 

Regards

  • Sign in to reply
  • Cancel

Top Replies

  • niko.vicencio
    niko.vicencio over 8 years ago +3
    Hi I had the same problem, the lcd showed random characters when the electromechanical relay commutated. I solved this problem, changing the relay by a ssr (Solid state relay). I hope that my answer help…
  • WarrenW
    WarrenW over 9 years ago +2
    How are you driving the relay from the arduino? Direct off the micro or via a transistor? Does the relay have a snubber cap across the coil and a back emf diode? Does the arduino have a filter capacitor…
  • Robert Peter Oakes
    Robert Peter Oakes over 9 years ago +2
    Can you please provide a schematic of your setup and also a full picture (Cant see all your connections in the one provided. You can upload them right into this community post. I have done what your describing…
Parents
  • jrcs
    jrcs over 9 years ago

    Hi mcb1

     

    I don't have any lamp available so I didn't test it with a lamp.

     

    I've been reading around and I found that adding a capacitor in the relay's output connections would help. The thing is when the relay latches and delatches creates an electric arch strong enough to mess up with the coil and the 5V supplying it!

     

    I add a 0.33uF capacitor and I get better. I didn't have any LCD problem for 20 minutes (way more time than before!) and this is what I've got on the scope with the capacitor plugged in:

     

    image

    Now, I don't know if this is an "acceptable" spike. I don't think so but I'm not and expert. It obviously isn't a perfect solution though.

     

    Another thing, when I turn on/off the system's 230V connection, I get some noise too. (Just by turn the 230V switch on). Is there any easy way to get rid of this "switch on noise"?

     

    Thanks in advance

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • jrcs
    jrcs over 9 years ago

    Hi mcb1

     

    I don't have any lamp available so I didn't test it with a lamp.

     

    I've been reading around and I found that adding a capacitor in the relay's output connections would help. The thing is when the relay latches and delatches creates an electric arch strong enough to mess up with the coil and the 5V supplying it!

     

    I add a 0.33uF capacitor and I get better. I didn't have any LCD problem for 20 minutes (way more time than before!) and this is what I've got on the scope with the capacitor plugged in:

     

    image

    Now, I don't know if this is an "acceptable" spike. I don't think so but I'm not and expert. It obviously isn't a perfect solution though.

     

    Another thing, when I turn on/off the system's 230V connection, I get some noise too. (Just by turn the 230V switch on). Is there any easy way to get rid of this "switch on noise"?

     

    Thanks in advance

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • dougw
    dougw over 9 years ago in reply to jrcs

    Some fancy systems use a triac to turn on AC - where the triac circuit is designed to only turn on when the voltage is crossing zero - this minimizes turn-on noise.

    Can you use a solid state relay? It should have less spark noise.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jrcs
    jrcs over 9 years ago in reply to dougw

    I have another system running with a MOC3041 with zero-cross detector and it runs like a charm.

     

    I haven't had LCD problems since the capacitor instalation but I get those spikes I posted in the image above. Are they dangerous to the Arduino or they are considered safe?

    I can't use a solid state relay on this project.

     

     

    Thanks for your help

    Regards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dougw
    dougw over 9 years ago in reply to jrcs

    I've seen lots of chips survive that type of spike, but it may stress them.

    Maybe a zener diode would be fast enough to clamp the spike....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 9 years ago in reply to jrcs

    Joao

    when the relay latches and delatches creates an electric arch

    You're quite correct ... this will happen and does so with capacitive and inductive loads much more than resistive loads.

    This is why relays are de-rated for inductive loads.

     

    If the 0.33 gets you past the problem, then its acceptable.

    Did you have LCD problems 20 mins later or was that how long you ran it for.?

     

    I think dougw is right about using the MOC3041 and triac to drive it.

    This will remove all problems, and if you require a much higher current then use the triac to turn on a 230v relay coil which switches the fan.

    It will switch at zero so the noise should not be present.

     

    Mark

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