Night Sky




Introduction: Night Sky

Ever wanted to have a starry night sky to fall asleep to with the moon shinning ? Here is how I made it.

This project was done for my daughter, and she helped along the way.

Here is the break down of the main steps:

  1. Print 3D Parts
  2. Build the Starry Ceiling
  3. Electronic
  4. Software
  5. Paint the ceiling
  6. Mounting the night-sky to the ceiling

Let's see what you will need.


Links are not affiliated, they are provided as informational only.

For the physical night sky

The sizes/amount will depend on what you do, here it is based on a 4x4ft night sky.


    Software & Tools

    • your favorite MCU IDE
    • 3D printer
    • Saw
    • Drill

    Step 1: Print 3D Parts

    For this project I took the great 3D moon from : moononournation I used the 7inch version and split it in half to keep the visible face. Then I created a mounting and a shadow cast system for it.

    I also created an optional box to mount it the EPS32 in with cable management. But you can create your own with wood or other material.

    You will find all the files here:


    Moon: setting infill to 100% in white filament. No support needed.

    The rest can be printed in any color you like. No need for high precision. No support required except for the servo arm.

    For the moon you will see in my pictures I used a version with smaller magnets, I realized that it was not strong enough, so I changed it to accept 5mm magnets instead.


    1. Screw the servo arm (there are 2 sizes, the thin should be fine). Make sure the screws are inserted from the side of the servo if you want to be able to unscrew it later.(image 1)
      CAUTION: make sure the servo is at position 0 and once place in the base the half sphere is not behind the leds. Also pay attention that the servo axle is off to one side, so you'll have to make sure it's in the correct position when you place it in later on.
    2. Place the light paddle on the half sphere and slide in the bracket. Make sure you put glue only on the bracket and sphere. None should go on the light paddle so it can turn freely. (image 2)
    3. slide in the light paddle in the base, do NOT glue anything at this stage (image3)
    4. insert the servo in place in the base (again the servo axle is off on one side), making sure the half-sphere will fit in the servo arm screw in the servo motor and add glue between the servo arm and sphere.
    5. now you can glue the light paddle where it meets with the base. Careful to not place glue at the bracket level.
    6. finally glue in 5x2mm round magnets on the base and moon-support. Pay attention to magnet polarity ! I find it easier to mark magnet polarity side first prior to gluing.

    For the moon itself, wait until further down the project before gluing it to the moon-support. It will give you the chance to give it proper orientation.

    For the box, we will get to it at the end after the electronic part.

    Step 2: Build the Starry Ceiling

    Building the frame

    I dont have pictures of the ceiling frame building but it a simple box of 2x4 inch held by square angle brackets and the plywood is applied to it and held with drywall screws.

    Getting the stars you want

    You can just go ahead and do some random holes... but I wanted something special for my daughter... it's actually the exact stars the night of her birth day for our location.

    Alas there was no moon that night, so later down the project we chose a spot she liked and didn't hide too many stars. So how did we do that ?

    Get the stars

    On the following site you can get a stars at a given date and time and export it to SVG. Its UI is not great, but it gets the job done and that's important.

    Select these options:

    1. make sure you are in the wheel view.
    2. in the location select the location you want (top right).
    3. click on show side bar to reveal date options (top right but left of the location box)
    4. select the date and time you want.
    5. in the Limiting magnitude select Medium for now.
    6. in the bottom section
    7. display, check: stars, planets deep sky
    8. constellations,uncheck: Stick figures and boundaries
    9. show, check: Galactic plane, this is optional more on that later (at the painting stage).
    10. then click on export SVG, we will save this SVG as intermediate-sky-view.svg
    11. now change the Limiting magnitude to Bright for now
    12. then click on export SVG, we will save this SVG as bright-sky-view.svg

    Prepare the stars

    Don't jump to the printer just yet. We will do some changes first. We want to get the bright stars in one color and the medium ones in another color. This will help us define which are brighter for our ceiling, we will use this later in the project.

    1. Open intermediate-sky-view.svg in inkscape or your prefered vectorial editor
    2. do not resize anything for now.
    3. ungroup the vector until you are able to get to the stars/planets only.
    4. when you do pick a color, for instance cyan. do it for both fill and border.
    5. then group back everything together.
    6. import bright-sky-view.svg into inkscape project.
    7. ungroup this one until you are able to select the background and remove it.
    8. then you can group it back up.
    9. Now you will superpose the two vector until the bright one is perfectly on top of the medium one.
    10. once done, group everything together
    11. change the page to the size of your ceiling, in my case it was 6ftx6ft. Bear in mind that the frame has about 2 inches thick of wood, so no starts can fit there.
    12. resize proportionally the vector to fit in the page (ceiling size) as you want it to be.
    13. In my case I wanted the North of the sky to really point to the North of her room.
    14. Now export to PDF (inkscape is not great at printing on multiple pages a large vector)

    In Adobe PDF you will be able to print on multiple pages and refine the settings that best meet your printer needs.

    Drill holes

    1. Print and assemble the sky chart
    2. Place it on the drywall using the painter's tape.
    3. If your sky does not have a moon position, select the place where you want to place the moon. Use the base to draw a circle where you want it. Then cut the drywall out.
    4. among the bright stars you will see different diameters. I gave them a scale from 4-2 corresponding to the number of fiber optic I will want per hole.
    5. Start drilling all the #4 stars.
    6. Then go to the back and mark all these with a square. I found later that shape are easier to spot then numbers ;)
    7. Then do #3 stars, mark them in the back with a triangle
    8. Then do #2 stars and mark them with a cross in the back.
    9. Then finally do all the medium stars. I did not mark them in the back since, the holes where obvious enough.

    Pass fiber optics

    1. Lay the ceiling so the back is facing up. you will need to keep the front with spare space so the fiber optic can protrude. I placed it on 4 chairs since the border has no stars.
    2. first spot a place with as less stars as possible, you will need place to join al the fiber optics together and place LEDs within a box that will contain the light.
    3. once located start with the furthest stars.
    4. you will place as many fiber optics per hole as per the star brightness. A good tip is to do a dry test before placing glue.
    5. place some hot glue above the hole, let it cool little to avoid melting the fiber
    6. then pass the fiber optic

    Install the moon base

    1. the 3d printed moon base assembled should now fit nicely in the hole you made for it.
    2. Oriente it according to how you want the shadow to act.
    3. Once in place use hot-glue to fix it. You can also add some drywall mud to hide the gaps, you want to avoid any light to shine through unwanted holes.
    4. Place the moon-support in place and place the moon half-sphere and turn it until it gets to the desired orientation. You will see the moon has a crater with lines stretching from it and some plains (see image).
    5. Once happy, remove the moon with he support together (make sure the support did not move, using tape can help) and super-glue them together.
    6. Now you should be able to easily place and remove the moon from the base as needed.

    Step 3: Electronic

    The button (& 220Ω resistor) is optional. In my case I don't let my daughter sleep with her phone, so the button lets her manually turn on and off the main features without it if she needs to.

    General assembly and Wiring

    There are two main parts:

    • what goes in the night-sky ceiling: Illustrated by the two top breadboards in the schema
    • what goes in a box next to the bed: illustrated by the big breadboard in the schema
    • then a network cable to connect the two: 8 colored threads in 1 easy cable :)

    The night-sky ceiling parts

    I super glued the LEDs on two small boards, I did not use hot glue in case they become hot and fall off.

    • 2 leds go on one board for the stars
    • 4 go on another board for the moon.

    The resistors are placed in the back of the board.

    For the moon LEDs make sure to pass the wire through the paddle tube prior to soldering to the cable. Then you can hot glue the board with the LEDs on the paddle. I avoided gluing the LEDs directly on the paddle due to heat and PLA low heat resistance.

    Everything is connect to the network cable. I could have used only one thread for the power, but I wanted to keep some freedom to change light/servo power in the future, so I have each wired individually. Feel free to use only one.

    The other end of the network cable receives 8 female pins soldered to it.

    The box for the bed table

    I soldered everything on the prototype board but the ESP and button. I used females pins on the prototype board in order to easily remove the ESP32 if needed.

    Similarly I soldered all the outputs for the Night-sky ceiling to male pins to easily connect and disconnect the box from the network cable. By doing this make sure you identify which cable connects where to avoid any problems.

    The button is soldered to a cable to give enough room to open the box lid.

    For the power socket I was able to cut two holes of the prototype board to fit in it's large pins.

    If you have printed the box, you should be able to screw the prototype board to it and enclose everything properly with USB and power port in the right position.

    Step 4: Software

    This is done using arduino IDE, but can easily be done on other platform as well.


    If it's your first time using ESP32 follow this guideline to install the required things:

    Also you will need the File System Manager for ESP32. Installation guide can be found here:


    You will need to add the following libraries.

    From the library manager search and install the following libraries:

    For these libraries, at the time of writting, you will need to download them and manually add them

    For manual installation:

    1. Unzip both .zip folders into the Arduino IDE installation libraries folder
    2. Rename folder from ESPAsyncWebServer-master to ESPAsyncWebServer
    3. Rename folder from AsyncTCP-master to AsyncTCP

    4. If your IDE is running, restart it

    Setting up the code

    1. Download the code from :
    2. The installation is described in more details on the github page.
    3. Open the project in Arduino IDE
    4. Edit the ssid and password to match your wifi settings
    5. Edit tzlocale to match your timezone
    6. Change GPIOs as needed if you used different ones.

    Running the code

    1. Use the tool>ESP32 Sketch data upload to upload the needed data
    2. Compile and run the code
    3. If you haven't mapped the ESP32 to a static IP, then use the monitor to see the IP address
    4. Open the IP address in your browser

    Servo Warning

    I've had a lot of issues when the servo is powered directly from ESP32 when pluged in the computer.

    It is recommended you test the servo when it is powered via the 5v power supply and not the USB entry.

    The UI

    The UI was done quickly to work on chrome and Android chrome, so it may not be perfectly compatible yet. Will try to improve it later. ;)

    The main menu allows to turn on and off the moon and stars lights. The moon phase can be switch to manual mode if wanted.

    There is also a schedule mode:

    • manual: does nothing by itself ;)
    • active: for the working weeks
    • relax: for those vacations weeks :)

    In the setting you can set the default time the moon and stars will turn off.

    The active and relax tabs allows you to set up the wake and sleep times of each day of the week for the two modes.

    You can also turn off the wake or sleep trigger of a day by clicking on the sun or moon respectively.

    The Box Button

    A short press (500ms) on the button will cycle through the following modes:

    • stars: off, moon: off
    • stars: on, moon: off
    • stars: on, moon: on
    • stars: off, moon: on

    A long press(1s) on the button will cycle through the moon phase opened at these angles:

    • 0
    • 90
    • 180

    Step 5: Paint the Ceiling

    Before painting make sure all fiber optics are protruding, if they broke you can sometimes reheat the hot glue and push it a little more.

    Color is really up to you. You could paint it white to fit in with the exist room ceiling or black. We decided to go for a galaxy painting... This is where having the milky way line on the printed star chart helped us create it to be more 'accurate'.

    • we painted first black
    • kept the paint wet
    • and added some bright colors of blue, purple, magenta, cyan & a little bit of green
    • then blurred them into the black
    • then repeated that several times blurring less every time and focusing on some areas and leaving out more and more of the ceiling untouched.
    • once we had build up enough to our liking we used an old brush to sprinkle glow in the dark paint to make stars that will be visible when the LEDs are not on.

    Once paint is dry, then you can finally cut the protruding fiber optics flush.

    Step 6: Mounting the Night-sky to the Ceiling

    1. Mesure the inner width of the ceiling box.
    2. Cut 2 2x4 of this width
    3. Make notches on each side about 7mm high and 5cm deep. (see picture)
    4. Find the studs in your ceiling.
    5. Attach the 2x4 using long structure screws into the studs in the ceilling. Make sure the notches are facing the ceiling (see picture)
    6. Attach 4 corner brackets on the ceiling box where the 2x4 will be at.
    7. With 2 persons slide the ceiling box in place, make sure the corner brackets are well suported by the 2x4.
    8. For increased security screw a long screw on one side making sure it goes into the 2x4 that are attached to the ceiling.
    9. Add the baseboard around it.
    10. hide the cable properly (still need to do that).

    Step 7: Enjoy

    Plug it in and enjoy ! You're done !

    My daughter spent the entire afternoon with her curtain closed and the night sky turned on :)

    First Time Author Contest

    Participated in the
    First Time Author Contest

    Be the First to Share


      • Eggs Challenge

        Eggs Challenge
      • First Time Author Contest

        First Time Author Contest
      • Meatless Challenge

        Meatless Challenge


      Rose Li
      Rose Li

      1 year ago

      A happy family, I can feel the feeling of sleeping under the night sky every day. If I change to me, I’m probably willing to stay in the room every day.


      1 year ago

      What a lucky daughter, to have a daddy that can make such things for her! I was hoping you would use Misou black for your black background, but this works just as well! She's going to be a stargazer just like her Daddy when she gets older!


      Reply 1 year ago

      She loves making things of her own, she already inherited a little from me :)


      1 year ago

      Now there goes a Dad, with a capital D!


      Reply 1 year ago

      I hope she sees me like this ;). Thanks


      1 year ago



      Reply 1 year ago



      Reply 1 year ago

      Thank you !