1937 views|0 replies

34

Posts

0

Resources
The OP
 

GoKit Case Study: Gizwits IoT Development Platform’s Pet House Transformed into an Air Quality Detector [Copy link]

A GoKit3

I know how to develop a smart pet house

but

How to transform it into an air quality detector?

Actually, it’s very simple

Just buy one on the almighty Taobao

MQ135 air quality detection sensor

Modify the circuit again

It can be realized

Today, I will show you how to develop a pet house (including infrared shielding, temperature and humidity, full-color lights, and motors) and air quality detection (including harmful gas concentration and air quality).

Before development, prepare the materials first

  • Hardware preparation: Gokit3 function board, ESP8266, MQ135, USB data cable, cable
  • Software preparation: Gizwits self-service development platform account, ESP8266 IDE, EClipse

After the materials are prepared, before entering the development stage, you still need to confirm how the circuit equipment is connected and what related development documents are available?

Regarding MQ135, you need to know its extended external circuit. The USB power supply is 5V, and the actual voltage after passing through the diode is about 4.93V. The sensor voltage is divided into 0-1V (10-bit ADC corresponds to 0-1024) according to the resistor divider. According to the MQ135 sensor manual, we divide the parameters of the voltage after voltage division into the following corresponding air quality:

Excellent: 0-200

Good: 201-400

Medium: 401-600

Poor: 601-1024

Related development documents: Scan the QR code to obtain

GoKit3 schematic diagram, GoKit3 function board (expansion board) schematic diagram

Phase 1: Creating a cloud product

Next, we will enter the first stage of this case development: creating a cloud product

This is the initial stage of IoT development, which lays the foundation for later MCU and APP development.

Create a new product on the cloud at dev.gizwits.com:

After creating a product, click the data point on the left, click Manage, and select the product data point template

Select Gokit demo and click Add

After importing the demo data point, we need to create the following two data points

At this point, our data point has been created. After creating it, remember to click the top application to make it effective. Next, we click the basic information on the left, copy the Product Secret content, and then

Click MCU Development on the left and generate SOC code according to 1234. After generating the code, download it to your computer and decompress it.

Phase 2: Driver-related code migration and precautions

Download the relevant driver from the website: https://download.gizwits.com/zh-cn/p/92/94

Or download from the following URL:

http://gizwits.oss.aliyuncs.com/hardware_resource/GoKit_SoC_ESP8266_V03000003Test firmware and development resources 2017072815.zip

The code part has been omitted, see the original link for details

http://club.gizwits.com/thread-165501-1-1.html

Note:

  • After downloading the software, you must first unzip it and copy the unzipped software to a non-Chinese path. It cannot contain Chinese characters. If there are Chinese characters, they need to be changed to pure English. Otherwise, the software will not be usable.
  • Select the Makefile in the root directory and modify the compilation-related information. Modify it to the following, type it yourself, don't copy the code here, if the code is different, it will report an error and you can only unzip it and import it into the project again to solve it. All the codes introduced in the future can only be typed manually and cannot be copied.

Phase 3: Code Modification

Next we need to modify the code: add the corresponding function call in the code.

The code part has been omitted, see the original link for details

http://club.gizwits.com/thread-165501-1-1.html

Stage 4: Download the program to 8266

First, GOKIT3 pulls the key to GND, connects the serial port cable next to it to the USB to TTL (TX-RX RX-TXGND-GND), and then connects the USB to the mobile phone charger. Open the download software (download address https://www.espressif.com/sites/default/files/tools/flash_download_tools_v3.6.7.zip)

Set the software parameters as follows and select the compiled firmware (do not fill in the corresponding address incorrectly)

Click START to start downloading. If it is stuck in waiting, it means that your key1 is not connected to the GND side. Pull it over and press the reset button (reset). The download is successful as shown in the figure.

Next, pull the GND back to the key. Then press reset and the program will start running.

Open the Gizwits APP (search "Gizwits" in the App Store to download), short press the middle button on the development board (the red light is on), click the plus sign in the upper right corner of the mobile APP, select hotspot configuration, select your home router wifi on the pop-up page, enter the wifi password, go to the next step, select Espressif, and then click I have completed the above steps, click the device in the device discovery, and you can start configuring the network. If there is no device, check whether the red light on the development board is on. If there is no problem, it will be successfully bound after a while. Click it and you can start using your new device

At this point, all steps are completed, and the pet house also has the function of air quality detection.

How about it? It's simple, isn't it?


This content is originally created by EEWORLD forum user z3512641347 . If you want to reprint or use it for commercial purposes, you must obtain the author’s consent and indicate the source

This post is from stm32/stm8
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list