The Count

There is a very peculiar character in Sesame Street called “The Count”, he is a Vampire with an Eastern European accent that always introduces himself like this: “Greetings I am the Count… do you know why they call me the Count? Because I love to count things”.

Well, I love counting things too. I have implemented a counting system with my daughters based on a whiteboard. Every time they finish a chore or a task they get one point. They love it because that usually translates to some amount of money they can spend in whatever they want.

But I don’t want to be the police of points. I rather automate that. Also, I’d love to provide them with some sort of feedback in a leaderboard for them to know their progress.

There are 2 ways I want to count things: a. By them reporting them via a voice recognition interface, b. By them be auto detected when they happen.

The count via voice has an extra requirement. I don’t want my daughter’s voices to go out to the internet so the whole solution needs to run offline.

Implementation Details for the Voice Recognition counter.

Somebody in the house presses button connected to B. When that happens, A starts listening for 5 seconds. Just enough to grab the voice blip : “I washed the Dishes” that is placed in variable X . X is passed to a voice to text converter (1) running in a Raspberry Pi that puts the result in Y. The RPi also runs a voice classifier to determine who’s voice it is, puts the results in W. Then a text classifier determines what chore has been reported and puts it in Z. The author of the chore ( W) and the chore type (Z) are used to increase the total count for that person on that particular task (T). At the end the Total, the author and the chore are put together to be shown in the display M.

Implementation Details for the Automatic Counter

This is a much simpler version of the Voice Recognition counter. When C passes by D there is a match. There is a small tag in the dog’s collar that is detected by D. By doing so, D already knows who passed by. This is used to determine the total count (T). Then it is displayed in M.

The second option is to do the opposite, let’s assume that the bike has a small Near Field tag (E) that F is aware of. When E no longer detects E, that a means that I took my bike for a ride. That increases the count (T). That it is displayed in M.

Some design considerations:

⁃ The voice recognition requires a separate process to train the model to be able to classify voices.

⁃ You only need one display M, it could just rotate the count it is displaying every 10 seconds.

⁃ The counts need to be reset periodically to avoid error drift. Once a month seems to be a good compromise. The historic can still stay in memory and later we can figure out a better way to display it.

⁃ If there is a new thing to be counted, you just need to start sending it to the increaseCount function. If it is new, it will just create a new register for it.

⁃ The whole system should be intentionally designed to be off-the grid. No internet connection or wi-fi communication should be needed.

Future ideas

So, what do you want to count now? What you think about Push Up/ Pull ups, burpee repetitions? That wouldn’t be that complicated to implement using a cheap microcontroller with an accelerometer tied to an armband. I still can’t believe my Apple Watch can’t do that…


Dog Feeder revisited

Dr. Brown from Back to the Future was one of the reasons I decided to be an engineer. Not because he invented a time machine (pfff) but because of the machine he created to feed his dog (Einstein). If you haven’t seen that movie, stop reading this and go watch it.

Funny thing is that while some of my other friends in Engineering school wanted to become engineers because they wanted to go to the moon or something as far fetched as building a sentient cyborg, I just wanted to build cool gadgets for myself.

In this Blog Post I present a quick draft of how could we build a dog feeder using technology I’m familiar with: Microcontrollers, sensors, a mesh network and off the shelf mechanical components.

The basic idea is to have a mechanical timer/relay like those used in gardens advertise if it is time to do something or not. The way I would implement this is by reading whether current is passing or not (sensor N). Yes, I would have to translate from 220V to 5V but that’s not a big deal. I could just use a 220v to 5V transformer ( also known as a phone charger) to generate an input signal.

After that, I would check whether there is food in the main container. I was thinking about a sonar (sensor B) , I’ve worked with sonar sensors in the past and they are pretty reliable once you calibrate them. Here, it would know if there’s food based on how long it takes the ping to come back. A value of 2 is equivalent to 20% of the container being empty. Sonars don’t rely on light so I assume it will work with some food dust around.

In addition to checking if there’s food I need to verify whether there is food in the plate or not (sensor I) . I would place a small light sensor on the bottom of the plate. If light is detected, that means there is no food on the plate.

If all looks good I would start the motor that drives a dispenser screw (actuator C) for it to drop some food to the pipes that are already pressurized by the air pump (actuator D). Similar to when you vacuum your own home, it will drive the food kernels through the pressurized pipes all the way to the element F.

A vibration sensor (sensor E) detects whether food is hitting the walls of the pipes. If no vibration is detected that means no food is in the pipes and something must be wrong: Either no pressure or no food. We output an error message to the message board (actuator M) and exit the program. Sorry dogs, no robot serviced food for you today.

Once food makes it to the intersection F, it will go either left or right. Actuator F is just a ramp that moves to one side or the other letting the food fall in Chi Chi’s plate or in Hugo’s plate.

Maybe this is an overkill, but there’s yet another sensor in the pipe that detects whether food is passing through all the way to the plate. This is to confirm that F did its job properly. I could just instead check sensor I to figure out if the plate is filled in.

Because dogs also need water to live, specially after eating that processed food, we check the level of the water using a floating magnet. A magnetic field magnet checks the intensity of the field, infers how close the magnet is (sensor K) and determines the level of the water. If water is needed, the water valve Q is opened for a certain amount of seconds to fill the bottle.

And all this so we can focus on the Flux Capacitor…