Fifteen-year-old Ali Edis likes to tinker with Raspberry Pi to learn more about machine learning and artificial intelligence. He’s using WhatsApp to control some of his builds.
How does it work?
Ali’s Python code opens WhatsApp in a browser and waits for the user’s login confirmation. Once the user has logged in, it kicks into gear. The software captures the last message in the chat selected by the user, and generates its own replies based on what it reads in the message.
It works similarly to customer service chatbots, by guessing what the most appropriate answer is. So if the user types “Hello,” they’ll get a WhatsApp message back saying, “Hi, how can I help you?”
The LED portion of the build is also controlled by WhatsApp messages. The software can control each individual LED, and it turns the lights on and off based on the commands the user types into WhatsApp. You can ask the software to turn them all on or off, or you can specify whether each individual LED should be on or off by typing a string of zeroes and ones, where each character represents the state of one of the LEDs.
Ali made some WhatsApp-controlled fridge magic too
This is another cool project we liked from Ali. Here, WhatsApp controls another Python machine learning application to identify different foods in your fridge and tell you how many calories they contain.
Ali has done a lot of projects like this. Subscribe to his YouTube channel to go down a machine learning rabbit hole.
Want to have a go at machine learning?
If you think you have the basics down and you’re ready to really get going, you could try Adafruit’s BrainCraft HAT which was developed specially to be used with Microsoft’s Lobe tool on Raspberry Pi. Read about how the HAT and Lobe work together here.