#WCU knocksensor customdoor LED electronics attiny2313
Explore tagged Tumblr posts
Video
tumblr
Hi all,
It has been a while since I have posted anything to my blog. I figured I would start adding things in preparation of trying to find a Summer internship. I will begin by posting a fairly old project, but I will be going into detail of how I accomplished such task.
The Start
One late night my friends were over and one was particularly intoxicated. To make matters more interesting, he was upset about a recent break-up with his girlfriend. This lead to a series of unfortunate events, one event in particular was the happening of him punching a hole through my cheap cardboard-like apartment door.
“I wish I had a picture of the damage, but he had a weak punch.”
The Beginning of the Custom Door
I started by first making sure my semi-conscious friend was OK and then I continued to hassle a free door out of him. The next week he arrived with a fresh door that fit in the doorway to replace the door which had previously been beaten by his fists.
I then thought to myself, “why waste a perfectly normal door with a minor amount of damage?”
So then came the brainstorming... I though of various ways to manipulate this door to my liking. I thought maybe I could try to turn it into a one-way mirror... No, too creepy. Maybe I could throw a TV on it.... No, that’s useless.
Then I thought, “wouldn’t it be cool to turn it into something that would react to someone’s knock?”
I eventually decided upon using my University’s logo onto it and then cutting out the lettering for the school and the mascot’s eye and placing 5mm LEDs behind it.
Designing Challenge
I then thought of how I would fit LEDs to the back of this door while not making a huge mess. Well to my suprise, the door is basically two sheets of veneer or cardboard separated by IKEA-like corrogated cardboard. The image below is exactly like the one I used below but is only for reference.

So i thought of a way to use the door to it’s potential. It includes using a cutout of one layer of cardboard, flipping it over and mounting everything to the flipped piece of cardboard.
Once I had cutout the back of the door, I had a large working canvas. I then drew the logo on the front of the door and painted over it with cheap paint. I wasn’t too careful as I am by no mean an artist. I then sprayed over the logo and door with a lacquer satin finish.
The circuit
The knock sensor is a simple piezoelectric transducer, wired in parallel with a 1 Mega-Ohm resistor, in parallel with a 5v Zener Diode. The output of this was fed into a microcontroller. I used a ATTiny2313 for this project although I could have easily gotten away with much less pins. I only used 4 pins in this project. 1 input and 3 outputs. Each output is connected to a NPN transistor which is tied to each RGB LED’s cathode. Each LED is wired in parallel on the back of the one piece of cardboard. I have included the project time-lapse of the wiring of the door.
youtube
The Dark Side
The back of this door is truly ugly and quite hideous. Oh well, hindsight is always 20-20. If I were to do this project again, I would definitely chose to implement LED strips to make my life easier. I would also use a custom PCB that would fit snug inside of the door.

The Coding
When I initally wrote the code in the Arduino IDE, the digitalWrite() function takes up too much memory. Especially when dealing with the ATTiny2313 which only has 2kB of memory. This made everything a challenge in terms of coding, unfortunately I don’t have the computer I programmed this with anymore.
I will give you a hint as to how this works though.
The code contains three variables for each color RGB. When the door has sensed a knock, it chooses at random a color to be set all the way high. It then decreases the intensity of each color as each couple milliseconds passes by. It continues to do this until each color is at it’s lowest setting of zero. This means the colors can overlap while someone is knocking-on the door. This makes for a brilliant color display when continuously knocking on the door, almost as if it were a firework display on the door.
Conclusion
I hope you liked my project as much as I did, feel free to contact me with any questions or concerns. I am not the best and I know that. I am just making my way towards becoming an electrical engineer and any help along the way is appreciated. Thanks for reading/watching!
Have a nice day!
0 notes