I need help with the coding of the pwm to mosfet board. I have a 10vdc power supply i am going to push through the mosfet board. I want to know how to code my sensor so it gives me a slider (light) and use that to adjust the voltage being allowed through the mosfet board. For example, if I want to push 10vdc, I want the slider to be at 100%, if I want to push 5vdc, the slider should be at 50% and if I want 0vdc, then the slider should be at 0. I assume I need to have a formula that accepts the input from the slider and then sends the proper value to the mosfet board to give me the output I am wanting. All my equipment will be in hand in the next few days.
Do you want this slider in HA or on some screen attached to the esp?
Also, what esp do you have, 32 or 8266?
Hello. I want a slider in HA and I have both the esp32 and a bunch of esp8266’s. Which ever would be a better device in this situation.
I have the pwm working through a esp8266. It is integrated into HA and i get the dimmer value and dimming works as far as voltage change on the mosfet board.
I want to add a slider to the Picture element card so I can add the slider to the GUI dashboard I have build.
You could ether work with the monochromatic light component in esphome so you can use a slider directly in ha to control the dimming or go with another way like maybe making use of the template number because that one can work as a slider in ha too
I am using the monochromatic light component. I am unable to figure out how to use the slider for that and apply that slider to the Picture Elements card. Do you know how to do that?
I also have made another post today about the actual voltage issues I am having. When the slider is at 1%, i get 0.008vdc. Thats great. When the slider goes to 3%, it jumps up to 4.xxvdc. This should be giving me 0.03vdc since I am using a 10vdc power supply. Any thoughts?
No idea, might need to use another card?
Well, that is science for itself. The visible light output you actually see with your very own eyes does typically not correspondent with constant increasing voltage you apply. Esphome has a gamma_correct
option for this on the light components which default is 2.8
. For that reason you don’t see a linear increase regarding voltage on your mosfet but you should rather see a linear light output instead (that actually is what most people want for a light)
Read more about that topic here Gamma correction - Wikipedia
Another thing is that most lights (and fans btw.) will not turn on when the output is only applying like 2% of the available voltage for example. To accommodate this you typically define a min_power
in your output component. Also you have the option to set zero_means_zero
at this point so the min_power
value set will than be actually be 0
.
Thank you for you response. So am i expecting to much for the slider to be at 50% and the mosfet board allow 50% power through it etc.?
This is for a LED Grow light. I would expect the plants to see the light properly even if we can not.
I guess that might be the fact if you use the output component but without light (which does the gamma correcting to have a mostly linear output of light instead of power ). You can also try to set the gamma correction to zero together with the light.
Now you add even more complexity without yet made the basics clear. All plants react differently to light exposure and indeed they can make use of more of the available light spectrum (some which is not visible for the human
).
Depends on the power of your full spectrum light, the area you use it and the distance to the plants it can be that even at full power it is the limiting factor in plant growth (depending of the plants and if we assume they have enough nutrients and water).
Another technical aspect can be that the efficiency can have it’s maximum when the lights run at full power if it has a psu integrated. On the other hand underpowering led lights typically prolongs their lifetime because they will run cooler