I made a cauldron controller in 2020 (here). Originally, the controller was meant to do two things — read multiple ingredients (RFID tags) and use stirring motion (KY-040) as an input. The multi-RFID reader board wasn’t that reliable at the time. Depends on how the RFID tags was stacked, not all tags were read properly. However, stirring both clock and counter-clock wise was working and felt very satisfying. I have wanted to build an example of a simple ID system, I decided to come back to the cauldron and try a different approach to id the ingredients.
The old cauldron was made of KY-040 and Adafruit Feather. I decided to build the ID input module and cauldron with M5Stack this time because a stack of Limit Switch units (SKU: U145) is perfect for creating a simple ID system. I made the ID input module in the form of an alchemy cabinet. The player can insert the ingredient data card from the top of the cabinet and press down to send in ID. Switch-based ID system is a simple but effective method used in many interactive toys. Every switch has an on and off state. I used 5 switches to create 2 to the power of five -1 IDs for this play experience. -1 is because 00000 won’t work in my setup. I am only using 5 ingredient data cards at the moment.
M5Stack Fire Document:
https://github.com/m5stack/m5-docs/blob/master/docs/en/core/fire.md
Working with the M5Stack unit – Limit Switches:
I wanted to create an ID system using 5 limit switch units. However, I found out only 4 of the 6 ports on pHub unit can be used as digital inputs. The rest two are analog only. This is not a road blocker, it only makes reading switches a little more complicated.
https://shop.m5stack.com/products/limit-switch-unit
Working with KY-040:
I started out with the basic example code that can be easily found on the internet. There were little unwanted jumps on directions here and there, but it was acceptable. However, when I started to add more code to the sketch, the amount of jumps increased drastically. At first, I had suspected it might have something to do with debouncing. The amount of jumps remains the same after trying both software and hardware debouncing. I then found out the code I added to the sketch, especially in the loop(), slows down each loop cycle by about 6 ms compared to close to 0 ms with just the KY-040 example code. I eventually found a workaround using interrupts which in a nutshell is like threading for Arduino. It works perfectly without any jumps on directions when stirring the cauldron.
https://github.com/ownprox/Rotary_Encoder_KY-040_Fixed/
What goes into a witch’s cauldron?
Poison’d entrails, toad, fillet of a fenny snake, eye of newt, toe of frog, wool of bat, tongue of dog, adder’s fork, blind-worm’s sting, lizard’s leg, howlet’s wing, scale of dragon, tooth of wolf, maw and gulf of the ravin’d salt-sea shark, root of hemlock digg’d i’ the dark, liver of blaspheming Jew, gall of goat, and slips of yew, nose of Turk, and Tartar’s lips, finger of birth-strangled babe ditch-deliver’d by a drab.
Macbeth, Act IV, Scene I (William Shakespeare 1564 – 1616)
This poem is in the public domain.
The three witches, casting a spell
[First Witch]
Round about the cauldron go; In the poison’d entrails throw. Toad, that under cold stone Days and nights hast thirty one Swelter’d venom sleeping got, Boil thou first i’ the charmed pot.
[All]
Double, double toil and trouble; Fire burn and cauldron bubble.
[Second Witch]
Fillet of a fenny snake, In the cauldron boil and bake; Eye of newt, and toe of frog, Wool of bat, and tongue of dog, Adder’s fork, and blind-worm’s sting, Lizard’s leg, and howlet’s wing, For a charm of powerful trouble, Like a hell-broth boil and bubble.
[All]
Double, double toil and trouble; Fire burn and cauldron bubble.
[Third Witch]
Scale of dragon, tooth of wolf, Witches’ mummy, maw and gulf Of the ravin’d salt-sea shark, Root of hemlock digg’d i’ the dark, Liver of blaspheming Jew, Gall of goat, and slips of yew Sliver’d in the moon’s eclipse, Nose of Turk, and Tartar’s lips, Finger of birth-strangled babe Ditch-deliver’d by a drab, Make the gruel thick and slab: Add thereto a tiger’s chaudron, For the ingredients of our cauldron.
[All]
Double, double toil and trouble; Fire burn and cauldron bubble.
[Second Witch]
Cool it with a baboon’s blood.
Then the charm is firm and good.
Potion Effects:
https://www.reddit.com/r/DnDBehindTheScreen/comments/4btnkc/random_potions_table/
https://www.reddit.com/r/DnD/comments/2134j6/4e_crazy_and_fun_potion_ideas/
I thought I started with these 5: Hemlock root, toad, fillet of a fenny snake, eye of newt, and wool of bat.