How often you get angry? or affected by other emotion?
This project was inspired by movie "Inside Out", we like to have a happy life but shit happens, life is unpredictable and full of ups and downs that we cannot control. But certainly we can control how we deal with these negative feeling and at least make ourselves angry-free.
Wiki page suggests a treatment called "anger diary writing", by writing down the negative feeling allow us to understand and re-evaluate the situation, take time to calm and to learn how to deal with it. The page said this treatment is useful for children but I think it is also good for adult except we are too busy but situation doesn't allow us to write. So I build this project backed by AWS platform so we can easily track our angry, get relief and get back to work calmly. We can also review the number of anger on AWS platform at a later time and get professional advise when necessary.
Raspberry Pi was used in this project which connect to Amazon platform using NodeJS aws-iot-device-sdk, once the button was pressed, it will publish to AWS IOT. Lambda is called based on the rule and store the time info in DynamoDB, if the number of press reach threshold, Lambda will publish request to Raspberry PI to play a song so user can aware it was enough for today and he should now listen to the music and stay clam. So this project involves AWS IoT, Lambda and DynamoDB service.
To Setup AWS IoT node and Raspberry PI (NodeJS), I followed the doc at http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-node.html.
DynamoDB setup is easy, just create a empty table to store the data with default setting. Remember to "enable" the table once created, otherwise it won't work and you may want to press the angry button now. :D
Create a new Lambda function, and give permission.
(The code is available at software section, modify the IoT endpoint path so Lambda can push the "play" request to Raspberry Pi.)
Now, back to AWS IoT to create a rule so Lambda function is called whenever the button was pressed, it should be like this:
Now, wire and create your own Anger button with Raspberry Pi. Install additional required NodeJS libraries (sudo npm install sleep onoff node-aplay
) and run my NodeJS code.
If nothing goes wrong, you can press the button anytime when you feel angry to track it, and we can login to AWS DynamoDB to review the number of press and timestamp when it was pressed, for example, we can filter the result based on date:
(as future improvement, we can build also user interface with AWS S3 to easily present the data or sending daily summary of press using AWS SNS service)
I hope this can help you to know your best friend, Anger.
Stay calm and be happy!
Comments