Originally Duck Buck started as a smart wallet, but after talking through as a team we realized that most people don't use a wallet regularly; they pay online via their phones or computers. Thus, we wanted to create a budget management tool that would help you manage your finances, without needing you to make the conscious effort to open up an app or website. With this in mind, we wanted to create a hardware device that would sit on your desk, constantly reminding you of your budgeting goals, and it would need to be likable enough so that you didn't want to see it angry. The most universally liked cute animal we could think of was a cute duck, and then, Buck Duck was born.
What it does
Buck Duck has three main modes. The first, and default, being budget duck mode. Buck Duck would connect to your bank and credit card API's in order to track your spending, and its eyes (read: translucent faceplate) would change color depending on how your spending matched your budgeting. This gives the user constant feedback on their spending choices, and by anthropomorphizing their finances, we hope that there is a greater reason for them to want to follow their budget.
As long as you had the duck on your desk, we figured, why not allow it to do more things? The second feature is, in our opinion, the most fun. The duck has a decibel meter built-in, so when it is in the second mode, it will "listen" to you talk, and then when you are done, reply by quacking and "blinking" it's eyes a rainbow of colors. The goal was to digitize the idea of rubber ducky debugging, where, by saying your thoughts out loud, you are more likely to solve your problem, and allow the duck to talk back! It was super cute, and we're really happy with how it turned out.
The third mode we implemented was a customizable Pomodoro Timer, to allow users to manage their time into sprints without the distraction of extra apps, websites, or worst of all, their phone.
How we built it
Buck Duck's hardware is based around a Raspberry Pi 3, using a Hover 2.0 for input, and a custom made color LED array for the faceplate. The outside of Buck Duck is laser cut wood and acrylic, made into the shape of a cute blocky duck! We wrote the OS for the Duck in Python. We're really happy with how the hardware came together in such a short time. We were able to implement the Hover's gesture controls so that switching modes and activating timers is done by petting the ducks back, which we think really brought everything together.
The main web portal was built using Firebase and React. User Login is handled by Firebase Authentication. Then, once the user is logged in, the can pair and unpair nearby ducks from the web app, as well as configure settings for each mode. This includes setting your budget in finance mode, and the times for concentration mode. For Finance mode in particular, we spent a lot of time determining the best way to do the budgeting. In the end, we selected both weekly and monthly budget options; this way users can enter their month budget as most bills are sent on a monthly basis, but the weekly budget that the duck shows can reflect money that has already been set aside (say, for a phone bill on the third week of each month, or the cable bill on the second). Finally, everything is stored in the Firestore and retrieved with Firebase Functions.
Challenges we ran into
One of the big challenges we ran into was hardware limitations. We had a limited amount of hardware, so we needed to improvise at times, like creating our own LED Array, and adding a giant base to the bottom of the duck to fit our HUGE 20,000 mAh battery we were using to run it. The Hover, however awesome it is, was horribly documented, and the company who made them has since disappeared, so getting that to work correctly and reliably was an adventure to stay the least.
One of the biggest issues that we ran into from a networking perspective was that both React and Firebase used triggers to listen for updates, and we kept running into an infinite loop. We kept having issues where Firebase would send an update, so React would re-render, so Firebase would check for and get the update again, then React would re-render.... Ultimately, while it took a long time to figure out why things were crashing in the middle of using the site while we were developing it (and why there were almost 9000 consecutive print statements in about 10 seconds), we solved all of this by restricting the reloading to when a ready boolean was set or unset, and we were able to solve this problem.
Accomplishments that we're proud of
We're really proud of getting it to work in the end! This was the first hardware hack for Andrew, Allison, and James, and Nathan had only ever done one other hardware project, and he had only made the web interface before. Getting the combination of everything to work together was an adventure, and the final duck is incredible.
In addition, as mentioned in the challenges section, we're really proud that we got everything working with the database to get bi-directional communication working between the dashboard and the duck, and between the pi and the device we were using as the speaker, without infinite updates and crashing.
What we learned
Since we were almost completely new to hardware, we learned a ton about the Raspberry Pi, specifically how the GPIO pins are managed and labeled, and how to detect and handle errors created by the Hover.
We also learned a lot about how event listeners and React work, and more importantly how they should (and should not) be attached together for continuous data flow (but not continuous refreshing).
What's next for Buck Duck
In the future, Buck Duck would obviously get much smaller. We envision it being the size of a traditional rubber duck, just large enough to be noticeable, but small enough to not be a nuisance.