Dungeons and Dragons Hit Point Tracker With E-Ink Display
by NeilM77 in Circuits > Arduino
3351 Views, 18 Favorites, 0 Comments
Dungeons and Dragons Hit Point Tracker With E-Ink Display
I wanted to create a hit point tracker that displays all of the players hit points in a normalized scale, so you can see exactly who needs healing the most and how poorly the whole party is doing. It connects via Bluetooth to an Android phone which displays all the buttons you need to control your party's status. It's powered by a replaceable 9V battery. The current state is saved to EEPROM so you can swap out the battery without losing everyone's current hit point values.
Supplies
Components needed
- Arduino Mega 2560
- HC-06 Bluetooth module
- 400x300, 4.2" E-Ink Display Module
- RobotUI app from the Google Play Store
- 3 resistors. Any value, but they all need to be the same value.
- 9V battery
- 9V battery connector
- Wires and solder
- (optional) Some kind of case.
- (optional) Power switch. You could just remove the battery, but a switch is more convenient.
- (optional) Cylewet 55 breadboard. If you hate soldering as much as me.
Tools
- Probably a soldering iron
- Wire cutter
- (optional) 3D printer for case
Construct Your Circuit
Some links for various components...
Arduino Mega 2560, https://www.amazon.com/SunFounder-ATmega2560-16AU...
HC-06 Bluetooth module, https://www.amazon.com/s?k=hc-06&i=electronics
400x300, 4.2" E-Ink Display Module, https://www.amazon.com/4-2inch-Module-Communicati...
RobotUI app from the Google Play Store, https://play.google.com/store/apps/details?id=com...
STL files... https://cults3d.com/en/3d-model/gadget/case-for-h...
Wire up the components as shown in the Fritzing wiring diagram. If, like me, you are terrible at soldering and prefer to use breadboards when you can, then you can get a small enough breadboard that will fit inside a case. I used a Cylewet 55 breadboard (https://www.amazon.com/Cylewet-Solderless-Circuit-...)
You can skip using a switch for the power if you want to wire the battery straight to the Vin on the Arduino, but you'll have to add/remove the battery to switch it on/off. You only need to switch it on at the start of a game session, so this is viable.
You don't need the battery connected if you are powering the Arduino Mega using the USB cable for programming, so it's best to remove it for the next step.
Upload Code to Arduino
Create a directory called "HPTrackerEInk" and place the attached HPTrackerEInk.ino file into it.
If you compile it you will likely get errors until you have installed the epd4in2.h library from Waveshare that comes with you e-Ink display. I downloaded it from here https://www.waveshare.com/4.2inch-e-paper-module.h.... If you get problems with that library, then add a comment below and I can give you a copy of the specific ones I have (I fixed some errors, I contacted Waveshare and they promptly fixed the issues)
You will also need to install the libraries that communicate with the RobotUI app. The documents for "RobotUI setup guide" is a zipped up HTML page and can be downloaded from Google Drive. Open index.html in your favourite browser to view the documentation.
At this point you should be able to compile HPTrackerEInk.ino with no errors, you can upload your code and test everything works.
You'll need to change the list of names so it contains the names of all your friends characters. Within HPTrackerEInk.ino you'll notice a variable called nameOptions with a list of 20 names. You can change this list to contain whatever names you want, but note, only the first 5 characters are displayed below the hit point graphic on the e-Ink display. However many names you place in the nameOptions array, you will need to change NUM_ID_OPTIONS to reflect that number. So if you only have 10 names, change NUM_ID_OPTIONS from 20 to 10.
If you are lucky enough to be involved with more than one campaign, I've provided a way to switch campaigns. The UI has a drop down menu to select which campaign you are currently playing. So you can set up and track different party's. You can change the names of the three available campaigns by changing the contents of the option0, option1 and option2 variables.
Once you have compiled and uploaded to your Arduino Mega. Start up the RobotUI app and connect to your device! That's it! You can start playing Dungeons and Dragons and track your party's hit points!
COMMUNICATE: This is probably the hardest step for those of you who haven't been programming Arduino's for long, so don't be afraid to ask questions in the comments. I likely glossed over something that needs a more detailed explanation for some people, so please let me know. That goes for the other steps too.
Cram It Into a Case (optional)
You can download the STL files from here https://cults3d.com/en/3d-model/gadget/case-for-hi...
I created a case that doesn't use screws as I never have the right sized screws for other people's STL creations. It also avoids the whole imperial vs metric problem. So instead the case clips into place and you need to two pieces of wire (which I assumed everyone has) or cable ties that slips through two holes just inside the battery compartment. The hole threads through the three case segments. Twist the wire or lock the cable ties so the case stays in place. If you need to re-open the case then untwist the wire or cut the cable ties!
Enjoy!