Start a new topic

24hr timer pwm led control

can anyone tell me if this project is possible using the nextion enhanced on its own 

i have 4 meanwell ldd led drivers and 2 pwm pc fans

i would like a 24hr cycle with the ability to increase the pwm gpio from 0-5v on both the led drivers and the fans simultaneously 

- i would like to control the time when the leds + fans start to turn on

- i would like to control the time it takes to go from 0-5v

- i would like to control the time it takes to go from 5-0v

- i would like to control the time when the leds + fans turn off completely

the above parameters will need to be adjustable on screen

so basically user inputs on time, off time, ramp up duration and ramp down duration  

is this possible? is anyone willing to help me achieve this

i have purchased a 3.2" nextion enhanced screen, but after searching online i cant find where to start with this project

As an HMI device, the Nextion would be used

   - to display choices to the user

   - capture user input

   - send user input to the controlling MCU

The controlling MCU would be responsible for

   - receiving the user selection

   - deciding if choice is valid at this time

   - executing choice logic if it is safe to do so

   - provide status and progress back to the user

Which controlling MCU is finally used is user choice

Which programming language used is user choice

Which compiler to use is users choice.

What components used in such a project is user choice.

Understanding the components selected and how the operate

with the user selected MCU is within the user domain to then

implement their project with components user selected.

ok Thanks, so arduino is needed and the  rtc on the nextion board will talk to the arduino, so why does this board have pwm control and gpio pins, is this just an extension of the gpio on the arduino? 

Nextion GPIO is 3.3V (refer to Datasheet)

Nextion GPIO is low current perhaps maxing ~20ma or less

Timer on Nextion is interpreted 50+ms resolution

PWM frequency is fixed (user settable) for all pwm4 to pwm7

PWM duty on each can be set per GPIO

RTC is onboard with Enhanced Nextion series

Checking RTC time against desired times isn't instant

Nextion is not designed to be an MCU replacement.

Certainly not simultaneous changes on all pins

So while a portion can be accomplished via Nextion Logic

Perhaps not in the traditional sense an MCU is able to do.

To have a Proof of Concept via Nextion logic .. perhaps

To have fine control, certainly not like an MCU can control.

... and back to the limited current off a GPIO pin

    I envision a fried Nextion and wondering why

so when i have the mcu running with the hmi can the mcu use the rtc on the hmi?

it seems less useful to me after what you have said, why dont they just integrate an arduino nano onboard the nextion and call it a day haha

i will start designing my gui with the nextion editor, and hopefully be able to dive in when i receive the kit

thanks for you help patrick, as you can see im a complete novice to hmi's and mcu's

Vagueness in specs for LDD LED Drivers and PC Fans

Vagueness in some of the logic specs

- can't give an exact with too many vagues

because Nextion HMI display have nothing to do with Arduinos ... 

you can use with, but also with 100000 other mcu's out ...

Nextion is quite capable, within its limitations

 - learning those limitations and working with them is a process.

There certainly can be more possibilities

 - perhaps with a few more components you didn't yet mention

 - but as mentioned so far - we work within what you have stated

ok i have found some specs for the pwm dimming of the driver.

PWM Dimming + remote on / off

power on + dimming : -vin > 2.5 -6vdv or open circuit

power off : -vin < 0.8vdc or short

pwm frequency : 100 - 1khz

quiescent input current in shutdown mode (max.) : 1ma at pwm dimming off and 24vdc input

im not sure about the fans they are just standard pc equipment, i was under the impression that 0v was lowest speed and 5v was max speed or brightness in the case of the led's?

so i will have an arduino nano and the nextion enhanced what more could i need?

i just need a clock and the ability to control a few pins between 0-5v at set times over a certain duration as dictated by the user input into the gui/hmi

i have been wondering if it is possible to connect multiple devices to a single pwm output for example both fans to one pwm output and all 4 led drivers to another pwm output?

Just to point out, some of your specs listed ...

and at 24V DC input - your Nextion is fried

1mA in shutdown mode states nothing about current when you turn it on

Many PC fans are rated around 250mA at 12V, and 5V wont turn them

 - so much depends on the specs of your PC fans, check specs

   perhaps your PC fan is okay, but indeed it is not necessarily by default.

PWM doesn't go between 0V and 5V, it is either 0V or 5V (if HIGH is 5V)

  - the duty cycle sets how long it is HIGH for.

One should never GUESS and make ASSUMPTIONS (magic smoke)

   but rather one should CALCULATE and MEASURE

Perhaps but a dozen STM32F030 Cortex-M0s and program these

  this way when you experiment you blow a $3 MCU and not your Nextion until you work it out

im pretty sure the 24v refers to the maximum voltage that can be input to the led driver through the dimming circuit, the mcu or nextion will be outputting voltage to the driver

circuit should look something like this :

Nextion is a TTL Serial HMI device.

  used by 65,000+ MCU types in 130+ programming languages

This is perhaps at best an Arduino question

 - but this is certainly not a Nextion question

We can wait to see if any others in the community have interest in this type of project and would like to join in with you.  I would recommend seeking the MCU side and electronic side of your project questions to forums that share your project ambitions to increase the likelihood of finding others with similar interest in a project like this.

Happy to help with Nextion related questions

yep the project seems to be going in that direction, when i started the thread i thought i could acheive my goals with just the nextion because i saw that it has rtc , and pwm onboard + its own processor

but, from what you have said it seems like the nextion maybe isnt powerful enough for the application i need and hasnt been explored very deeply on a standalone basis 

but i still need advice about using the nextion onboard real time clock with my arduino program

does anyone have experience on this front?   

Nextion is not an MCU replacement

  Nextion is a TTL Serial HMI device

This provides the ability to make graphical HMI interfaces

- within hours and not days, within a week not months,

- simple to use text based instruction set

When you come to this part of your project

 - the Nextion will prove its worth in your project

But not meant to replace the MCU part of the project.

Nextion has indeed been explored deeply on a stand alone basis.

 - I have posted much on such stand alone in Proof of Concepts

Such still remains beyond the scope of what is officially supported

and what Nextion's purpose as an HMI device is

RTC has been over covered in the forum and Nextion Instruction Set

Nextion's RTC is standard ~20ppm crystal with expected drifts of such

The community forum isn't for project development or handing out code

Electronic and programming are prerequisite

In the end, Nextion is a very capable device

but still remains in the user domain for a user to implement their project

Login or Signup to post a comment