Hi, happy new year, I know its February but to me the new really starts later in the year not because I strictly follow the Chinese new year or anything but because my birthday is in late January, so I kinda feel the year begins for me when a new age begins. (Had to go deep for a bit lol).
But now that the year has begun for me, I promise to try and do a post fortnightly. Plus did you hear we are on Twitter @Justatadrandom, we have been on there for a while but in stealth mode, but this year we are going to try to say something more often from the day this post is released.
So housekeeping done and it’s the first post of the year, whoop whoop, so from the title you can guess, it has something to do with a party and bathrooms. As I mentioned my birthday was in late January and I had a little house party, more like a get together, games night kind of thing. And because I love planning parties and making my guest have the best time ever.
I decided to put my self in my guest shoes while planning and I thought what are the things that get to me at a party and these three things that came to mind
- Trying to hunt down a busy host for the Wi-Fi password.
- Queuing for the bathroom
- Finally, calling everyone to figure out if there is still food or drinks before i get there
So I decided to solve these issues for my guests. How you ask, by building my very own house party prototype app and by building my very own toilet sensor in less than 3 weeks.
So before I tell you more, if you have never programmed before, don’t panic yet. This blog is all about encouraging people to get their hands dirty with coding and tech so with that being said. This was a challenged for me as the language I used, I really hadn’t had a look at it, since I was 16 when I learnt the basics and not to give my age away that was quite sometime ago.
So back to my web app, it was built using a set of frameworks bundled up and called the MEAN stack. MEAN is an acronym for MongoDB, Express.js, AngularJS, and Node.js which I will talk more about in part two of this, so for now, take MEAN to mean, mean as in sick, as in easy to use coding tools for web apps.
So this is the screen that was displayed to my guest at the party using a projector.
I will talk more about it later this year and how I built it in part two of this post so watch out. But today I am going to talk about my distaste for queuing up for the bathrooms at house parties.
Like I hate it when I have to leave great conversations to keep checking if the bathroom is free. So i decided to fix this by you guest it. building a toilet sensor and projecting the status on my living room wall for all my guest to see and be informed.
The toilet sensor simply let my guest know if someone was in the toilet or not. It was very easy to built and it involved the following
- A raspberry pi, which in simple terms a little AFFORDABLE computer. I stress the affordable, because they cost about £30, don’t believe me check this amazon link here. They can do normal things most computers do and some extra awesome things. Don’t be put off by their bare appearance; I like to think they are just computers that don’t have clothes on like regular computers. If you want to know more about setting one up, use this link here
- Your second item you need is A PIR(Passive infrared) sensor and some female-to-female jumper to connect it to the Raspberry pi. I connected mine like this before I added power.
Note: I have a case for my pi but they usually come without except you buy a kit with one
I could go on and on how these two things work together and how they were connected but this tutorial here on the raspberry site does the job.
So once you are done with that tutorial, the only extra step I added was rather than printing a statement every time the PIR sensor sensed movement. I sent request to my server, letting it know the toilet was vacant or not and here is a snippet of that code.
Then I placed the sensor “kinda” discretely in my toilet
(What the kinda had quote marks, I was pressed for time but this year we will do better with our spy electronic tricks episodes coming soon)
And once I did that, The page, which was requesting the current toilet status, let my guest know when the toilet was vacant or not. if you are new to all this and that sounded so complicated hold on for my next post, all will be made clear lol.
I hope this has inspired you to go out there and learn to build something to solve an everyday problem you have. If you cant wait for our next post on this and you want to know more about the app and how you can set up something like that for a party of yours. Drop us a mail at firstname.lastname@example.org or leave us a comment and we will clean up our code and let you use it for free cause we just enjoy solving peoples problems.
And if you love to coding already and never used a MEAN stack this tutorial here is great.