Chiwai Chan's Blog

These words are my own

Smart Cat Feeder – Part 1

If you are forgetful when it comes to feeding your fur babies like me, and you often only realise you need to put some dry food into the bowl when you are at work then you should read these series of blogs. Over time, I'll be designing and building a smart cat feeder over time using a combination of components such as Arduino micro controllers, motors, sensors and IoT devices and Cloud services. I'll publish the steps taken in these series of blogs, also, I'll publish any designs and source code as I figure things out and make decisions on aspects of the design.

In this part 1 of the series, I will do a walkthrough on setting up an AWS IoT 1-Click device to trigger a Lambda Function. I got myself one of these Seeed IoT buttons for $20; I also bought a NCR18650B battery which I realised later on is only required if I wanted to run the device without it being powered by a USB type-C cable (used for charging the power as well).

Seeed IoT Button for AWS

Firstly, make sure you have an AWS account. Then install the AWS IoT1-Click app onto your phone and log in using your AWS account. With these we will be able to link IoT devices up to our AWS account.

AWS IoT App Login

Claim the IoT device with Device ID

AWS IoT App Claim

Scan the barcode on the back of the device; you can scan multiple devices in bulk.

AWS IoT App Scan

AWS IoT App Added

AWS IoT App Complete Claim

AWS IoT App Complete Claim

Next, I'll set up the Wifi on the device so that it can reach the internet internet from home. Can't see why I can't set it up to my phone's AP for feeding on the go, I'll try it out some other time.

AWS IoT App Wifi

Now we'll create a project and add the IoT device to a placement group in the AWS Console. Give a name and description for the project.

AWS IoT New Project

Next define a template, this is where we create a Lambda function; all the plumbing between the IoT device and Lambda will be handled for us.

AWS IoT Project Template

Next we create a placement for the Iot device.

AWS IoT Project Placement

AWS IoT Project New Placement

AWS IoT Project Placement Created

Since I have no Arduino micro-controllers (have yet to buy one), I will get the Lambda to log a message.

AWS IoT Lambda

Push the button on the Iot device, wait for the event LED status to turn green after flashing white then check the logs CloudWatch Logs.

AWS IoT Lambda Logs

At some point I have to code the Lambda to perform a real action as each event comes through, which will be demonstrated in a following blog in the series instead of just logging to CloudWatch logs.

Within the app on your phone you can see status of each IoT device such as the remaining battery life percentage.

AWS IoT App Devices

As well as a history of the button's events.

AWS IoT App Device Events

In the next blog, I'll configure the Lambda to push the event to a Topic for AWS IoT Core to subscribe to, which in turns will trigger an event to an ESP32 ( I've yet to decide on a specific version of the micro-controller) using the IoT MQTT protocol.

Smart Cat Feeder – Part 1
Scroll to top