Prerequisite for Smart Home Control

Simuli Virtual Lab

First, log in to your Simuli account and navigate to the Simuli Virtual Lab. Here we will create a new emulated instance of the STM32. Click on the Launch button under STM32 to get started.

This will open the configuration menu. First, provide a name for the project. Then, we will add the APDS 9301 Ambient Light Sensor and the W5500 Ethernet Module by selecting them from the list of available components. Finally, review that the name for the project and the selected sensors are correct and click on the Launch button.

Once we have clicked on the Launch button, a new instance of the STM32 will be created. It can take a few minutes, so be patient.

Now that our instance is being created, let's move forward to create an Adafruit IO account and configure it.

Adafruit IO

Go to the Adafruit IO website, if you already have an account, you can directly log in and skip to the configuration part. If this is your first time at Adafruit IO, click on the Get Started for Free button at the top. This will take you to a signup page, fill all the details and click on the CREATE ACCOUNT button.

Once the account has been created, go back to the Adafruit IO website. Let's start by creating our feeds. Feeds act as our MQTT topics, where we can either publish our data or subscribe to receive the data. In this case, we will create 2 feeds, one for publishing our real-time lux values and another for subscribing to the switch state of the lamp.

Click on Feeds, and then click on view all . This will open up a list of all the feeds currently set up for our account. Let's create our feeds for the lux values and the lamp.

Click on the New Feed button, this opens up a pop-up, let's name the first feed light. Finally, click on Create to create this new feed. Repeat the same process to create another feed called lamp.

Once both feeds have been created, our Adafruit IO setup is complete. We will now set up our Arduino IDE.

MQTT Dashboard

You can download the MQTT Dashboard app from the Play Store. iOS users can download the Easy MQTT app from the App Store. These apps work as MQTT Clients and can both publish data and subscribe to topics and get data.

We will be using these apps as a way to interface with our STM32 and get the real-time lux value and control a lamp connected to it.

Let's start configuring the MQTT Dashboard app.

For iOS users using the Easy MQTT app, the interface might differ slightly, but the overall procedure is the same.

Last updated