So, I’m not usually a fan of Solar, but in this particular situation I have no real choice!
I’ve got these super bright LED solar lights, and I want to customize them to work with a simple on/off switch, AKA an ESP32. The issue is they have 3 settings of brightness and also they work off motion.
What I want to do is to disable the motion sensor completely, and leave the solar charging working. But basically just be able to turn the light on and off. Ideally from an ESP GPIO but if all else fails, from a relay.
I’ve tried driving the LEDs directly off the battery but it’s no good, they are too dim. I’m guessing I need to go through the MOSFET to drive them at full brightness.
Could any smart cookie here tell me where I need to wire in order to achieve the above. Basically just like + through the MOSFET then I can maybe switch the negative with a GPIO?
I’m not great with electronics at this level so any help with this is much appreciated.
Thanks!
If I understand your intentions correctly I would cut the PCB trace between the MCU and the FET and instead connect the gate to a GPIO on the ESP that supports PWM MODE.
Cutting the trace will basically disable both the PIR and the physical switch leaving all control to the ESP.
Awesome thanks,
Can you indicate on the PCB photo where to cut if possible?
Here is your pictures where I’ve indicated the place to cut (and also where it is in the schematic)
Instead of cutting a trace - you could also consider removing the MCU and then use the solder-pads to connect wires to the ESP 32 and in that cases also consider connecting “dusk” and PIR signals to ADC’s on the ESP32.
There is a couple of things though.
-
The LDO XC6206P (labelled 662k on your schematic) is rated for 200 mA output current. This is properly borderline for the ESP32 - especially during TX - so pay attention to this and my advice would be to go as low on the outputpower as you can.
-
I do recommend that you determine whether your application and your battery capacity match and then also determine whether your solar panel can keep up…
Either way I do expect that you would need to experience with sleep modes for the ESP32
![452dcbf90b1d10a3829a29656aa164368cf30fa8_2_690x426](https://community-assets.home-assistant.io/original/4X/c/6/5/c65f88ac176c2cba5f5d6ccd924b374ef196c046.jpeg)
![2828eefc989308bab92ac3b1bda905e9c34f6bde_2_690x359](https://community-assets.home-assistant.io/original/4X/4/b/6/4b63cb51e8258f84e8cd4d11e7c771f9d720cde5.jpeg)
Thank you!
Yes, I think at this point I plan to power the ESP directly from the battery supply to 5v rather then using the 3v3 reg. I’m still doing some testing on this. I also plan to enter deep sleep on the ESP during the day, to maximize the effect of the Solar charging.
This light appears to last forever as far as the LEDs are concerned even when not in the sun.
The plan, enter deep sleep on sunrise, then exit deep sleep at 18:00 which is around sunset.
I cant really do anything else for deepsleep as I have no way to trigger it to wake up, such as GPIO.
So far, I can run a ESP01S (the esp 01 and relay module) for about 2 days off the battery. So i’m hoping that everything stacks up but the only real way to test is to do one and see how it goes I guess.
Thanks again!
Also, question regarding turning the light on a Full brightness. Do I need to send a specific PWM value?
How do you control the brightness?
Thanks
Take a look at this Monochromatic Light component.
Excellent, thanks ill see how I get on.
Cheers
Ok, sorry to be a pain but it turns out my pcb is slightly different, the MCB is mounted in a different orientation. Could you possibly tell me what pin it would be from this photo?
Also I just have a few questions.
-
Say I wanted to utilize the PIR on a GPIO input on the ESP as well (because why not) how can I connect the pir to the ESP?
-
I’ve powered the leds directly from the battery and they are full brightness, however they get super hot, even the wire gets super hot. Does this mean, as mentioned before that I need a current limiting resistor? Is it better just to try use the circuitry or can I just drive the leds directly from the esp32 gpio?
Thanks for your help I’m so close now.
You sir are a bloody legend.
Now, the only thing remaining is to get Deep Sleep working and try to get a output from the PIR to the ESP32 as an input.
I will test this so far and see what the run times are like.
Are you any good with deep sleep? I’m trying this but my ESP32 wont wake up at 23:00, i’ve changed sunrise to sunset for testing purposes, the idea is that the ESP32 sleeps during the day and wakes at night.
esphome:
name: rf-transmitter
friendly_name: rf-transmitter
on_boot:
priority: 200
then:
- logger.log: Waiting for API connection...
- wait_until:
condition:
api.connected:
timeout: 10s
- logger.log: Waiting for time...
- wait_until:
condition:
time.has_time:
timeout: 10s
- if:
condition:
- sun.is_below_horizon:
then:
- deep_sleep.enter:
id: deep_sleep_1
until: "23:00:00"
time_id: ha_time
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
time:
- platform: homeassistant
id: ha_time
sun:
# your location
latitude: -36.848461
longitude: 174.763336
on_sunset:
then:
- deep_sleep.enter:
id: deep_sleep_1
until: "23:00:00"
time_id: ha_time
deep_sleep:
id: deep_sleep_1
Thanks so much for your help man!
My own kind of sleep
. Not ESP32 though. Sorry.
No worries.
Is there anything I can do to try to reduce the power consumption of the esp32?