A Christmas Home
This is the creation of a Christmas home using Arduino Uno R3, sensors, NeoPixels, and buttons.
Supplies
Arduino Uno R3
Arduino Nano 33 lot
Neopixel Strip
LEDs
SD Reader & SD card
Speakers
Buttons x2 (Digital)
Photo-resistors x3 (Analog)
Piezo Sensor (Analog)
10k resistors x5
440-ohm resistors x2
Build the Circuit
In this photo, you can see two out of four parts of my build. One of them has to do with the piezo sensor which turns on an LED. The piezo's red wine connects to the microcontroller and the black wire connects to ground. If you were to put a resistor, you would place it connecting power and ground. I then coded it so that it would make the green LED (pin 3) turn on when pressed and turn off after a delay.
The button and the neopixel strip are simple. I connected my button to pin 2 (yellow wire) using a 10k resistor to connect it to ground and another wire to connect it to power. The neopixel strip is connected to pin 6 (yellow wire) and connected to ground and power (red and black wire).
(There is a potentiometer in this circuit, but I didn't use it in the end. It would be used to control the brightness of the neopixel strip).
Other Part of Circuit
Although it wasn't shown in the previous circuit, this part uses the three photo-resistors and another neopixel strip. Each photo-resistor is connected to an Analog pin: A1, A2, and A3 (Remember A0 is for the piezo sensor). The other leg of the photo-resistor is used to connect to power. A 10k resistor is used to connect to ground then back to the microcontroller. Although hard to see, the resistor is in the same lane as both the photo-resistor and the wire connecting it back to the microcontroller.
The Enclosure
For my enclosure, I used a 12" x 10'' box and two 8 1/2" x 4'' pieces of wood I bought at Michaels. You can pretty much make it look however you want, this is just how I made mine. With the box, I started off by painting it all white and laying some modeling clay on it. The clay would act as a stone path from the front to the entrance of the house. I left a little space between the slabs and the house for the piezo sensor that would be there later on (a mat). I then sawed the rectangular wood to make the pieces of my build. One rectangle was used to create a fence on both sides, while the other was used to create two rectangular pillars. By cutting into the sides of the box twice, I could place the fences on the farthest side. The inner cuts of the box would be for the neopixel I put inside the enclosure. I then drilled holes into the top of my board to mark the areas where my trees and pillars would be.
Button and Neopixel Strip Circuit Build
For the neopixel strip that would go around the box, I cut it into three pieces and resoldered them together with extra wire. This allowed me to bend them into the corners of my box. There would also be a 440-ohm resistor for the NeoPixel. For my button, I soldered a 10k resistor into the middle of a yellow wire, this will connect to ground. I then soldered a blue wire to the top of the resistor and soldered a red wire to the other leg of the button. The blue wire will connect to the pin and the red wire will connect to power. I then placed the button onto the pillar I made earlier and pulled the wires through the bottom into the box.
House Lights and Piezo Sensor Circuit Build
For this step, I started off by placing some LEDs on a breadboard and seeing which resistor I liked for the brightness. I used 8 LEDs to cover the front and edge of the house. With the first LED, I connected the power leg to a 10k resistor then connected it to an extra wire so I could later connect it to the microcontroller. I then soldered the other leg to a black wire for ground. I then did the same to the other LED's except I didn't use resistors for those LEDs. I then placed them in parallel series by soldering the LED's legs to legs. I also placed heat shrink around the connections to secure them and then put white wiring tape around the whole piece to act as snow. By bending it, I could place it around the house, pulling the wire through a hole in the bottom. With the piezo sensor, I soldered some extra wire onto it and connected it to its pin in the microcontroller and ground. The LED's connected to pin 3 and the piezo sensor is connected to pin A0.
Photo-resistors and Neopixel Strip Circuit Build
The neopixel part of this step was the most challenging. I had to cut 6 neopixel LEDs individually and re-solder wire connecting them (Also has a 440-ohm resistor). This would give them extra space between them so I could line them up with the trees that I would put above them. This also allows me to bend and glue them on the bottom with no problem. With the three photoresistors, I soldered them the same way I did the button. One leg I soldered with red wire and would connect to the microcontroller. The other leg I soldered to a yellow wire which had a 10k resistor in the middle, it also had a blue wire which was soldered to the top of the resistor closest to the photo-resistor. I then placed it over the tree, pushing the wires into it to conceal them, pulling the wires into the bottom. With the other trees, I covered the bottom with cloth and made sure it was lined up with the LED below. Each sensor would light up two trees. The NeoPixel is connected to pin 5 and the Photoresistors are connected to pin A1, A2, A3.
Music
Sadly, even though I could get the music to play for my project, I couldn't get it to play and still have the other pieces of the project to work on. So, I left the music out.
Here are the two Electronic Hub pages that helped me get it to work. I recommend making the name of the song small.
Here is also the code I had for my music and a demonstration of it working. I recommend clicking view raw to get a better view of the code.
Code
https://github.com/KihraMD/Christmas-Home/blob/main/README.md
When viewing the code, click view raw for a better view.
Demonstration
I also had a breadboard which I used to connect all of my interactions to power and ground, but everything else was connected directly to the Arduino Uno.