Well, how cool is your initiative, I have an old car with a carburetor and I would like to implement it in its instruments, where there is already a digital clock display, basic functions of an on-board computer and include temperature, oil pressure or quantity of fuel. I studied electronics about 20 years ago and I know that with Arduino I can implement it, but I'm not in the business, maybe with the material that I made available, thank you very much !!
Well done, I am not sure I am prepared to make the effort, but you thought outside the box! If only there was an easier way to get this done... Good job!!!
Thank you so much, my task just got much easier. I bought a 7" enhanced display to add some new features to my old mercedes benz and was struggling cause people do not seem to like sharing infos about this display. at least this can help me understand and carry one... i have to customize 7 gauges because the built in ones are so awful and png files are not supported yet ... keep it up
Your comment makes me happy. Thanks for sharing. Is nice to see I could help. The image format is not that relevant. I try adding different formats into the nextion editor and the used space was the same. Apparently gets converted into whatever format they use, no matter what image format you put. Are you going to create your own gauge? If you do, which image editor are you going to use?
Exactly, they seem to be using BMP, but they says png is coming soon, I can image how transparency will add realism to the future designs. I am actually designing my gauge background pastern on Photoshop then needles or progress bars will be animated using your example. So Helpful..
Let's see if they can really make that work with transparency. It would be cool indeed. Good luck with your project and if you get it to work, maybe upload a short video and share it with me please.
Sure . let me ask you this do you think an arduino mega can handle 2 nextion display?... I'm kind of crazy beginner... We could exchange ideas by mail if you want..
I've never used an arduino mega using multiple serial ports at the same time, but I don't see why it should be a problem, especially if you are only sending data to the displays. If you need to receive data like using touch-screen buttons, then might cause some issues. You would have to try. Worst case scenario you could use two arduinos, one for each display, and put a connection line between arduinos, with something like I2C. Or maybe two displays could share the same serial port? I don't know. You can email me my-user name/youtube-channel-name at gmail.com or click the contact button on my website.
It's simple. The nextion editor has a variable and then I run a timer (loop) that runs a piece of code that puts the correct image depending on the value of the variable. If you open my project, you'll see
Thanks for your easy work O have a request from you 4custom gauge and play if you share the pictures in the video I would appreciate it if you could put the pictures of all the videos under the videos so that we Can reach them.
What else can I show about gauges? So far my only plan for a video about the nextion display is about troubleshooting. If you have suggestions, let me know.
If it supports alpha transparency then create images of only the needle. That way you aren’t redrawing the entire display just the needle. Could save apu power to be used elsewhere. 😁
In the code itself i added comments to explain everything. Maybe you can also check out my video and code about tachometers, because i use the same nextion display and same gauge
wouldn't it be possible to make a speedo and other gauges? maybe use 3 screens . have the tachometer and speedo on one each. then fuel level. oil psi. h2o temp. and volts and or amps on a single large display. or would all the gauges on a single display take to much memory? great video I love the idea of creating custom gauges. especially with the graphics .. PS I'm a total newb. but I'm learning every day.
My project with the gauge I show on the video uses 20MB of flash memory. The maximum memory available is 32MB, and there is no model with more memory than that. You could do something like you describe, but with smaller gauges in a display no bigger than 3.5". Or just use the included gauges that you can add on the nextion editor. They flicker, but if you refresh them only when there is a new value to show, they flicker a lot less. But at least you can add as many gauges as you want without worrying about running out of memory. Maybe you could do the tachometer and speedometer with custom gauges, but both smaller than mine. And the rest you could use the traditional gauges or progress bars. You would have to test.
A few more questions: 1. What if I reprint the number value after gauge update?, will it anyway flickering? (number or text over the picture). 2. How do you did your gauge pictures, is there any way to do quickly and more efficient? Thanks in advanced
Yes, it will flicker no matter what you do. I did my gauge with powerpoint and photoshop. I am not very good with graphic design so I can't give you advice about that.
Yes, that's totally possible. Actually in my example file from my first video I did that for the gauge: th-cam.com/video/wIWxSLVAAQE/w-d-xo.html Even though that minimize the flickering, it doesn't prevent it completely. Eventually when the gauge refreshes, it does sometime flicker.
Unfortunately the only way of displaying two (and not more than two) gauges over each other is to use method 1 for the first, and method 2 for the second gauge....
Nice job excellent, I'm sorry for disturb you cause I've only been interested in two days with nextion. But what if I want to use two or more independent gauge on same screen? Because pictures are always placed from top left corner in the picture command.
@@interlinkknight I've been trying to combine the tach project with the demo reading adc's and everytime I do the adc's read and display ok and I can map them but it kills the tach 😂
When I load it, it says it's not the new version but it converter it and everything is there. Can you give me more details about the problem you are having? Maybe send screenshots and send it to my email
hello mate. first GREAT work, with your instructions i fix something like this. but i try when screen start do it check and show me the gauge from zero to 8000 rpm and then start count but i try so many times and dont find nothing can you help me how to do this?
Make on each cycle variable=variable + 1; You need to record in another variable that you did the test mode to reset and start normal mode. This is basic stuff. Look for tutorials about "if else functions"
Do you have and example of this code without a delay? I have come to find that your examples work better than using Nextions library, but using delay while reading actual RPM, MPH or KPH is a problem as a 20 mSec delay is a compounding problem. Im wondering if this should be used with millis() instead of delay?
You mean the small delay on the arduino loop? I put it because the nextion display doesn't like when arduino sends data too often. I suppose you could create a millis delay to send data less often. But let me tell you, I have used rpm sensors before and never had a problem with delays. Use interrupt pins.
Thanks sir, one thing I must ask : How did you make those so many images for the gage with needle. Is there any way to produce those interpolated images?
sir, i have a question. Could you please tell me how can i reach the photos of the project which is used for showing rpm value? we tried it but we couldnt take a copy of them to use our projecy.
InterlinkKnight sorry for my bad English I just understand what you mean, I have a simple project... i will make a LCD tachometer for my scooter with a nextion display and a alduino mega. The problem i have is to send the value from the rpm sensor to the nextion gauge (i have a rpm code for the sensor), but the gauge is not moving. I hope Your videos will be help me :S
Hello, I tried Your example files and it works very well. After i tried to write a code with your examples, and i would like to show the temperature on the display (it is not work). If i go on the serial monitor from arduino, i see the temperature but not on the display. I hope You can help me.. #include "Nextion.h" #include NexNumber n0 = NexNumber(0, 2, "n0"); double Thermistor(int RawADC) { double Temp; Temp = log(10000.0*((1024.0/RawADC-1))); Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp ); Temp = Temp - 273.15; //Temp = (Temp * 9.0)/ 5.0 + 32.0; return Temp; } void setup() { // put your setup code here, to run once: nexInit(); Serial.begin(9600); dbSerialPrintln("setup done"); } void loop() { int val; double temp; val=analogRead(0); temp=Thermistor(val); Serial2.print("n0.val="); //serial2 = because my display is on serial2 Serial2.print(temp); Serial2.write(0xff); Serial2.write(0xff); Serial2.write(0xff); delay(1000);
Looks like you forgot to initiate Serial2.begin(9600). You started Serial for debugging, but not Serial2. You need Serial2 too. Why are you using the nextion library? You should delete everything there about the nextion display, except the following: void setup() { Serial2.begin(9600); } void loop() { Serial2.print("n0.val="); //serial2 = because my display is on serial2 Serial2.print(temp); Serial2.write(0xff); Serial2.write(0xff); Serial2.write(0xff); }
very good!!! im having trouble when loading the .hmi file u provide from the description, the nextion editor says wrong resource, can u help me please.. thank u
Depends on the resolusion of the display and it has to be enhance version. Mine is 3.5 inch and you can see in the video that it loads the images really fast.
fantastic example and approach, just a question about memory... I have similar approach and similar ttf file size, but on my 3,2 screen uploader said: file is too large. memory it seems to be 4mb, but file is 20! What is my mistake? Do you have some suggestion? thanks in advance
Yes, the 3.2" enhanced display has 16MB of flash memory. I have the 3.5" enhanced so it has 32MB. You own the 5" enhanced display? Why are you talking about the 3.2"? Or do you have both?
I am working to make some test on 'little' 3.2 basic and I am waiting from ITEAD 5" enhanced display... so I am working now with 4mb.... and 2/3 pages fill the memory.... I have a gauge based on RPM bars.... And I think that is not possible to load all images in 32mb, because images allocation is 10mb, but ttf compiled module will be 96mb (it uses RAW image format) :-) so I am working to draw the bars... it seems to work on 3.2, I will see on 5".... thanks for your support
I can help you, but with a limit. I can't do the project for you, and I can't explain every single thing. That's why I've made the tutorials. If after watching all my tutorials and you have a problem, let me know.
InterlinkKnight I would like to make a display of commands and control for my camper with the display nextion and Arduino mega. I have already created the menu with the display nextion but I can not make the program for Arduino and put them in communication. Here you can help me in this
Is it possible to get that same precision out of nextion, to control a stepper motor, using it in place of a rotary encoder to micro step to positions?
@@interlinkknight That’s cool.. I’m looking into it now.. I want the same type of resolution you’re getting to change the images, except using a slider in nextion, to rotate a stepper..
hey mi friend i have problems with the program when i upload de nextion panel and is : Target device does not match selectec device when i change te display ?? or i have a start a new proyect with this caracteristics and your tutorial ? i have a nextion 400x240 and this error when i upload
Good video! But I have a problem, when I copy pictures inside nextion editor, then the nextion editor generates a white border for all pictures, and so it seems no good, because the background Is black and pictures are not confused with background. Maybe Is a bug of nextion editor, I don't know. I'm waiting for your answare. Thank you!
My display Is the same of you (3.5 inch). I'd like to insert a picture of a gauge like you. But I don't understend your answare, because the resolution of the screen is 420x380 px but the resolution of the gauge is less of screen one. Thanks for your time
Oh. You mean a normal picture. I thought you meant the background picture. I've never seen your problem before. Try with other kind of images. Remember to be bmp format
It's a big problem. At first I wanted insert pictures of gauge without background, but nextion editor added white background automatically. So I thinked to add manually balck background to all gauge pictures (because screen background Is black, and gauge pictures seem without background). However the problem now is that when I insert gauge picture in the screen, I see a thin white border around the square of the gauge, and so it doesn't look nice. The format is png, but I have the problem also with bmp. For exemples of I take a picture of your gauge and I resize It (with a program like Illustrator) then i Will see the same border (sometimes I don't see all the border of Square but 2 or 3 or 1). Thank you very much, and Sorry but you are very qualified. If you don't understend i could send a picture to you. Thanks
I'm using your copied code for the tach but the tach is not going up in rpm. All my connections are correct and have tested my potentimeter by using a number id and analogRead in that. It displays the analog output on the number ID but does not move the dial in the tach.
@@interlinkknight Like Noble Knight Medraut, I have been stucked with the tachometer without deleting the baud rate change. Even 9600 instead of 115200 does not work. I had to // the corresponding instructions.
Do the background and then in another layer put the gauge with the pivot point in the center. Then save the image on every degree position. I did it on PowerPoint, but I would recommend using something like Photoshop.
So those gauges are onboard, what about sending bitmaps to the Arduino and show them that way? PC => Bitmap => Arduino => Nextion using USB Bulk Transfer. Is this feasible at 40fps? I have never done anything Arduino related but I am looking for hardware to do a project for flight sim gauges.
That's not possible. The nextion display can only receive commands, values and text. All the images, layout and text boxes and everything should be already on the nextion display, created with the nextion editor. If you have a flight simulator and want another screen for gauges, I think is better that you add a normal computer monitor (small) and show the gauges there, driven directly by the computer and the simulator itself.
Stupid question, but could I use this display to run a desktop? I'm thinking of building a mini laptop, running arch with an openbox desktop - I can't figure out if I can
You need to load the file on the nextion editor and then you can convert the file. Please watch part 1 to learn how to upload the project to the display
I don't get how you smooth, can you please help me? Also are you taking a picture at every degree, or every how much is each picture different from each other. (Like are you doing 208 pictures because there's 208 degrees?)
Another question..... if my display is enhanced, but a different size, I seem to get an error...compile failed, position error, etc. How do I convert it for a different screen size?
Watch all my tutorials about the nextion display and try my examples. All the information you want is there. If after all that you still have a question, ask me and I'll try to help.
I have watched all of them, but seems the examples only work if you have the same screen size. Mine is 240x400. Selecting a different screen size other that the one in example just results in an error.
Is there an automated way of producing a series of gauge pics? I've made a gauge in Inkscape using the SVG format, however it is very time consuming moving the needle/dial each and every time then exporting the pic.
Yeah, that's what I thought. Keep in mind that not all of the enhanced versions have the faster CPU. Only the 3.5" and up have the faster CPU. I bought the 3.5" enhanced version for that reason. A faster CPU is important, in my opinion. What if you use smaller images for the gauge? That helps with the speed/flickering? Thanks for sharing the results of your test. It's good to know.
I might write a program that allows you to hook in on the ID of the needle in the SVG file, then automatically rotates it and exports each individual image.
the problem with this method is that those images need to go int the flash memory which will take lots of space. liked your video but not a good solution.
Its called Arduino nano. I like it because uses the same sketch than arduino uno and its smaller. Also fits in a breadboard perfectly. Since I started using the arduino nano, I stop using the uno. Good luck
I downloaded the HMI project for this and noticed it only has the Star Wars video, not the gauge. Is it possible you could upload the HMI project with the tach pictures so I can walk through the project?
@@interlinkknight dont work cant open arduino say but i find the file thanks. i want to ask you something. if i dont want to work gauge with potentiometer but with my can bus. the example is that. include #include int data; char buffer[456]; void setup() { Serial.begin(9600); Serial.println("CAN-Bus Test");
Canbus.ecu_req(ENGINE_RPM, buffer); Serial.println(buffer); Serial.print(""); delay(10); } the code show me the value with buffer how to do work this buffer with nextio gauge?
@@interlinkknight at your code i have problem. i dont find how to work your gauge with out potentiometer. the value from the potentiometer i give him from serial port and not from analogRead. thanks and sorry about my question and for my english :D
So useful, congrats. BTW do you know how to place some other object over a picture pe in this case the gauge, because I tried but at first image update disappear the other objects, I need to do a timer like this one cdn-images-1.medium.com/max/1600/1*Y2La3-gXvH_8xWOcRG_HwQ.png (in progress section).
Sorry but that's not really possible. One "rule" for making nextion projects is never overlap objects. The moment you update an object, is going to hide the other object. It will flicker. The only way to maybe do this is by dividing the background image in sections to leave an empty space in the middle, but this is time consuming and make things more complicated.
Finally something to install in my car.. I always wanted a digital display instead my analog gauge.. thanks..
Very good job! Thanks a lot, i liked the "no nextion library" in sketch, very simple and clean!!
Well, how cool is your initiative, I have an old car with a carburetor and I would like to implement it in its instruments, where there is already a digital clock display, basic functions of an on-board computer and include temperature, oil pressure or quantity of fuel. I studied electronics about 20 years ago and I know that with Arduino I can implement it, but I'm not in the business, maybe with the material that I made available, thank you very much !!
thank you . the examples are very helpfull for introduction the nextion displays.
I am here to help.
I am happy that i found your channel! Thanks for doing all the work and share your knowhow!
I like to help others, so my pleasure.
I'm a child with this !!!!
I need this with a my speedometer of my car!!
Friend...
You are brilliant!
Looks great, thank you for sharing!
I'm glad I could help
Well done, I am not sure I am prepared to make the effort, but you thought outside the box! If only there was an easier way to get this done... Good job!!!
I would love more information on adding a short video like you did. Can't find anything to help.
Thank you so much, my task just got much easier. I bought a 7" enhanced display to add some new features to my old mercedes benz and was struggling cause people do not seem to like sharing infos about this display. at least this can help me understand and carry one... i have to customize 7 gauges because the built in ones are so awful and png files are not supported yet ... keep it up
Your comment makes me happy. Thanks for sharing. Is nice to see I could help. The image format is not that relevant. I try adding different formats into the nextion editor and the used space was the same. Apparently gets converted into whatever format they use, no matter what image format you put. Are you going to create your own gauge? If you do, which image editor are you going to use?
Exactly, they seem to be using BMP, but they says png is coming soon, I can image how transparency will add realism to the future designs. I am actually designing my gauge background pastern on Photoshop then needles or progress bars will be animated using your example. So Helpful..
Let's see if they can really make that work with transparency. It would be cool indeed. Good luck with your project and if you get it to work, maybe upload a short video and share it with me please.
Sure . let me ask you this do you think an arduino mega can handle 2 nextion display?... I'm kind of crazy beginner... We could exchange ideas by mail if you want..
I've never used an arduino mega using multiple serial ports at the same time, but I don't see why it should be a problem, especially if you are only sending data to the displays. If you need to receive data like using touch-screen buttons, then might cause some issues. You would have to try. Worst case scenario you could use two arduinos, one for each display, and put a connection line between arduinos, with something like I2C. Or maybe two displays could share the same serial port? I don't know. You can email me my-user name/youtube-channel-name at gmail.com or click the contact button on my website.
Thank you verry mutch, i thought that made a mistake after i had a flickering gauge but you have the answer.
Very nice video, how did you manage to make the images change depending on the received value inside the NEXTION editor ?
It's simple. The nextion editor has a variable and then I run a timer (loop) that runs a piece of code that puts the correct image depending on the value of the variable. If you open my project, you'll see
Thanks for your easy work
O have a request from you 4custom gauge and play if you share the pictures in the video I would appreciate it if you could put the pictures of all the videos under the videos so that we Can reach them.
drive.google.com/file/d/1Ven2BWcz36pLgmmOZK3z6TD9WnBAdGB_/view?usp=sharing
Sir used for this model Nextion NX4832T035 3.5 Inch 480x320 HMI TFT LCD Touch Display Module
Please share more videos for gauges .
What else can I show about gauges? So far my only plan for a video about the nextion display is about troubleshooting. If you have suggestions, let me know.
If it supports alpha transparency then create images of only the needle. That way you aren’t redrawing the entire display just the needle. Could save apu power to be used elsewhere. 😁
I said it doesn't support transparent images.
Excelent example, thanks
Sir used for this model Nextion NX4832T035 3.5 Inch
Fantastic, thank you for sharing this!
No problem.
Thank you, that's exactly what i'm needing.
What is your project?
it's a replace to my TID car(GM - Zafira), i want to put a gauge to show the actual GNV level.
Nice. Good luck with that
Please explain more the,gauge smoothen and deadzone part of the code. # What is the purpose of Deadzone?
# in calculation how the smoothening happens?
In the code itself i added comments to explain everything. Maybe you can also check out my video and code about tachometers, because i use the same nextion display and same gauge
@@interlinkknight please share the link of tachometer video
th-cam.com/video/u2uJMJWsfsg/w-d-xo.html
@@interlinkknight actually this method kill the flash memory.
First of all Nice Job!
In second place i have a question...
How can i hide and display the three little images (motor, battery, oil) on the bottom?
There's a command to hide objects. If you check the example files you can see them
@@interlinkknight i find it, thank you
So this picture hack will only work on the enhanced version right?
Thanks for the gread video, very informative.
Technically you could try it on the basic version, but you would probably see it more lagy, with less FPS.
you are the man!! thank you
Very clever
wouldn't it be possible to make a speedo and other gauges? maybe use 3 screens . have the tachometer and speedo on one each. then fuel level. oil psi. h2o temp. and volts and or amps on a single large display. or would all the gauges on a single display take to much memory? great video I love the idea of creating custom gauges. especially with the graphics ..
PS I'm a total newb. but I'm learning every day.
My project with the gauge I show on the video uses 20MB of flash memory. The maximum memory available is 32MB, and there is no model with more memory than that. You could do something like you describe, but with smaller gauges in a display no bigger than 3.5".
Or just use the included gauges that you can add on the nextion editor. They flicker, but if you refresh them only when there is a new value to show, they flicker a lot less. But at least you can add as many gauges as you want without worrying about running out of memory.
Maybe you could do the tachometer and speedometer with custom gauges, but both smaller than mine. And the rest you could use the traditional gauges or progress bars. You would have to test.
Very good job idol
Gauge how segmentation and to extract your background picture?I would appreciate it if you know if there is how? photoshop...?
I made it in Photoshop and PowerPoint, but I don't recommend it because it's not an ideal software for that
A few more questions:
1. What if I reprint the number value after gauge update?, will it anyway flickering? (number or text over the picture).
2. How do you did your gauge pictures, is there any way to do quickly and more efficient?
Thanks in advanced
Yes, it will flicker no matter what you do.
I did my gauge with powerpoint and photoshop. I am not very good with graphic design so I can't give you advice about that.
Nice. Is there a way to refresh a needle ONLY if it's value has changed else not update needle?
Then it would not flicker.
Yes, that's totally possible. Actually in my example file from my first video I did that for the gauge: th-cam.com/video/wIWxSLVAAQE/w-d-xo.html
Even though that minimize the flickering, it doesn't prevent it completely. Eventually when the gauge refreshes, it does sometime flicker.
Many thanks, excellent tutorial
Unfortunately the only way of displaying two (and not more than two) gauges over each other is to use method 1 for the first, and method 2 for the second gauge....
Nice job excellent,
I'm sorry for disturb you cause I've only been interested in two days with nextion.
But what if I want to use two or more independent gauge on same screen? Because pictures are always placed from top left corner in the picture command.
You can put multiple gauges in any part of the display. You are limited by the flash memory, though.
@@interlinkknight hello. Did you mean flash memory of microcontroller? I want to make small animation with Basic Nextion.Where to store pictures?
high, nice video, mm i have a problem with crop imagen in gauge, dont work fine.
I don't know
Hi,
So what should I do to minimize flickering with standard nextion gauge?
Thanks
refresh the gauge only when the value changes
Did you ever build a fully working dash with this that uses sensors ?
Yes and no. I built a dashboard but with real gauges. With the nextion display i only made demo projects, so far
@@interlinkknight I've been trying to combine the tach project with the demo reading adc's and everytime I do the adc's read and display ok and I can map them but it kills the tach 😂
Maybe there's a conflict using interrupts?
Can you tell me what you wrote in the timer event? Even if you download the project file, it seems that it is not the latest version.
When I load it, it says it's not the new version but it converter it and everything is there. Can you give me more details about the problem you are having? Maybe send screenshots and send it to my email
Gracias! excelente aporte.
De nada.
hello mate. first GREAT work, with your instructions i fix something like this. but i try when screen start do it check and show me the gauge from zero to 8000 rpm and then start count but i try so many times and dont find nothing can you help me how to do this?
Make on each cycle variable=variable + 1;
You need to record in another variable that you did the test mode to reset and start normal mode. This is basic stuff. Look for tutorials about "if else functions"
Do you have and example of this code without a delay? I have come to find that your examples work better than using Nextions library, but using delay while reading actual RPM, MPH or KPH is a problem as a 20 mSec delay is a compounding problem. Im wondering if this should be used with millis() instead of delay?
You mean the small delay on the arduino loop? I put it because the nextion display doesn't like when arduino sends data too often. I suppose you could create a millis delay to send data less often.
But let me tell you, I have used rpm sensors before and never had a problem with delays. Use interrupt pins.
Thanks sir, one thing I must ask : How did you make those so many images for the gage with needle. Is there any way to produce those interpolated images?
Powerpoint. But i would suggest something like Photoshop
Excelent project ,iam try to this project for arudino uno r3 and nextion 2.4 disply so pls send arudino code sir
It's already on the description
Hi. what software or tool did you use to create the Gauge images in the row? Thanks
PowerPoint and Photoshop
sir, i have a question. Could you please tell me how can i reach the photos of the project which is used for showing rpm value? we tried it but we couldnt take a copy of them to use our projecy.
drive.google.com/file/d/1Ven2BWcz36pLgmmOZK3z6TD9WnBAdGB_/view?usp=sharing
Awesome! how did You play a video on the nextion display ??
Like I mention on the video, I just show a series of images very fast. The example files are on the description, so you can see it for yourself.
InterlinkKnight sorry for my bad English I just understand what you mean, I have a simple project... i will make a LCD tachometer for my scooter with a nextion display and a alduino mega. The problem i have is to send the value from the rpm sensor to the nextion gauge (i have a rpm code for the sensor), but the gauge is not moving. I hope Your videos will be help me :S
Start by using my example files for my 1st video tutorial. When that works, you could give my custom gauge a try.
Hello, I tried Your example files and it works very well.
After i tried to write a code with your examples, and i would like to show the temperature on the display (it is not work).
If i go on the serial monitor from arduino, i see the temperature but not on the display.
I hope You can help me..
#include "Nextion.h"
#include
NexNumber n0 = NexNumber(0, 2, "n0");
double Thermistor(int RawADC) {
double Temp;
Temp = log(10000.0*((1024.0/RawADC-1)));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15;
//Temp = (Temp * 9.0)/ 5.0 + 32.0;
return Temp;
}
void setup() {
// put your setup code here, to run once:
nexInit();
Serial.begin(9600);
dbSerialPrintln("setup done");
}
void loop() {
int val;
double temp;
val=analogRead(0);
temp=Thermistor(val);
Serial2.print("n0.val="); //serial2 = because my display is on serial2
Serial2.print(temp);
Serial2.write(0xff);
Serial2.write(0xff);
Serial2.write(0xff);
delay(1000);
Serial.print("Temperature = ");
Serial.print(temp);
Serial.println(" C");
delay(1000);
}
Looks like you forgot to initiate Serial2.begin(9600). You started Serial for debugging, but not Serial2. You need Serial2 too.
Why are you using the nextion library? You should delete everything there about the nextion display, except the following:
void setup() {
Serial2.begin(9600);
}
void loop() {
Serial2.print("n0.val="); //serial2 = because my display is on serial2
Serial2.print(temp);
Serial2.write(0xff);
Serial2.write(0xff);
Serial2.write(0xff);
}
very good!!! im having trouble when loading the .hmi file u provide from the description,
the nextion editor says wrong resource, can u help me please.. thank u
sorry, i guess because im using the basic version, not the enhanced version :(
Yeah, you need the enhance version because it uses a lot of memory
Hi,one question. For your video, when you click select picture, did you just select one of those pictures?
I'm not sure what do you mean. I didn't select any picture.
Good job BTW
I would like to use this method to create a vu-meter for hi-end audio systems but which is the time to load the background image ?
Depends on the resolusion of the display and it has to be enhance version. Mine is 3.5 inch and you can see in the video that it loads the images really fast.
fantastic example and approach, just a question about memory... I have similar approach and similar ttf file size, but on my 3,2 screen uploader said: file is too large. memory it seems to be 4mb, but file is 20! What is my mistake? Do you have some suggestion? thanks in advance
ok, I saw the spec of your display, and ok, your model has 32mb probably, I have 5" display also and probably this will be ok.
Yes, the 3.2" enhanced display has 16MB of flash memory. I have the 3.5" enhanced so it has 32MB. You own the 5" enhanced display? Why are you talking about the 3.2"? Or do you have both?
I am working to make some test on 'little' 3.2 basic and I am waiting from ITEAD 5" enhanced display... so I am working now with 4mb.... and 2/3 pages fill the memory.... I have a gauge based on RPM bars.... And I think that is not possible to load all images in 32mb, because images allocation is 10mb, but ttf compiled module will be 96mb (it uses RAW image format) :-) so I am working to draw the bars... it seems to work on 3.2, I will see on 5".... thanks for your support
Ok. Good luck
did you make working version for basic model
Hi dear, the your progect is fantastic.
J want to know if you can help to me to make a my progect with Arduino mega and tft nextion.
You can?
I can help you, but with a limit. I can't do the project for you, and I can't explain every single thing. That's why I've made the tutorials. If after watching all my tutorials and you have a problem, let me know.
InterlinkKnight
I would like to make a display of commands and control for my camper with the display nextion and Arduino mega.
I have already created the menu with the display nextion but I can not make the program for Arduino and put them in communication.
Here you can help me in this
I can only help in specific problems. You have to watch my tutorials to have a more general idea on how it works.
Is it possible to get that same precision out of nextion, to control a stepper motor, using it in place of a rotary encoder to micro step to positions?
Stepper motors are a completely different subject, but I guess it should work. My experience with stepper motors is very little
@@interlinkknight That’s cool.. I’m looking into it now.. I want the same type of resolution you’re getting to change the images, except using a slider in nextion, to rotate a stepper..
hey mi friend i have problems with the program when i upload de nextion panel and is : Target device does not match selectec device when i change te display ?? or i have a start a new proyect with this caracteristics and your tutorial ? i have a nextion 400x240 and this error when i upload
In the nextion editor, the top tool bar there's a button called "Device ID" in the right part of the tool bar. Click there and select your display.
How did you create the gauge? I know how to make one but without the numbers, I'm using gimp. How do you make one with numbers?
PowerPoint, but not the ideal program to do it
Good video! But I have a problem, when I copy pictures inside nextion editor, then the nextion editor generates a white border for all pictures, and so it seems no good, because the background Is black and pictures are not confused with background. Maybe Is a bug of nextion editor, I don't know. I'm waiting for your answare. Thank you!
Looks like the pictures you are adding have the wrong resolution. Add pictures that have exactly the same resolution as your display
My display Is the same of you (3.5 inch). I'd like to insert a picture of a gauge like you. But I don't understend your answare, because the resolution of the screen is 420x380 px but the resolution of the gauge is less of screen one. Thanks for your time
Oh. You mean a normal picture. I thought you meant the background picture. I've never seen your problem before. Try with other kind of images. Remember to be bmp format
It's a big problem. At first I wanted insert pictures of gauge without background, but nextion editor added white background automatically. So I thinked to add manually balck background to all gauge pictures (because screen background Is black, and gauge pictures seem without background). However the problem now is that when I insert gauge picture in the screen, I see a thin white border around the square of the gauge, and so it doesn't look nice. The format is png, but I have the problem also with bmp. For exemples of I take a picture of your gauge and I resize It (with a program like Illustrator) then i Will see the same border (sometimes I don't see all the border of Square but 2 or 3 or 1). Thank you very much, and Sorry but you are very qualified. If you don't understend i could send a picture to you. Thanks
Send me the pictures to my email myusername@gmail.com
Should I need to create an image for each position of the pointer ?
Yeah
I'm using your copied code for the tach but the tach is not going up in rpm. All my connections are correct and have tested my potentimeter by using a number id and analogRead in that. It displays the analog output on the number ID but does not move the dial in the tach.
Did you modify anything on arduino or nextion display?
@@interlinkknight I figured it out. Changed the baud rates from 115200 to 9600.
@@interlinkknight Like Noble Knight Medraut, I have been stucked with the tachometer without deleting the baud rate change. Even 9600 instead of 115200 does not work. I had to // the corresponding instructions.
I still don't get how you made the gauge, I'm trying to make the same in Gimp but I'm stumped.
Do the background and then in another layer put the gauge with the pivot point in the center. Then save the image on every degree position. I did it on PowerPoint, but I would recommend using something like Photoshop.
So those gauges are onboard, what about sending bitmaps to the Arduino and show them that way? PC => Bitmap => Arduino => Nextion using USB Bulk Transfer. Is this feasible at 40fps? I have never done anything Arduino related but I am looking for hardware to do a project for flight sim gauges.
That's not possible. The nextion display can only receive commands, values and text. All the images, layout and text boxes and everything should be already on the nextion display, created with the nextion editor.
If you have a flight simulator and want another screen for gauges, I think is better that you add a normal computer monitor (small) and show the gauges there, driven directly by the computer and the simulator itself.
Dang.. Well I'll keep looking more other alternatives. Thanks for you help!
Any way to add this to an Arduino and add toggle switches w/led indicators?
I don't understand the question
Sir this project is possible to run in NX4832T035 model and also i have the doubt how to fix the movement needle in that
No, it doesn't run on the basic version. You need the enhanced version 3.5"
Stupid question, but could I use this display to run a desktop? I'm thinking of building a mini laptop, running arch with an openbox desktop - I can't figure out if I can
No.
Do you have any recommended code for Arduino to run the tach with a hall effect sensor?
There are many ways to calculate RPM but my favorite is this one: drive.google.com/open?id=1-sQwPFmjTH0v_bjaUvaHqcNsHndRLq2y
Can't upload hmi file to display, says that file is too large. Is it possible to store the file in sd card? I mean, keep it in sd card..
You need to load the file on the nextion editor and then you can convert the file. Please watch part 1 to learn how to upload the project to the display
I don't get how you smooth, can you please help me? Also are you taking a picture at every degree, or every how much is each picture different from each other. (Like are you doing 208 pictures because there's 208 degrees?)
The explanation of how the code works is in the comments inside the code.
And yes, I made an image of the gauge every degree
@@interlinkknight Thanks! How did you made the background of the gauge and the needle?
A mix of PowerPoint and Photoshop
Hi! Which software do you use to make pictures from the video?
The symbols i took from internet. The rest was a mix of Photoshop and PowerPoint
@@interlinkknight Ok, thank you the ansver!
Another question..... if my display is enhanced, but a different size, I seem to get an error...compile failed, position error, etc. How do I convert it for a different screen size?
Watch all my tutorials about the nextion display and try my examples. All the information you want is there. If after all that you still have a question, ask me and I'll try to help.
I have watched all of them, but seems the examples only work if you have the same screen size. Mine is 240x400. Selecting a different screen size other that the one in example just results in an error.
It is nearly impossible to resize all the pictures in a video sequence. Is there an easier method?
For things like full size images, you have to provide the images in the correct size of your display.
Is there an automated way of producing a series of gauge pics? I've made a gauge in Inkscape using the SVG format, however it is very time consuming moving the needle/dial each and every time then exporting the pic.
Sorry but I don't know a way to automatically produce the images. I spend a lot of hours to create mine.
Thanks. I just tried it on a non-enhanced 3.5inch display. It still flickers noticeably. I think the enhanced version is the way to go.
It still is a big improvement.
Yeah, that's what I thought. Keep in mind that not all of the enhanced versions have the faster CPU. Only the 3.5" and up have the faster CPU. I bought the 3.5" enhanced version for that reason. A faster CPU is important, in my opinion.
What if you use smaller images for the gauge? That helps with the speed/flickering?
Thanks for sharing the results of your test. It's good to know.
I might write a program that allows you to hook in on the ID of the needle in the SVG file, then automatically rotates it and exports each individual image.
thanks
What model is ardino ?
nano
the problem with this method is that those images need to go int the flash memory which will take lots of space. liked your video but not a good solution.
👍👍👍
Can you share your gauge pics please?
thank you I realized it's in the hmi file
so you star wars video was just lots of images?
yes
how can i create an animation like you did. i mean i have to use photoshop but what it is called
What it is called what? I did it with powerpoint, but you can use whatever you want.
okay thanks!
I bought the display only for the program to refuse to make a tft file wtf
?
InterlinkKnight nvm I didn’t see that it had a compiling error
what is the arduino model you use
Its called Arduino nano. I like it because uses the same sketch than arduino uno and its smaller. Also fits in a breadboard perfectly. Since I started using the arduino nano, I stop using the uno. Good luck
thanks, good luck
OHHHH MY GOD, I WANT A GAME LIKE THIS WITH PEDAL NOT SWITCH OR LEVER!!😭😭WITH ACCELERATION
I downloaded the HMI project for this and noticed it only has the Star Wars video, not the gauge. Is it possible you could upload the HMI project with the tach pictures so I can walk through the project?
Please check more carefully. The hmi project for the car gauge has been on the description since I uploaded the video.
Why can mov?
how to get the code? i dowload but dont open.
I put the links for both files in the description for Arduino IDE and Nextion Editor
@@interlinkknight dont work cant open arduino say but i find the file thanks. i want to ask you something. if i dont want to work gauge with potentiometer but with my can bus. the example is that.
include
#include
int data;
char buffer[456];
void setup() {
Serial.begin(9600);
Serial.println("CAN-Bus Test");
if(Canbus.init(CANSPEED_500))
{
Serial.println("CAN Init ok");
} else
{
Serial.println("Fail init CAN");
}
delay(1000);
}
void loop() {
Canbus.ecu_req(ENGINE_RPM, buffer);
Serial.println(buffer);
Serial.print("");
delay(10);
}
the code show me the value with buffer how to do work this buffer with nextio gauge?
Sorry but I can't help further than this. I have no idea where that code came from. I only can help with my code
@@interlinkknight at your code i have problem. i dont find how to work your gauge with out potentiometer. the value from the potentiometer i give him from serial port and not from analogRead. thanks and sorry about my question and for my english :D
I don't know how to do that so I can't help
How to play video Sir ?
I explained exactly that on the video. Please pay attention.
Thanks Sir. I will pay more attention.
So useful, congrats. BTW do you know how to place some other object over a picture pe in this case the gauge, because I tried but at first image update disappear the other objects, I need to do a timer like this one cdn-images-1.medium.com/max/1600/1*Y2La3-gXvH_8xWOcRG_HwQ.png (in progress section).
Sorry but that's not really possible. One "rule" for making nextion projects is never overlap objects. The moment you update an object, is going to hide the other object. It will flicker. The only way to maybe do this is by dividing the background image in sections to leave an empty space in the middle, but this is time consuming and make things more complicated.
InterlinkKnight thanks I'll take it on mind
wow
Hay sir can I get your Facebook I want to talk with you
I don't use facebook. If you want to chat, maybe on google hangouts. Go to my website and send me a message there.
can you send me an email please
What? If you want to contact me, you send me an email. My email address is my username at gmail.