Time To Live
About the project
How long do you have? A magic book to tell you exactly that!
Project info
Items used in this project
Story
Overview
Below a quick overview of the content.
- Introduction and showcase video
- Book
- Electronics
- Code
- Result
Introduction & Showcase Video
Combining the magic of watching all the Harry Potter movies in a week and the networking term TTL (Time To Live), we're going to build our own black magic book, showing how long you have to live.
Project VideoBook
It starts with finding an old book to use. Make sure it's nice and thick so you have plenty of space for the electronics. A great place to look are thrift stores, they have loads of cheap old books. In this case I've found a medical book from the 80's. Perfect, as it has a lot of cool images to use for styling.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093009271469.png)
Now we have our book, we're going to glue most pages together to create a nice "block". I've used some bookbinder's glue because it dries nice and see through. I think you can also use different types, but I haven't tested it. Put some glue between the pages and press them firmly.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093011065859.png)
To speed things up you can also glue the sides together, a combo of this and full page gluing creates a solid block.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093012872565.png)
After drying, it's time to cut out our electronics compartment, a Dremel with the woodcutting wheel works perfectly. Make sure to wear some protection, it creates a lot of dust.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093014831626.png)
That's one nice compartment, just add some extra duct tape for strength. Full instructions for creating a secret book compartment, can be found here.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093016710691.png)
Next step is adding a "lid" to our compartment. Gluing some pages together gives us a basic lid. Adding a magnet means we can open and close our compartment.
Cut out a little indent and glue both the magnet (next to our compartment) and metal plate (bottom of lid) in place.
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093018485579.png)
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093020371096.png)
With our compartment and lid in place, our book is almost done. To give the visible page the right (creepy) look and feel you can do the following:
- Cutting and gluing images on the page (skulls and plants in this case)
- Burning the images/pages and submerging them in water
- Carving a sentence into the page and going over it with charcoal
- Anything else that comes to mind, you can go nuts...
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093021929707.png)
Electronics
Now we can move on to the electronics. We will need the following parts:
- Raspberry Pi (Arduino,...)
- A push button (any)
- Small LCD screen
- Powerbank or Powerplug
These are two great tutorials to wire up the button and screen.
With everything wired up, measure the button/screen and cut holes into the lid for a snug fit.
Code
Almost there!
The only thing left is the magic part. You can find the full code in the attachments.
For good measure, a quick overview of the logic:
- Listen if button is pushed
- If so, generate a time(amount of seconds) and display it
- Button is not pushed, check if the time is 0 If there's time left, lower it by one, and display what's leftNo time remaining, say Bye Bye
You can tweak the amount of time you give to the unfortunates in the following line of code:
number = random.randint(1,60)
You can also change the messages displayed in these lines:
lcdShowMessage("Time to live", lcdLine1)
lcdShowMessage("Bye Bye" , lcdLine2)
lcdShowMessage(str(number) , lcdLine2)
Result
And that's all!
Now we have a magic spell book, perfect for a very early Halloween!
![](https://www.electromaker.io/uploads/images/projects/837/story/medium/8Bits_andaByte_story_image_1555093022714942.png)
Code
Credits
![Photo of 8BitsAndAByte](/uploads/images/profile_pictures/8Bits_andaByte_profile_picture_1538649378.jpg)
8BitsAndAByte
We’re Dane & Nicole, two makers that create tremendously terrible tech, which we happily share with you on our channel! https://www.youtube.com/c/8bitsandabyte
Leave your feedback...