I awake in the labyrinth, no memory of who I am. All I know is that I must find the key to the portal that will take me to the next part of this endless maze. Stalking its passages, I find a rusty sword and take it in hand. Further along, I find an old chest of armor. Now my enemies will never defeat me! I stalk endless corridors, searching for the key. As I turn a corner, I see one of my enemies coming towards me, axe in hand. We clash, weapons slashing! My enemy flees, but I let him go – I must continue my quest to find the key. No matter how long it takes me.
Peek through the portal into the world of Existential Crisis. In this unique and hand-crafted electronic dungeon crawl simulator, watch the valiant hero compete against his enemies to find weapons and other items to aid him in his ultimate quest: to find the key and open the portal before they do! Watch as he uses magic potions to heal himself or blast his foes. Sigh when he makes a wrong turn and misses the key. Groan when he is vanquished by his foes. And cheer when he unlocks the portal and completes his quest – only to find it start all over again!
Existential Crisis isn’t like other games, because I designed it so you can’t control the hero. We can peer through the window into his universe, but we can’t help as he struggles to find a way to survive long enough to complete his quest.
Simulation of role-playing adventure or Multi-User Dungeons (MUDs), similar to NetHack, using basic rules of Dungeons & Dragons with a feel similar to Gauntlet or Diablo.
The pictures and video do not fully capture the brilliant color when seeing it for yourself.
The project makes a visually interesting simulation of a character wandering through a maze, looking for a key and trying to find the door to exit, only to be stuck repeating this for all eternity. Other enemy players try to kill the main character, can pick-up and use items including the key to open the door, resetting the maze. When any character dies, within a matter of time, regenerated with randomly selected base stats; forever stuck looking for potions to stay alive a little longer only to find another key and another door.
This simulation covers the basic motivation of fighting to stay alive in an effort to find the key hidden in the current map and then locate the door to exit.
Each player has hit-points, armor class, experience points, and can hold up to three items. Each map contains a key, and a randomly selected number of rewards, or items to help the player. Items available are: a potion of healing, a better weapon, better armor, or a magic scroll.
A 64 RGB LEDs in an 8×8 display is used as the ‘viewer’ into the World of the simulation, displaying only a quadrant section of the overall map at one time. As the primary player moves around the map, the ‘viewer’ display moves to the relevant section.
RED – Opponent Player Characters ( Enemies )
GREEN – Main Player Character ( Game Focus )
BLUE – Wall
WHITE – Door
YELLOW – Key
Find a key
Find / Use armor
Find / Use weapon
Use a potion
Open door using key
I have also included numbers 1 – 20 for showing the result of a simulated die roll. However, showing the number each time the player rolls is annoying so this animation has been disabled.
How the Simulation Works
On each turn, a player object executes the function WhatAreMyOptions
Move ( Direction Available: North, East, South, West ) A proximity-check to opponents is made to determine options. Short-term Memory of locations explored. Coordinates of recent moves are stored in the player object in an effort to reduce looping.
Attack: Each player rolls a 20-sided die trying to meet or exceed the Armor Class value of the opponent. Upon a successful hit, the player then rolls a 4-sided die for damage and applies any bonuses. The total damage is subtracted from the opponent’s hit points.
Check Inventory and Use Item.
Potential for Expansion using I2C
Add additional microcontroller or Raspberry Pi for Neural Network.
Add better controls, such as push-buttons, and even sensors.
The first glaring problem with the typical indoor garden is that extension wires are annoying and a potential safety hazard. On the other hand, wireless communications can lack the reliability of the wired variant. Going further, should the system be available to the local network or should it be connected to the Internet?
Since plants do not need Internet access in order to grow then we are potentially creating an additional dependency that the plant doesn’t want. The Internet is useful for providing access to your system, but security is questionable, how much control or data should be available? A connection to the Internet can become another dependency if the system cannot operate without communication to a cloud-based or otherwise remote server. If something can fail; we should plan for the eventual occurrence of that possibility as best as possible. If a long electrical outage were to occur it would be prudent to have a backup generator, or solar rechargeable battery storage system. If we can have better reliability with a wired connection, then it makes sense to use a combination of wired and wireless.
Next: Getting Wired and Wireless
Communication options such as i2c, which is great for communicating with another microcontroller or Raspberry Pi and the many wireless options: WiFi, bluetooth, etc.
The greatest advantage to using the Arduino family of microcontrollers for DIY electronics projects, is that they are ubiquitous. Since they are so available, they are inexpensive and you can find open-source software to get started.
If you’ve ever had the opportunity to work with an Arduino Uno microcontroller board, then you’ve probably executed the flashing LED example. Going further, you might attach a button, or switch, to trigger the LED or to turn it off making the project interactive. There are many sensors that could be connected to the Arduino Uno and setup to trigger events, such as the LED flashing, using threshold values that we would need to experiment with in order to figure out what settings work best for creating the effect we want.
While the examples that come with the Arduino software and the examples included with libraries are an excellent start to a project; the Arduino family of microcontrollers is often grossly underutilized in many projects. Sure microcontrollers are limited in how many instructions they can run; hitting the program size limit doesn’t take very long when you want to control more than a few blinking LEDs. Even with creative variable handling and custom libraries, eventually, there is a need for another microcontroller or to move to a larger one, even a Raspberry Pi.
At its most basic, a microcontroller loops through a set of instructions handling each action with the focus of The Red Eye of Sauron from Lord of the Rings. There are a few interrupts that can be configured should an event be so important to receive the full attention of the microcontroller. Using some form of time management creates a state machine. If x amount of time has passed since x event, then do something and so on…
“The behavior of state machines can be observed in many devices in modern society that perform a predetermined sequence of actions depending on a sequence of events with which they are presented. Simple examples are vending machines, which dispense products when the proper combination of coins is deposited, elevators, whose sequence of stops is determined by the floors requested by riders, traffic lights, which change sequence when cars are waiting, and combination locks, which require the input of combination numbers in the proper order.” https://en.wikipedia.org/wiki/Finite-state_machine
There are rare instances where: RTOS, AI, neural networks exist on microcontrollers, but that’s best left to software-oriented systems such as a Raspberry Pi.
After trying many different timer and time management libraries I felt they were either too much or not enough of what I was wanting in my timers. A set of timers that are easy to set, keep track of their own state, and each have their own trigger flags.
Interacting with an electronics device such as a microcontroller or computer system is relatively easy and typically provided as an example for developers looking to use the device in their project. Press a button and an LED illuminates. A button or switch may seem like a simple sensor input, but it’s not.
The device’s system resources are consumed waiting and watching for a button press. When we use a button in a project we typically think of it being activated when pressed. Then what? What should happen if the user holds the button in the active position? Will the button be counted as pressed once, or is the program going to count each second, or x amount of time, as another button press? Does the program need to know that the button has been released?
Hardware and wiring
Rather than using the Arduino Uno and a protoboard or breadboard for this project, I’m using the Arduino Nano on an expansion board. Keep it simple using common wiring colors, keep it modular so connections can be made with ease, keep your project sustainable; a part can be replaced rather than the entire system. The DuPont wire connectors that come with prototyping starter kits makes it easy to create your own custom wiring connections. The wires are easy to solder when a more permanent connection is needed. I make custom wiring harnesses for neater, cleaner, and more easily connectable modules.
The latest version of the Raspberry Pi v3 uses a Linux OS and is a computer that can do so much more than an Arduino Uno, why not just use it for everything? While it is possible to do many of the same tasks as you would do with the Arduino Uno or variant, it’s not always best. The Arduino Uno and variant microcontrollers are best for doing the same actions, over and over again, such as reading a sensor and doing something with the value.
As I mentioned previously, you can do a lot with a Raspberry Pi, and depending on how much you are doing, it won’t take too long before you discover it has limits. When the Pi overheats, it will either freeze or shutdown, hopefully, the processor has a heatsink.
You value the project because you are able to customize and experience the process of its creation, both physically and mentally.
Integrity and dependency on specific vendor: Complete packages are limited in capability and scalability, also they often include unwanted strings attached, i.e. Advertisements; company owns your data for purposes of profiting by selling for marketing purposes. Mass produced products are typically not designed for longevity. Can the equipment be repaired or is it disposable?
People have complex preferences and want more customizable, possibly less expensive solutions, typically with the trade-off related to labor, can be improved or perform to preferred standards
Interest in learning and/or educating others: You enjoy or have an interest in the activities associated with the process of a subject.
Necessity: Resources and costs vary by region.
Many items can be purchased locally or sourced from the Worldwide market through the Internet. I don’t know about you, but I rarely have money to spend on projects and whenever possible reusing and re-purposing junk is ideal. Many of my projects contain parts I’ve purchased at local dollar stores and items found through eBay online vendors. Online researching, reviewing, and sourcing materials
It takes time to learn how to use tools and equipment successfully, let alone, have the time to actually make the project meet your expectations. Will you take the time to safely use the equipment necessary to complete the project? Are you able and willing to troubleshoot problems as they arise?
Time used for the project is time that could be spent with family, friends, learning something more important, etc.
Skill and Ability
Even though it may pain me to swallow my pride, I try not reinvent the wheel. If I don’t have direct experience performing a task, I take the time to research how others have approached similar problems. It is best to learn from others before making a serious mistake simply because I don’t want to appear stupid. Practice makes permanent. We cannot expect to become experts on a subject overnight, it’s okay not to know how to do something, try to find someone who can help, take small simple steps towards achieving the goal.
Resources for DIY Hacking Electronics:
For electronics projects, reliably wiring the hardware and designing the software to operate using an Arduino variant or Raspberry Pi, is a challenge. Hacking Electronics – Simon Monk ( link to Amazon ). Regardless of your experience level, this book is an excellent resource, what tools are needed, when and how to solder, and many basic fundamentals of working with modern electronics. The second edition, includes Raspberry Pi.
Phoenix Fire Lily: Solar rechargeable battery connected to a flickering LED inside an artificial lily flower residing in a hand-crafted wooden vase.
I don’t know about you, but I rarely have money to spend on projects and whenever possible reusing and re-purposing junk is ideal. Many of my projects contain parts I’ve purchased at local dollar stores and items found through eBay.
Artificial Lily Flower
Solar-panel ~ 5vDC
Rechargeable Li-ion Coin-cell Battery
Rechargeable Li-ion Coin-cell Battery charger = TP4056 Mini USB 1A Lithium Battery Charger Module
USB to mini USB ~ 5ft. cord
Optional ~ hand-crafted vase station
Cut the end of the stem and remove the wire.
Gut the Artificial Lily Flower by removing its pistil.
Using a 8-10″ length of Thermostat Wire that extends just beyond the end of the lily’s stem, solder a 100-330ohm resistor to flickering LED and/or later near the mini switch inside the recycled case.
Do I really need a resistor?
Clear LED without resistor = 30mA @ 3vDC
Flickering Yellow LED ~ 6mA @ 3vDC
salvaged 10 LED string of lights = 6mA @ 3vDC
Carefully thread the wired LED through the lily and down her stem.
Add a piece of heat-shrink tubing, solder jumper wires, and attach connector header.
Solder a set of short jumper wires to the Rechargeable Li-ion Coin-cell Battery charger output.
Solder the Rechargeable Li-ion Coin-cell Battery charger output short jumper wires, resistor, to the mini switch and recycled case ( two “AA” batteries ).
Solder the coin-cell battery holder to the Rechargeable Li-ion Coin-cell Battery charger
Insert the Rechargeable Li-ion Coin-cell Battery into the Rechargeable Li-ion Coin-cell Battery charger.
A look inside the inexpensive battery case.
Gut everything from the case!
Drill a few holes. One for the solar panel wires, and the other for USB connector.
Solder a simple switching diode, such as 1N4148, to the positive side.
Using short jumper wires, solder the Rechargeable Li-ion Coin-cell Battery charger input to the solar panel ~ 5vDC.
Insert the switch and wrap wires so they lay flat inside the case.
Test the output.
Optionally, attach USB to mini USB cord to the charger
Store inside a hand-crafted vase station.
You can purchase a completed Phoenix Fire Lily directly from me as a functioning example.