2 DIY WiFi Temperature Sensor

This chapter will take about 10 minutes to read. It mainly introduces an open source WiFi temperature sensor (DS18B20) based on nodemcu (esp8266) which can be used on DeviceBit.

1 Hardware & Software

No.

Sort

Name

Description

1

Hardware

Nodemcu DS18B20

2

Software

Nodemcu Download tool

2 Hardware

2.1 Wire Connection

As the picture shown below, supply power to the 18b20 with nodemcu and connect the 18B20 data cable to D5 pin of ndoemcu.

Hardware schematic:

Hardware schematic

2.2 Download firmware

Firmware download software:FLASH_DOWNLOAD_TOOLS_V3.6.4

Firmware : https://github.com/lewei50/lua-on-nodemcu/tree/master/demo/ESP8266-DS18B20/bin

Download firmware:

After the download is complete, restart the device

3 Configuration on DeviceBit

Log in to https://www.devicebit.com , sign up and then sign in.

3.1 Add A Device with wifiHT Template

Note: to select the correct template.

Click on Save

There will be three sensors on the sensor page after click on Save successfully.

Each account has a userkey, and each device has an ID. Record the userkey_ID of the newly created template device, as shown below.

4 Nodemcu settings & Configuration on DeviceBit

Restart, and connect to AP

Restart nodemcu,find the following ap of ssid, and connect to it. The password is 12345678.

WiFi Configuration(http://192.168.4.1/dev)

Visit http://192.168.4.1/dev ,see the following page

TcpServer:User's own server address (described later, optional) SN:The userkey_ID of the user account of the platform (introduced in Chapter 3.2), shown as follows:

Click on Save when the configuration is done.

WiFi Configuration(http://192.168.4.1)

Visit 192.168.4.1 to configure related wifi parameters, and then click on Save.

The device will restart automatically. If everything is normal, you will see there is one more device in the network of the windows system. Its name is DS18B20_SN. You can modify the configuration at any time.

5 Monitor on DeviceBit & Alert

6 Other features of open source wifi HT

This open source WiFi HT is not bound to the cloud platform. In addition to uploading data to the platform, it can also implement the following applications.

6.1 Serve as http server to provide get interface

Mainly for LAN applications without internet

Inside the data array is the temperature value, which is updated in 10 seconds.

6.2 Custom socket; data is sent to the personal server

The firmware periodically sends {"status": "succeed", "data": [28.1875], "mac": "18fe34e0b7d8"} every minute as a heartbeat packet. The firmware responds to the read command and returns {"status":"succeed","data":[28.1875],"mac":"18fe34e0b7d8"} (The data in the data array is the real-time temperature value.)

Last updated