Installing and configuring - nnaumenko/iot_ambit GitHub Wiki
Note: this project uses Blynk for data viewing & archiving. Alternatively the sensor data and debug information can be reviewed with the serial port monitor.
Installing firmware for ESP8266
- Connect the sensors/buttons/resistors/etc. to ESP-12 according to the wiring diagram
- Connect ESP-12 to UART<->USB adapter (e.g. CP2102)
- Download binary file
- Download NodeMCU-flasher (Win32 version / Win64 version) or use any other ESP8266 programming tool
- Connect GPIO0 to ground (install Prog jumper JP3 according to wiring diagram)
- Power-up the device
- Upload binary file into ESP8266 starting with address 0x000000
- Disconnect GPIO0 from ground (remove Prog jumper JP3 according to wiring diagram)
- Connect GPIO12 to ground (hold Config Button according to wiring diagram)
- Power-down then power-up the device
- GPIO2 (Fault LED according to wiring diagram) is blinking; you may disconnect GPIO12 from ground (or release Hold Button)
- Open WiFi Access Point will be created by the device; connect to this wireless network and enter 192.168.4.1 in the web browser
Alternatively: compile project and install firmware with Arduino IDE
- Connect the sensors/buttons/resistors/etc. to ESP-12 according to the included wiring diagram
- Connect ESP-12 to UART<->USB adapter (e.g. CP2102)
- Make sure that ESP8266 core for Arduino and all required libraries (see below) are installed
- Connect GPIO0 to ground (install Prog jumper JP3 according to wiring diagram)
- Download and open the Arduino IDE project and compile it
- Power-up the device and upload firmware with Arduino IDE
- Disconnect GPIO0 from ground (remove Prog jumper JP3 according to wiring diagram)
- Connect GPIO12 to ground (hold Config Button according to wiring diagram)
- Open Serial Monitor in Arduino IDE
- Power-down then power-up the device
- GPIO2 (Fault LED according to wiring diagram) is blinking; you may disconnect GPIO12 from ground (or release Hold Button)
- Device information, including access point name, password (if enabled) and IP address is printed in Serial Monitor window
- Connect to the wireless network created by the device and enter device IP address in the web browser
Configuring
- Enter SSID, password and Blynk auth token in web interface, and press Save Settings button
- Enter MG811 calibration data and filtering parameters, and press Save Settings button.
- Optionally: if you prefer sensor data not to be sent to serial port (serial port activity causes LED installed on some ESP modules blink periodicall, which can be annoying), set Data Values Serial Output parameter to Disabled
- Make sure GPIO12 is not connected to ground (release Config Button according to wiring diagram)
- Restart the device and wait for connection with Blynk server to establish (if no connection can be established, GPIO2 is on / red Fault LED is lit)
- Run the Blynk project on your Android or iOS device
Setting up Blynk
- Install Blynk on your Android or iOS device; install latest Blynk library for Arduino IDE
- Create a new Blynk account or log if you already have one
- Import the Blynk configuration using the following link generated by Blynk application: tinyurl.com/h8appo8
- Copy an Auth Token; you will have to enter it during device setup.
Calibrating MG811 sensor
The calibration method is similar to one described here.
- Switch on the device and wait until MG811 readings are stable (this may take up to 48 hours).
- Expose MG811 to the outside air. Make sure that the air temperature & humidity are as close to the room temperature & humidity as possible.
- Wait until sensor readings are stable.
- Observe the uncalibrated MG811 reading from ADC with Blynk or Serial Monitor. Assume that the ADC value corresponds to 400 ppm (low limit of MG811).
- Expose MG811 to the exhaled air according to the method described here.
- Wait until sensor readings are stable.
- Observe the uncalibrated MG811 reading from ADC with Blynk or Serial Monitor. Assume that the ADC value corresponds to 40000 ppm (the CO2 concentration in the exhaled air).
- Restart the device in config mode as mentioned above and enter MG811 calibration data.
- If possible, verify calibrated MG811 readings with reference meter.