Typically, automatic lights and nightlights are turned on abruptly by a signal from a motion sensor, photo relay, or both devices simultaneously. The author of Instructables under the nickname Sake of Making came up with a different algorithm. The brightness of the night light glows smoothly depending on the distance to it. When the room is already so light, it remains off, despite the approach.
The wizard takes everything necessary for homemade Components. He gets a folding lampshade in the Ikea store, but you and I know that the same ones are sometimes found in Fix Price stores.
You can break spears for a long time on the theme "Fritzing vs the usual way of making diagrams." And you can use both. Here's what the wizard does:
The wizard collects the circuit. As always, a breadboard takes up a lot of space. It is better, of course, to use it for its intended purpose - when you need to debug the circuit. And then reassemble it by soldering. But the master does not share this opinion.
The master writes an additional short sketch and uploads it here.
Throughout electronics places in the lampshade from below, and only the range finder - above the lampshade from above. The Adafruit rangefinder LV-EZ0 has slightly better characteristics than the more common HC-SR04, but it is also ultrasonic. In the diagram, it is incorrectly designated as optical.
It turned out a nightlight, eliminating sudden changes in illumination, then it is shown in the off and on states.
And he vaguely resembles the pepelats of Etsilopp, not least due to the range finder above the lampshade, as well as the characteristic legs.