Some participants of Junk Drawer Competition - Hackster.io will talk about highbrow topics like AI; I chose to build a project based on something I know very well, rejection.
Jack Ma, also known as Ma Yun, is a Chinese billionaire businessman and philanthropist. Do you think he knows what rejection feels like?
There are many other examples of Famous People like Walt Disney, Oprah Winfrey, and even Sir Isaac Newton who faced rejection early in their lives.
The National Center for Biotechnology Information of National Library of Medicine of National Institutes of Health of U.S. Department of Health & Human Services shared a publication linking rejection to suicidal ideation (SI).
Exposure therapy is a type of therapy that helps individuals gradually and safely confront feared objects, situations, thoughts, or memories to reduce distress and anxiety. People like Jia Jiang used that technique to overcome their fear of rejection.
If you still have doubts...
All the cool kids are doing it so it must be legit!
Statements made here have not been evaluated by the Food and Drug Administration. This product is not intended to diagnose, treat, cure, or prevent any disease.
I'm not a doctor, and I've never even played one on TV.
Game PlanWe will retrieve rejection reasons from No-as-a-Service (NaaS) using WeMos D1 Mini which will use Google Translate text-to-speech to convert the reason text to audio then play it on a speaker.
People tend to look for solutions to their problems in the medicine cabinet, so we will disguise the device in an appropriate container.
One advantage of using this jar is its translucency which will allow us to put the motion sensor inside without having to make an opening for it.
HardwareThe base of this project came from Skydive Auto Reminder - Doing More With Less - Hackster.io. We added PIR Motion Sensor to trigger playing audio. The only hole we made in the container is for USB power. Finally, we glued the speaker cover on top of the lid.
SoftwareSince WeMos D1 Mini will not be accessible for programing while inside the container, we implemented ArduinoOTA to make firmware updates over the air. We also used WiFiManager to avoid hardcoding network credentials and make the solution portable.
The star of this show is NaaS. Many good projects were built on that service such as:
Last but certainly not least, we used ESP8266Audio to clearly verbalize rejection.
The code starts by setting up pins then blinking the LED to show that internet connection has not been established yet. WeMos D1 Mini will try to connect to the last used Wi-Fi then display a portal if not successful to specify a new Wi-Fi for 30 seconds. Once we have internet connection, the LED blinking will stop. LED will stay on until we get a rejection reason. Once we have a reason and the motion sensor detects a movement the rejection reason will be played on the speaker.
Note that we have to make the first upload using USB (env:d1_mini). All other uploads can be done via USB or OTA (env:d1_mini_ota).
Keeping It RealWe used ChatGPT at several points during the making of this project. Sometimes, suggestions are useful like using " { } " around service call and before playing the audio. To this day, we don't understand its significance in the code.
Other times, suggestions were not as helpful. For example, we moved PIR from pin D7 (13) to D0 (16) because it is the only pin with an internal pull-down resistor. We even added an external 10K pull-down resistor which didn't resolve erroneous readings. For this project, leaving the pin floating worked best.
One of the reasons we chose this project is to pay off a technical debt. If you recall in Skydive Auto Reminder - Doing More With Less - Hackster.io we had to keep restarting WeMos D1 Mini after every call. With the current code this is no longer needed because audio has been handeled properly in the loop.
DemoThis is going to hurt you more than it's going hurt me.















Comments