The Sunday Blog: New Discovery HMI available

They have come to market!

These are extremely good news: The new Discovery (F) series HMIs are finally available! Attentive readers have already seen my announcement a few weeks before, stating that ongoing component shortages and flamboyant component (CPU) prices made it necessary to offer a drop-in alternative for the smaller Basic (T) series HMIs. But my dear Chinese colleagues went beyond that: The new Discovery HMIs are less expensivemore performant, and more energy efficient than their Basic siblings!

Let’s look at all this in detail:

Less expensive: The small Basic (T) series formats cost actually $22.90 (2.4″), $25.40 (2.8″), and $32.40 (3.5″), mostly due to a thirteen(!) times higher CPU price compared to 2019. The Discovery (F) series are at $18.40 (2.4″), $20.40 (2.8″), and $29.90 (3.5″). That means, you save already from 8 to 20%! Actually, you may even save more when ordering before August 25, benefitting from the Nextion Summer Sales which give you discounts from 8% (single unit) to 12%(3 or more similar products) and an extra $20 off when ordering for over $300.

More performant: With a 64MHz CPU instead of 48MHz for the Basic (T) series, and with better image compression, you have more execution speed (+37%) and less flash memory consumption. I pointed out these details in my recent article, including a benchmark HMI project with amazing results.

More energy efficient: While the power consumption of the smaller Basic (T) series HMIs ranges from 90mA (2.4″) to 145mA (3.5″) with full display brightness and 15mA in sleep mode, the Discovery (F) series will only take from 90mA (2.4″) to 120mA (3.5″) and 4.5mA in sleep mode. On top of that, the latter give you a new deep sleep mode which is said to bring the current consumption down to 0.25mA! See also my recent article about energy efficient design where I document all system variables which are relevant for the sleep modes.

And a first specific Demo project

“Never trust the marketing guys” is one of the principles of my decades long work life. Thus, I made a simple demo project for today, with two purposes: First, evaluating and measuring the real power consumption of the Discovery (F) series HMI in the different modes under real conditions, and second, to show you, dear readers, how to implement the sleep modes in Nextion programming language.

It’s a single page project. Below the title bar, a first central element is a dual state button which allows to toggle between the normal and the deep sleep mode by setting the lowpower system variable to 0 or 1. The other active element is a slider which allows to set the sleep timeout either to 0 or to any value between 3 and 60 seconds (timeouts of 1 or 2 seconds can not be set!) . The current sleep timeout is then displayed in a text component above the slider.

But wait… having a slider giving values either = 0 or ranging in +1 steps from 3 to 60? How is that possible? A simple variable trick helps us with this: The slider has its min and max values set to 0 and 58, respectively. In the TouchRelease event code, there is an if clause which sets our global variable slp to 0 (and t3.txt to “0 (Disabled)”) when h0.val is 0. In the else part of that if clause, we set slp to h0.val+2 to map the slider’s values ranging from 1 to 58 into sleep timeout values from 3 to 60 seconds. Afterwards, we set the system variable thsp to the value of slp. That’s it.

For convenience, we duplicate the display update code into the slider’s TouchMove event, so that we don’t have to release the slider each time we want to see what we selected.

Finally, there is the page’s PostInitialize event code which sets thup to 1, just to make sure that we’ll be able to wake up the display by touching it.

The code

program.s:

int slp=0     // calculated sleep delay
page 0        // Power on start page 0

page0.PostInitializeEvent:

thup=1        // make sure it will wake up on touch!

bt0.TouchReleaseEvent:

lowpower=bt0.val     // sleep or deep sleep
if(bt0.val==1)
{
  t3.pco=bt0.pco2    // adapt t3 text color
  bt0.txt="Deep"
}else
{
  t3.pco=bt0.pco     // adapt t3 text color
  bt0.txt="Normal"
}

h0.TouchReleaseEvent:

if(h0.val==0)
{
  slp=0
  t3.txt="0 (Disabled)"
}else
{
  slp=h0.val+2 // minimum is 3 seconds!
  covx slp,t3.txt,2,0
  t3.txt+=" s"
}
thsp=slp

bt0.TouchMove (the same, but only updating the display, not setting tsp each time):

if(h0.val==0)
{
  slp=0
  t3.txt="0 (Disabled)"
}else
{
  slp=h0.val+2 // minimum is 3 seconds!
  covx slp,t3.txt,2,0
  t3.txt+=" s"
}

Measurement results

My combined handheld oscilloscope and multimeter Hantek 2072 has not laboratory precision. Its lowest, 99.99mA range, is not very suitable for precisely measuring currents below 1mA because of a +/-0.3mA tolerance, but let’s see…

Here’s what I got during normal operation at full brightness, pretty close to the 120mA indicated in the data sheet:

Normal sleep mode (4.5mA) is confirmed, too:

And finally the deep sleep mode where my Hantek indicates the correct order of magnitude, but where it fails being precise enough to confirm the 0.25mA. The reading is inside the tolerance band, though:

So, basically, the data sheet values are all confirmed!

As usual, here is the corresponding project file, have fun playing around with it: Discovery_sleep_demo.HMI

And with this, dear readers, I’ll leave you for today, giving you the opportunity to fill up your stocks using the aforementioned Summer Sales discounts.

Happy Nextioning!