Objective: Turn your refrigerator into a smart home IoT deviceStep 1: Hardware Setup
To avoid changing any built-in electric wiring in the fridge, I used a power bank to supply power to the Raspberry Pi device, and a USB LED light to provide lighting for camera, when the door is closed.
Connect your Raspberry Pi device to external speaker using bluetooth or audio cable. Connect the camera module to Raspberry Pi. Connect the LED light to Raspberry Pi through USB. Connect your Raspberry Pi device to a power bank.
The setup looks something like this, where all the external components except for the bluetooth speaker (camera, battery, LED light) are connected physically to the Raspberry Pi device.
Place the device in the fridge or kitchen cabinet so that the camera is pointing in the direction of the items inside.
Get your Raspberry Pi device's IP address and connect from your mobile phone using the RaspiCam-Remote mobile app. Make sure you are able to view the inside of your fridge or kitchen cabinet on your mobile phone.Step 3: Image Recognition & Voice
I have uploaded a python script Smart-Fridge.py in my git repository under Smart-Home. This script takes a snapshot image with Pi camera, performs image recognition using AWS Rekognition API, prints the list of items found in the image on STDOUT, and also produces audio output using the Text-to-Speech API of AWS Polly, which is played on the external speaker connected to Raspberry Pi via bluetooth. The script can be run remotely from any computer connected to the Raspberry Pi device via VNCor SSH.What's Next: