Arduino - nextion project

Greetings everyone... I will try to finish my project for the boat, the goal is to measure engine battery voltage, service battery, water tank and fuel tank and display everything on the nextion 2.4... i have done everything on the breadboard and I'm satisfied with the results... The thing is that I want this project to be reliable because i need to reroute my old installation from tanks and cut the hole for display etc. so I don't want that i need to fix something every 2 days :)... My idea was to power arduino and nextion from battery through this buck converter... It is capable od 3 amps, and it has a low pass filter which i hope is enough for the noise from the alternator... I would also add few capacitors after it close to MCU just for any case...

The analog input A0 and A1 should be for measuring batteries, i thought that the best way for doing that is a voltage divider (potentiometer) because it is the easiest way for me to calibrate the ADC for batteries... I had troubles calibrating with resistors because they have tolerance and everyone is different like you all know... I set pot at around 90k on positive side and 10k on the ground... I also use 1.1V internal reference... I would also add a capacitor before analog inputs...

The water and fuel tanks would go from buck converter through 600 ohm resistors to the positive rail and sensors which goes from 10-170 ohms to ground...

The nextion display is very sensitive on power supply, if the voltage drop below 5V it can get damaged, so is my buck converter going to be good for that or you have some better idea? Is it enough to use only 1 for arduino, nextion and water and diesel tank dividers or better to have separate buck converter for nextion only? It says that it can deliver 3 amps constant? Do you have something better to prepose regarding everything? I am open to all critics, that's why I am here :slight_smile:

The nextion connections are not in the schematic, i would hook power to nex after converter... I know that my schematic is not great but I think you can see everything, if not i can try to draw better...Thanks in advance

Here is a topic discussing a 12v to 5v solution in a car.

Looks like a buck converter only will not have enough protection? Read that topic and take advise from the experts, I just thought to direct you to that information.

Will do thank you :)... If anyone has any other suggestions or critics i would gladly listen :slight_smile:

Hello VTI_16V

Some thought that might help (or not!)

I am in the process of building a monitor and control system for a 50v UPS. Because the equipment it powers has a positive earth the actual output voltage is a nominal -50v. I bought precision (0.1%) resistors to use as a divider for measuring the voltage and the result is a measured voltage that is no more then 0.2v different from the voltage shown on my bench DMM. Close enough I think.

I have had problems with noise on the analogue measurements, to fix this I took care that all analogue earths were from the same point, fed the analogue circuits with a linear regulator and made sure to use plenty of ceramic 0.1u decoupling capacitors. I also make multiple measurements and take the average (10 bit A2D converter. 16 bit int leaves 6 bits unused, 6 bits gives 0 to 63, so 64. Therefore it is possible to add 64 10 bit measurements to a 16 bit int and be sure there won't be any overflow, for this reason I use 64 measurements and divide by 64).

Nextion display produces a lot of noise, if you've not found this to be a problem, fine. If you do have a noise problem consider giving it a separate PSU.

I have 2 Nextion displays doing 2 very different jobs, one is for a heating controller, one for light control. Both working very satisfactorily.

Perry

Hmmm interesting... I have some sort of problems on analog measurments which disappears when i shake some wires on the breadboard (example water and diesel tanks show 30% when the sensor is on half, but when i shake the wires on breadboard it returns to a normal) I wasnt sure if that's the problem with shitty breadboard or something else... Thought that it will go away when i put everything on PCB? Yesterday i read few topics about how ADC isn't working well with buck converters because of the noise... So is it better to add linear regulator like lm317 after the buck for cleaner power? The project is not yet finished because i am still waiting for some parts... My plan was to add 2 decoupling capacitors as close as possible to the analog inputs, and also on VCC pins of arduino... my plan was to go with 0.22uF and 100nF? I have also one more question... Can i connect analog input grounds to input ground of my buck converter insted of output? The grounds on the input and output of converter are not isolated, so would that be the same thing wherever i hook it up as long as analog grounds are on the same spot?

I have some sort of problems on analogue measurements which disappears when i shake some wires on the breadboard

You can't assume that wiring on a breadboard is completely reliable, the contacts are not always as good as you might hope. I would expect such problems to go away with the addition of solder (not to the breadboard!).

Yesterday i read few topics about how ADC isn't working well with buck converters because of the noise... So is it better to add linear regulator like lm317 after the buck for cleaner power?

Yes, quite possibly, but also earthing is very important. Earth everything to the same point, not to a bus.

Can i connect analogue input grounds to input ground of my buck converter insted of output? The grounds on the input and output of converter are not isolated, so would that be the same thing wherever i hook it up as long as analogue grounds are on the same spot?

If I've understood the question correctly, no, don't do that. The input ground is not the same as the output ground. Although they are connected together with copper, for the purposes of noise they are not the same because the input ground is carrying the input current and the output ground is carrying the output current. These 2 currents are not the same current with a switching regulator. Mixing them up an treating them as the same will most likely result in more noise. Feed the DC into the converter with 2 wires into the +ve and ground inputs and don't connect these to any other part of your circuit. Take the output from the +ve out and ground out and connect these to your circuit. The point at which the ground connection is made to your circuit becomes your ground for everything on your circuit, with individual wires from here to each thing that needs a ground connection. Don't take one wire and loop it round from one thing to the next to the next etc.

Thank you very much friend :)... I will follow your guindance and post project when I finish it if i don't run into some problems :)...