I have a 2.4" display connected to a PICAXE processor. All has been going well with project until I try to implement the use of dim and dims. The main reason I need this is to stop the light from the display affecting photos that the final device will take.
However after initial testing I found that the display seemed to be putting some sort of noise onto the power rail. The detector part of the circuit is audio based and functions fine with dims set to 100. Anything less and the audio circuit puts out a strong 0-5v signal of around 600hz.
I have basic USB scope, but that doesn't actually show any noise weather powered by batteries of a 1.2A power supply. The issues goes away if the main part of the circuit (Picaxe and display) are powered by one set of 3xAA batteries and the audio part by another set (shared 0v), the same can be said if left on a single set of batteries and the power removed from the display.
I have 2 displays that were purchased from eBay, and both give the same result.
I personally can't think of other avenues to explore.
Not a Nextion problem... This might occur with whatever LCD backlight, since the latter are always dimmed with PWM for better energy efficiency. Audio circuitry amplifies, as you see, greatly any design law like
- bad, missing, or multiple grounding (ground loops)
- bad or missing decoupling and filtering of the supply voltage
- insufficient shielding of sensitive circuit parts
- audio amplifiers starting self-oscillating due to one of the aforementioned flaws
But all that is only guesswork - you did not post any schematics or pictures of your setup...
thanks Thierry, not much more to tell ...
- basics in general signal shielding
- basics in general signal filtering, lowpass, highpass, ...
sound detection circuit: http://www.picaxe.com/docs/picaxe_sound.pdf
Green trace is from the ground side of the display with a 0.2ohm resistor to ground, yellow trace is junction of Q1, RV1 and C1. 470uf electrolytic and 100nf ceramic across power rail close to display.
The 300hz dip (valley to peak is about 38mV) does not happen when the display is set to 100. If the audio circuit has a separate power supply to the display there is no issue. The circuit only currently exists on bread board as it still very much a prototype. The frequency is always 300hz although at lower brightness levels the wave form is longer and less defined (looks similar to ringing)
Although I haven't had chance to put it on the scope yet have 2000uf across the power rail does about a 50% job of fixing the issue - this isn't very practical route if it needs 4mF to smooth out the rail.
The noise only exists when the display is dimmed and the change in pulse length can be watched on the scope with the peak getting shorter as the brightness goes down. This why I found that the display was putting out noise onto the circuit some how, the combined with unplugging it instantly allow thing to normalise.
The final product isn't going to be large or have long wires. This only occurs when the display is dimmed, I can have the processor put out a PWM, switch input on and off without there being an issue.
Discovery is such a journey
Thierry already explained
- still not a Nextion issue, nature of backlights.
Electronics and Programming are prerequisites
Forum is less about being a blog of such journey
First: If you get 38mV valleys on the 5V rail, just from the Backlight dimming, your power supply has either too much inner resistance or a bad regulation time constant and is most probably
crap not optimal.
Second: The sound detection circuit is simple, cheap, and has no power rail decoupling or buffering at all which is a heavy engineering error. There are people who should give their engineer diplomas back because of mental weakness!!! Each little spike on the power rail gets directly over R1 (4k7) onto the electret microphone and will be amplified like hell. First thing to try is to put a low pass filter with 220R and 47uF between the 5V rail and the +4.5V power supply input of that badly designed audio circuit. This should already reduce the problem if not solve it.
Normally, when doing such a project with mixed digital and analog electronics, I would take a heavy 9V power supply and use two distinct 5V linear regulators (7805 style), one for all digital circuitry and display, and the other for the analog circuit parts. That's how professionals do it! :-)
I wonder why I make the effort to give a detailed reply if there isn't any follow-up afterwards...
human nature ... ?
sorry but I have been working. I spend 10 hours a night away from the project and need to sleep at some point.
Its not the fact it not that I don't appreciate the effort, I haven't had opportunity to have another look at the project.
I am aware that an ideal would be to have 2 power supplies, but sometimes the ideal isn't always possible. It may still be so with the use of 2 3.7v lipo batteries.
Power decoupling, especially between analog and digital circuit parts is essential since digital power rails are always dirty. That's why I suggested a second, separate voltage regulator for the analog circuitry (which might be a 78L05 for the low power consumption of that audio circuit).
I don't know how old you are, but I'm old enough to remember that High-End audio equipment in the 1980s even had separate power supplies for the right and left channel to minimize channel crossover.
I wasn't born until the mid 80s.
I have done only small amounts with digital electronic and basically zero analogue.
If I can find an appropriate battery that is fairly small, rechargeable and delivers enough juice to run 2 separate regulators I will go that better route. Although I may use a buck regulator for the digital side and an LDO for the analogue side
There is some way to go before it gets close to being finished. a lot of refinement on the hardware side, and huge amount of programming and testing to do.