Hello! My name is Akshobhya, and as a sixth grader, I’ve always loved playing with gadgets that surprise and delight people. That’s why, for my latest school project, I decided to make a “mystery vending machine”—but with a techy twist!
Instead of coins or buttons, my vending machine uses an IR remote. When you press a number between 1 and 6, you don’t just get candy or a toy—you get a surprise message and the RGB LED lights up in a cool color, all programmed by me. The best part? You have no idea what your “mystery prize” will be until you try.
Here’s how it works: when someone picks a number, say number 4, the code uses a switch-case statement to check which number was selected. For number 4, the vending machine flashes purple (mixing red and blue), and the serial monitor displays: “You won a trending video game. Congratulations!” Another friend might choose number 1, which gives a white light and the message: “You first won a free solo. Congratulations!” Each number triggers its own unique color—green, blue, cyan, yellow, or even pure white if you hit zero.
The behind-the-scenes magic involves variables (which store the color values for the LEDs) and pin modes (to control which hardware parts are active). The IR receiver is set up to listen for remote signals, and each time someone plays, the code loops through again, ready for the next mystery.
I loved demonstrating my invention, watching friends wonder what surprise would come next. This project taught me much about coding, electronics, and making everyday things more fun and interactive. I can’t wait to build an even cooler version next time—with real prizes inside!