I want a circuit that:

This is somewhat easier for me since I have multiple YX8018 IC's (Solar energy Lawn lamp controller) lying around.

This is the schematic from the IC's datasheet:

image-20230924115138485

How does it work (also from the datasheet):

The internal high-precision comparator monitors the voltage difference between CE and GND pins. When the CE voltage is lower than 74% of GND voltage, the chip enters the shutdown state and turns off the LED. When the CE voltage is lower than 70% of GND voltage, the chip returns to normal operation and turns on the LED, so as to realize the optical control function. The LED is automatically turned off during the day and turned on at night. This function does not affect the function of CE charging the negative GND of the battery.

What the datasheet does not tell me is exactly what kind of inductor would be needed. This table is shown but it is just a reference:

image-20230924120701318

The one from the circuit I analysed earlier (where I got the YX8018 IC's from) appears to have an orange-orange-brown-silver color code which would mean 330 uH. This seems reasonable to me since the LED is supposed to last a long time and was also quite dim when turned on.

Final result:

I simply reused the circuit from the garden solar lamp but hooked up a 470 ohm resistor and a red LED instead. This worked fine, except for that the solar panel does not generate enough energy. I wanted to use it on the east side of the house to deter thieves, thinking it's a camera. It stayed on one night but did not charge enough the next day.