Building a Simple Smart Home System with the micro:IoT Expansion Board
The project simulates a simple Smart Home system using the micro:IoT expansion board. In this system, all devices are connected via the Internet of Things. Users can remotely control home devices such as lights and doors, while environmental data is uploaded to the cloud for further use. This project provides students with a better understanding of IoT applications.
The Micro: IoT board is an IoT expansion board designed to lower the barrier for non-experts to use IoT. It is based on the micro:bit and can be used with the DFRobot Easy IoT platform. The board includes Wi-Fi, OLED, 2-way motor drive, 6-way IO port, 2-way IIC, 1-way serial port, 1-way buzzer, 3-way RGB, 2-way servo, Li-ion battery holder, charging circuit, emergency power interface, and more. It is designed to be easy to program and can be used to build IoT applications without complicated background knowledge.
Learn more: IoT Expansion Board Based on micro:bit Wiki - DFRobot
1. Connect the Touch Sensor to P0.
2. Connect the Push Button to P1.
3. Connect the LED to P2.
4. Connect the Temperature & Humidity Sensor to P8.
5. Connect the Servo to S1.
The sample code is written in Mind+, which you can download for free at mindplus.cc.
This program is designed to use the touch sensor to control the door and the button to toggle the light. Additionally, it will retrieve temperature and humidity data, which will be displayed on the OLED screen.
For MakeCode users, load the micro:IoT extension library https://github.com/DFRobot/pxt-microIoT.
Easy IoT is a platform designed to provide simple and accessible solutions for building IoT projects.
1. Visit the Easy IoT website by going to: http://iot.dfrobot.com
2. To register an account, click on the "Sign up/Sign in" button located in the upper right corner of the webpage. You can register using your phone number or email address.
3. After you sign in, you will be directed to the Workshop interface.
4. On the left side of the Workshop page, you will see your IoT username and password. You will need to enter them later in Mind+.
5. Click on the plus sign (+) to add a new device that matches your micro:bit.
6. Once you add a new device, a device topic will be generated randomly. To change the device name, simply click on the name of the device.
7. Click on "Send Message" to access the message transmitting and receiving webpage. From there, you can view the details of any received data.
To connect to Easy IoT within the program, add the "MQTT Initial parameter" block and enter the Wi-Fi network information along with your username, password, and device topic provided by Easy IoT.
Once you have established a connection to the Easy IoT platform within your program, you can send messages to the platform and control devices based on messages received from the platform.
To send a message to the Easy IoT platform, click on "Send Msg" and input your command in the "Send a New Message" field. Once you have entered your message, send it out to the platform.