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 all.

    Thanks in advance for your help. I'll try to answer to all of you clearly but I know my english it's not very good (nor technical).

     

    mcb1 When I disconnect just the ac motor from the relay (and keep the relay coil connected and controlled by the Arduino) the noise disappears. Could it be the AC motor producing the spikes?? I added a snubber circuit just to be sure but didn't help.

     

    The lamp (is actually a AC Fan) is not the problem. It is controlled by phase angle control and being connected or not doesn't change the spikes.

     

    If I remove the 5v power to the relay coil I have no spikes... but the motor obviously doesn't turn on so...

     

    I've put a flyback diode directly into the relay coil aswell but didn't help.

     

     

    The zero crossing detector is just to trigger the triac and power the AC Fan (Ventilador).

    The AC motor connected to the relay is turned on for a few seconds (3 to 10 seconds) and off for 40 seconds regardless of zerocross detected or not... but I can try to change the program to only switch the relay when zerocross is detected.

     

     

    dougw the supply on the laptop's usb port can give 500mA and the usb charger can give 2A. I tried both ways and got the same result.

     

    A small resistor/inductor and a capacitor in the power supply wire ? In the whole system supply wire or just the relay supply wire?

    I'll try to learn how to feed the digital with the Schottky diode.

     

     

    Thank you all for your time.

    Regards.

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

    Hi all.

    Thanks in advance for your help. I'll try to answer to all of you clearly but I know my english it's not very good (nor technical).

     

    mcb1 When I disconnect just the ac motor from the relay (and keep the relay coil connected and controlled by the Arduino) the noise disappears. Could it be the AC motor producing the spikes?? I added a snubber circuit just to be sure but didn't help.

     

    The lamp (is actually a AC Fan) is not the problem. It is controlled by phase angle control and being connected or not doesn't change the spikes.

     

    If I remove the 5v power to the relay coil I have no spikes... but the motor obviously doesn't turn on so...

     

    I've put a flyback diode directly into the relay coil aswell but didn't help.

     

     

    The zero crossing detector is just to trigger the triac and power the AC Fan (Ventilador).

    The AC motor connected to the relay is turned on for a few seconds (3 to 10 seconds) and off for 40 seconds regardless of zerocross detected or not... but I can try to change the program to only switch the relay when zerocross is detected.

     

     

    dougw the supply on the laptop's usb port can give 500mA and the usb charger can give 2A. I tried both ways and got the same result.

     

    A small resistor/inductor and a capacitor in the power supply wire ? In the whole system supply wire or just the relay supply wire?

    I'll try to learn how to feed the digital with the Schottky diode.

     

     

    Thank you all for your time.

    Regards.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
  • mcb1
    mcb1 over 9 years ago in reply to jrcs

    Cheers for checking.

    You could try using a 230/240 lamp instead of the motor as a test.

    A lamp is resistive (rather than inductive like a motor) and it will help prove it.

     

    Rather than change software, if you short the output of the zero cross, it will always think its at zero.

    You could then put the power onto the 5v relay when it suits and see if the LCD corrupts.

     

     

    The picture you provided shows a lot of wires.

    The mains is fed back onto the board for the zero cross and the Triac.

     

    My concern is that you may have the neutral and the ground connected somehow.

    It could be via the power supply

     

    You could connect a switch across relay contacts and see if pressing it (which will make the motor run) also corrupts the LCD.

     

     

    Two other minor observations.

    1. The filter caps you have are close to the LCD, but they are quite a way from the Arduino. One across the 5v and ground plugged on top of the proto board wouldn't hurt.

    2. The schematic shows the base of the zero cross output transistor floating. I've found that a 47k between the base and emitter stops any issues.

     

     

    Your english and explanations are fine ... much better than mine in your language ... image

    Mark

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

    Just filter the power to the low power circuit being affected by the noise (the LCD and arduino)

    • Cancel
    • Vote Up 0 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