Back to Parent

Outcome


Problem Statement

Whenever you go out to drink with your friends, you tend to spend more than you want to. This device is designed to let you know discretely how much money you have spent the night before. When you wake up, you'll immediately know by glancing at the wine bottle.

Goal

The goal is to track how much money has been spent at the bar in the bottle. Every time you spend money in the bar using a credit card, an email will be sent. IFTTT then sends a signal to the Particle that changes the color of the green LED's in the bottle to red. More red light you see in the bottle, the more money you have spent. 

Process

Components used:

1 - Particle Photon and breadboard

14- RGB LEDs

6 - 1k ohm resistors

1 - Glass bottle

1 - Wooden slab with circular cutout

This was the process we used:

1.  The inspiration for this project came from the financial constraints we face when we eat and drink out often. As students, we live on a budget and it is not wise to spend too much when we go out. What better way to learn how much you spent on alcohol last night than from a bottle? To better visualize this concept, we started off with free hand sketches and then moved on to a digital prototype before actually building the device.

Img 5148.jpg.thumb

Concept image.thumb    

2.  We first worked on the hardware part of the device. 3 RGB LEDs were connected in series as a bundle, 5 of these were made.  Since we are tracking the alcohol consumption over a night, we chose to use an elegant olive green wine bottle to create an ambient light which was glance-able, but still clearly indicated it's purpose. A wooden piece was machined and surface-finished to enable the bottle to stand at an angle.

3.  The code is designed to track the invoices sent from the bar or restaurant in the form of an email credit card statement, in real time. In the beginning, all the LEDs are green, indicating that you haven't yet started drinking. Each invoice triggers one bundle of LEDs to turn from green to red. When all the LEDs are red, it indicates that no more alcohol must be consumed tonight as you cannot afford any more. The program is designed to refresh and reset the variables every 24 hours.

4.  The last part of creating this device involved connecting to the mail inbox through IFTTT to search for keywords that indicate an alcohol purchase at a bar. This triggers a cloud function in the program to change the color of an LED bundle from green to red. As the lights in the bottle are more red than green, it is an indication that you should not buy any more alcohol.

Outcome


To control the LEDs based on incoming e-mails, IFTTT function was used. The bottle would glow green until a certain email was received, in this case set to "restaurant" which was set to the alert set on Mint spend notification email. Initially, we tried to control the lights by publishing an event, which turned too difficult. Hence, we used the call function. To make the 24 hour reset happen, time.now function was used to track the program start time, track current time, and if the difference between the two is 1, the program will reset to the default state, which would be green lit bottle. 

The result was every time a certain amount of money was spent, an email notification would be sent to the user's e-mail, which triggers IFTTT, which triggers the light change. As these accrued, the amount of lights that turn red would change, increasingly making the bottle grow redder.

Show Advanced Options
Show Advanced Options
Creative2 01.thumb
Show Advanced Options

Reflection

The coding was the most difficult to deal with when multiple people were involved. We continuously used slack to send the edited code, but it eventually got too confusing.  It would be great if there was a GoogleDoc version for particle IDE so that we have one constant version.

An improvement that can be made to our project is an ability to track the exact amount spend at the bar. If we have this data, then we can change the gradient of the RGB led to change from green to led more smoothly, therefore, being more discrete. This can be done more easily if there was a mint integration with IFTTT. However, currently, this feature is not available.

Drop files here or click to select

You can upload files of up to 20MB using this form.