Closed brusshamilton closed 1 year ago
Hi. Thanks for taking the time to comment.
Given that the relay and the current montor are rated for 10 amps at 120 volts, that is 1200 watts of capacity. 2 watts in that scope is negligable. Also since my objective with this project was to have an ESP32 powered wifi based decor style light switch, I had to account for the highest power that the ESP32 and the rest of the circuit would need when selecting the power supply. My electronics class teacher always said that you should always supply double the curcuits power requierments. With that in mind I did not do as my teacher suggested in this case as the power supply does not provide 2*250ma plus the 90 ma the relay requires plus the other parts.
I feel that I made a decent compromise on power supply versus power needs. Regardless of that there is always room for improvement but I am not willing to give up the ESP32 and the relay and just those two compoents use around 200ma or 2 watts at full power draw.
I could think about powering down the current sensor however the typical current draw is 8.5ma. This is less than the LED so I dont feel that it is worth considering.
Cheers.
That's interesting. I thought this was for a light switch so I did not consider that it might be asked to draw a full 10 amp load. Also, I guess my only experience with the Hall effect sensors is with small battery powered devices which have tighter power margins, so it doesn't seem to be a problem here. The relay is also only drawing the current when the switch is on (which I wouldn't consider quiescent) and only takes 200mW (based on the datasheet I pulled up for HF33F).
But you can still reduce the power usage if you can get rid of the 5V power rail. I thought you might need it for the relay, but the relay seems to support voltages that low. With a linear power regulator you're paying for the power at the higher voltage even if you only need the lower voltage. That's fine if you are not pulling much current, but at 250mA, going from 5V to 3.3V wastes 425mW as heat, compared to the 825mW that's performing useful work. I didn't see anywhere where you needed 5V other than USB, which can provide it's own 5V power. It should be safe to let that float at 3.3V when the 5V is not connected (for debugging/programming).
Also most IoT and other embedded devices take significant advantage of sleeping during idle times to reduce power usage (and heat generation, which can fatigue and prematurely age components).
As for the power supply margin, I think doubling might be useful for students, but typically I wouldn't overspec by more than 30%. You have the appropriate decoupling capacitors in the right places, so I'm not that concerned with power noise. Though as with all high frequency circuits you would want to check and if it is a problem see if you can run the system at 3.5 with a linear regulator down to 3.3 V for extra stability.
The Neopixel and the relay both run on 5V. I had originally planned to use a 3.3v power supply and had looked at running the relay at 3.3v but once I decided to incorperate the Neopixel I went with the 5V and 3.3. LDO reg. I did a lot if bench testing the ESP32 and other 3.3v components and found that the ESP32 rarely drew more than around 80-100ma and when it did it was not for very long. With that said the current draw on the 3.3v reg averages around 100ma and the regulator never even get much more than warm. I would think the temp rise above ambiant is around the 5 degrees C range. someting I was very comfortable. If it was any more than that I would have redesign the power section.
I do see that what you mean about power saving modes for the ESP32 howver since I want the web page and the MQTT client active at all times I dont see how that could work in my use case.
Cheers.
It looks like the quiescent power usage is around 2W for this design. Given modern lightbulbs use ~9W, that seems like a lot to devote to a switch.
Fortunately, I think there are some things we can optimize with this design.
The processor should probably be put into a low power mode between requests. That may be a bit difficult with WIFI. I'd have to check the datasheet in detail to so how much we can save here.
The hall effect sensor is a real power hog though. Have you considered making it so it can be disabled and enabled? We don't need to measure that all the time, so we should disable it when it's not in use.
Using an linear regulator to step down from 5V to 3.3V almost doubles the quiescent power usage. If we could get rid of the 5V requirement then that would be ideal. Otherwise we might want to bite the bullet and get a buck converter -- the 240mA draw from the ESP32 is not cheap.