LCD (WH1602B-TMI-ET) prints strange characters when playing piezzo buzz tone

Hi,

I have a strange problem. The LCD (WH1602B-TMI-ET) prints strange characters when playing a tone (piezzo buzz) tone with "tone" function. If I disconnect the piezzo, everything work fine with the same code, but of course the sound is missing. The display is from the "Android Starter Kit". Any ideas?

It seems pretty obvious that the piezzo is causing the problem. There are lots of previous posts about motors and relays interfering with LCDs and I expect that this situation is similar.

Don

Thanks Don! Is there any way to avoid the problem? I know that disabling the LCD when the sound is playing works, but it's just crappy workaround :slight_smile: And of course the screen is flickering. I also tried to write directly to the piezzo pin without the tone function, but the result was the same. Sounds strange that you cannot use display with other components. One note though, I do not have skills in Arduino so my statement might be a bit inaccurate.

Hi and welcome.

Did you connect the piezo directly to an Arduino pin ?
How about using a small transistor, and have the wires to that and the piezo as far away from those to the display as possible ?

Piezos can be buzzers, but they are also capable of sending signals, much like speakers (that can also be used as microphones).
If you tap your finger on a bare piezo, you could register a signal coming from it.
I'm not sure what happens after you sent a piezo a signal (an inductive load like a speaker would generate a nice back EMF).

As always, we have no idea what you are actually doing.

A perfectly focused photograph - no more than 1024 pixels wide - of your whole assembly would be the absolute minimum starting point. In this case, a picture is worth much more than a thousand words.

MAS3, yes I attached the piezo directly in a pin. I'm just guessing that it's the proper way.

Paul__B, My son is building a Hollywood style bomb which has a counter (in the display) and on each second, the piezo makes "beep" sound. When the time runs out, there will be some text in the display, long "beep" comes out from the piezo and something else will happen. This is his first project (also mine) and I just try to help him to get in.

I attached a picture which shows the layout. Hopefully it's clear enough. I know that the wiring is a bit messy, but my son is just 10 years old and he will learn.

I also attached the code which shows how it's working now. The display problem does not exist in the project currently, because the LCD is turned off during the sound. Hopefully all this gives a better picture what is going on. Thanks!

pommi.ino (1.07 KB)

Hi.

Try to move the wires in pins D8 and D12 to another position.
The green wire in D12 can also go to position D6.
The orange wire in D8 can also go in D13.
D13 also has the on-board LED,
So if you wire it accordingly, the beep will be accompanied by a flashing LED.
Rewiring also means you have to declare the correct pin numbers.
This way, the lines are as far apart as possible with your current setup, and these lines aren't crossing anymore like they are now.
That might be an improvement.

Photo not bad, and I note you are connecting Vo - pin 3 - directly to ground and the contrast is just fine. You may be getting some "sag" on the USB supply voltage which drops the contrast voltage to an optimum level (about 4.7V) by default.

Also note brightness limiting resistor of 220 ohms. If your LCD has R8 or R9 as "101" - 100 ohms - as it almost always does, you do not need such a resistor but if you wish to limit current consumption, that is OK.

What I would suggest regarding your actual problem, is to put a 10 or 47µF capacitor on the breadboard directly across pins 1 and 2 of the LCD. Also wiggle your power connections to make sure they are making good contact.

muovipolvi:
My son is building a Hollywood style bomb which has a counter (in the display)

Just don't accidentally leave it in any supermarkets!

muovipolvi:
I also attached the code which shows how it's working now. The display problem does not exist in the project currently, because the LCD is turned off during the sound. Hopefully all this gives a better picture what is going on. Thanks!

I find it very inconvenient to look at code in a ".ino" link. Much more appropriate in the post itself using "code" tags - the little "scroll" icon.

Suspect the text should be "DETONATION IN:" :smiley:

Thank you for the information! I have one question still, the starter kit which my son has contains only 100uF capacitors, but can I use them? I don't have skills about electricity and I don't want to burn / break anything.

And you are right, "detonation" is the correct word (in my native language it's "räjähdys", but that is not cool enough) :smiley:

You will not burn or break anything by using a 100µF instead of a 47µF capacitor.
But be sure to check the polarity of these electrolytic capacitors, or else you might have an actual and quite spectacular detonation.
Same for the rated voltage (also printed on the part).
Always have that rated voltage higher than what you are using, but i assume that this will be no problem as they are in a starter kit.

Hauskaa kokeiluja!
(thanks Google translate)

Thanks guys for the help!! The capacitor fixed the problem and now the LCD is working properly. No more strange characters!