DIY automated Moon phase light using ESP8266, LEDs

in #hive-1896412 years ago

DIY WEBSITE S SD SD.png

I have made an automated MOON Phase display using an esp8266 as the brain and using a few LEDs and reusing an old cardboard box.

Items used

  • NodeMCU(esp8266)
  • Bunch of LEDs
  • A couple of insulated wires
  • Tissue Paper
  • Glue

Steps

1.png

I started by cutting out a circle from an old cardboard box and putting some holes to hold the led that we will add later

2.png

Then I went on to divide the circle to make some crescent-shaped divisions and added led and used some tissue paper to spread the light within shapes.

3.png

Finally, I closed the whole face using another tissue paper and some glue, I used tissue because it kinda gives the texture of the moon's surface and it glow well when everything is lit.

Wiring

The is quite simple I use a couple of LEDs in parallel connection and connected the anode to the GPIO pins in esp8266 and cathode to a common GND pin. Here, I use micropython to write the code that manages the automation.

DFD.png

I have used these pins for connections, each anode to the D1,D2,D6 and D7. Then I used the G pins to common ground all the cathodes.

Code

As I've said before the code is written in python as my board run on micropython.

from machine import Pin
import time

# create a pin object 
pins=[5,4,12,13]

while True:
   for pin in pins:
      pin = Pin(pin, Pin.OUT)
      pin.value(1)
      time.sleep(1)
   for pin in pins:
      pin = Pin(pin, Pin.OUT)
      pin.value(0)
      time.sleep(1)

Nothing fancy here, Simple loop to trigger the GPIO pins which inturn lights various sections.

Result

PXL_20230224_154500743.gif

This is how it looks in a dark room, don't expect a lot of light from this but looks cool in my opinion, thank you for reading.

Sort:  

this looks cool

Thank you for sharing this post in the DIYHUB Community!

Your content got selected by our fellow curator ashikstd & you just received a little thank you upvote from us for your great work! Your post will be featured in one of our recurring compilations which are aiming to offer you a stage to widen your audience within the DIY scene of Hive. Stay creative & HIVE ON!


Please vote for our hive witness <3

Congratulations @arunbiju969! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 2500 upvotes.
Your next target is to reach 2750 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

The Hive Gamification Proposal
Support the HiveBuzz project. Vote for our proposal!