ESP8266 DAQ: Difference between revisions

From Rev0 Wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is a project to create a Wi-Fi enabled data collection unit supporting an 8-channel 12-bit ADC (MAX11629), DHT-11/22 temperature/humidity sensor, MQ-135 air quality sensor, supports 2 CPU fan or servo outputs, as well as a single SPI and UART interface, and is expandable to support a LiPo battery with on-board charging circuit. This project is based around an ESP-12E module, utilizing the ESP8266 Wi-Fi SOC which performs all Wi-Fi protocol processing and contains a general purpose MCU compatible with the Arduino IDE.
This is a project to create a Wi-Fi enabled data collection unit supporting an 8-channel 12-bit ADC (MAX11629), DHT-11/22 temperature/humidity sensor, MQ-135 air quality sensor, 2 CPU fan or servo outputs, SPI and UART interfaces, and is expandable to support a LiPo battery with on-board charging circuit. This project is based around an ESP-12E module, utilizing the ESP8266 Wi-Fi SOC which performs all Wi-Fi protocol processing and contains a general purpose MCU compatible with the Arduino IDE.


[[File:ESP8266_DAQ.png.jpg|thumb|right|ESP8266 DAQ with environmental sensors.]]
[[File:ESP8266_DAQ.jpg|thumb|right|ESP8266 DAQ with environmental sensors.]]


==List of Features==
==List of Features==


*  
* 802.11b/g/n Wi-Fi
* LED indicators
* 32-bit 80 MHz RISC CPU
* Re-programmable and rechargable via micro-USB (FT-232RL IC)
* 512kB(?) Flash for program/data storage
* ~38kB Free SRAM
* Uses Arduino IDE
* On-board FT232RL for reprogramming and UART comms
* micro USB connector for power/communication
* 8 channel 12-bit ADC with RC input filter on each channel
* Support for DHT-11/DHT-22 and MQ-135 for environmental sensing (temperature/humidity/air quality)
* LED indicators
* Support for LiPo battery with internal charging circuit
* Support for LiPo battery with internal charging circuit


Line 13: Line 20:


[[File:ESP8266_DAQ_Schematic.png|thumb|right|The complete system schematic for the ESP8266 DAQ.]]
[[File:ESP8266_DAQ_Schematic.png|thumb|right|The complete system schematic for the ESP8266 DAQ.]]
[[File:ESP8266_DAQ_PCB.png|thumb|right|The PCB layout (top: red, bottom: blue) for the ESP8266 DAQ.]]
This board contains the necessary circuitry to re-program the ESP8266 with the Arduino bootloader and program/debug through the Arduino IDE. The board also adds environmental sensing capability (temperature and humidity via the DHT-11 or DHT-22 sensor and air quality/CO2 via an MQ-135) and an 8-channel ADC. The GPIOs are mapped as follows:


===Microcontroller and LCD===
* '''TOUT (ADC)''' - MQ135
[[File:ESP8266_DAQ_PCB.png|thumb|right|The PCB layout (top: red, bottom: blue) for the ESP8266 DAQ.]]
* '''TX''' - Serial Interface
In the simplest case, a digital Geiger counter would need only two functions, to count the pulses from the Geiger tube and calculate a rate, and to display the rate on the LCD. This project simply adds a few extra features, all very simple to implement.
* '''RX''' - Serial Interface
First, the microcontroller needs to be able to count pulses from the Geiger tube over a certain time period. This is accomplished by running a timer divided down from a 24 MHz crystal. Pulses are detected by the microcontroller's hardware via a falling edge interrupt, which increments the ticks variable. The timer module produces an interrupt 50 times a second. Every second the microcontroller records how many pulses were detected since the last interrupt, and this value is added to an array of 32 values each 0.3s, which are averaged and displayed.
* '''GPIO0''' - Bootloader Dedicated
Next, the microcontroller needs to display values and text to the screen. This is achieved by sending binary data over an SPI data interface. An LCD function library handles the low-level conversion between ASCII characters from strings or numbers in variables to characters to be displayed to the LCD.
* '''GPIO2''' - DHT-11/22
The microcontroller reads battery voltage and displays it as an 8-level bar graph. The microcontroller also optionally displays conversions in uSv/H and mR/H, and displays the corresponding accumulated dose (uSv in CPM mode). The microcontroller also maps the CPM value to a logarithmic bar graph, which is displayed in the middle of the screen.
* '''GPIO4''' - Fan/Servo 1
* '''GPIO5''' - Fan/Servo 2
* '''GPIO12''' - SPI MISO
* '''GPIO13''' - SPI MOSI
* '''GPIO14''' - SPI SCLK
* '''GPIO15''' - SPI CS (ADC)
* '''GPIO16''' - SPI CS2 (External SPI device)


===Hardware Revisions===
===Hardware Revisions===
Line 27: Line 43:


'''Outstanding Issues:'''
'''Outstanding Issues:'''
* ...
* None yet!


====PCB Files====
====PCB Files====
Here is the Eagle schematic file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.sch
Here is the Eagle schematic file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.sch
Here is the Eagle board file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.brd
Here is the Eagle board file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.brd


Line 41: Line 58:
==Code==
==Code==


Full source code for the project can be found here: http://rev0proto.com/files/ESP8266_DAQ.zip
Basic project template for connecting to Wi-Fi access point (SSID and WPA2 key hard-coded) and posting temperature/humidity + single ADC channel to a Thingspeak channel: http://rev0proto.com/files/ESP8266_DAQ.ino


==Photos==
==Photos==
Line 54: Line 71:
|Cost
|Cost
|Source
|Source
|- style="color:gray;text-align:left;"
|- style="color:navy;text-align:left;"


|ESP-12E Module
|ESP-12E Module
|$3.33
|$3.33
|[http://www.ebay.com/itm/131497630292 eBay]
|[http://www.ebay.com/itm/131497630292 eBay]
|- style="color:gray;text-align:left;"
|- style="color:green;text-align:left;"


|PCB
|PCB
|$1.40
|$1.40
|[http://dirtypcbs.com/view.php?share=9435&accesskey=848559057f2751938392fce76a20d490 DirtyPCBs]
|[http://dirtypcbs.com/view.php?share=9435&accesskey=848559057f2751938392fce76a20d490 DirtyPCBs]
|- style="color:maroon;text-align:left;"
|- style="color:black;text-align:left;"


|FT-232-RL
|FT-232-RL
|$4.50
|$4.50
|[http://www.mouser.com/Search/ProductDetail.aspx?R=FT232RL-REEL Mouser]
|[http://www.mouser.com/Search/ProductDetail.aspx?R=FT232RL-REEL Mouser]
|- style="color:navy;text-align:left;"
|- style="text-align:left;"


|MAX11629
|MAX11629
|$3.93
|$3.93
|[http://www.mouser.com/Search/ProductDetail.aspx?R=MAX11629EEE Mouser]
|[http://www.mouser.com/Search/ProductDetail.aspx?R=MAX11629EEE Mouser]
|- style="color:navy;text-align:left;"
|- style="text-align:left;"


|AP1117
|AP1117
|$0.27
|$0.28
|[http://www.mouser.com/Search/ProductDetail.aspx?R=AP1117IE33G-13 Mouser]
|[http://www.mouser.com/Search/ProductDetail.aspx?R=AP1117IE33G-13 Mouser]
|- style="color:navy;text-align:left;"
|- style="text-align:left;"


|Passives/Misc. Components
|Passives/Misc. Components
|$0.25
|$0.50
|[http://www.digikey.com/ Digi-Key]
|[http://www.digikey.com/ Digi-Key]
|- style="color:red;text-align:left;"
|- style="color:red;text-align:left;"


|Total Price
|Total Price
|~$13.68
|~$13.94
|
|
|-
|-


|}
|}

Latest revision as of 00:46, 21 August 2015

This is a project to create a Wi-Fi enabled data collection unit supporting an 8-channel 12-bit ADC (MAX11629), DHT-11/22 temperature/humidity sensor, MQ-135 air quality sensor, 2 CPU fan or servo outputs, SPI and UART interfaces, and is expandable to support a LiPo battery with on-board charging circuit. This project is based around an ESP-12E module, utilizing the ESP8266 Wi-Fi SOC which performs all Wi-Fi protocol processing and contains a general purpose MCU compatible with the Arduino IDE.

File:ESP8266 DAQ.jpg
ESP8266 DAQ with environmental sensors.

List of Features

  • 802.11b/g/n Wi-Fi
  • 32-bit 80 MHz RISC CPU
  • 512kB(?) Flash for program/data storage
  • ~38kB Free SRAM
  • Uses Arduino IDE
  • On-board FT232RL for reprogramming and UART comms
  • micro USB connector for power/communication
  • 8 channel 12-bit ADC with RC input filter on each channel
  • Support for DHT-11/DHT-22 and MQ-135 for environmental sensing (temperature/humidity/air quality)
  • LED indicators
  • Support for LiPo battery with internal charging circuit

Electronics

The complete system schematic for the ESP8266 DAQ.
The PCB layout (top: red, bottom: blue) for the ESP8266 DAQ.

This board contains the necessary circuitry to re-program the ESP8266 with the Arduino bootloader and program/debug through the Arduino IDE. The board also adds environmental sensing capability (temperature and humidity via the DHT-11 or DHT-22 sensor and air quality/CO2 via an MQ-135) and an 8-channel ADC. The GPIOs are mapped as follows:

  • TOUT (ADC) - MQ135
  • TX - Serial Interface
  • RX - Serial Interface
  • GPIO0 - Bootloader Dedicated
  • GPIO2 - DHT-11/22
  • GPIO4 - Fan/Servo 1
  • GPIO5 - Fan/Servo 2
  • GPIO12 - SPI MISO
  • GPIO13 - SPI MOSI
  • GPIO14 - SPI SCLK
  • GPIO15 - SPI CS (ADC)
  • GPIO16 - SPI CS2 (External SPI device)

Hardware Revisions

Revision 1.0

This is the first revision of the ESP8266 DAQ.

Outstanding Issues:

  • None yet!

PCB Files

Here is the Eagle schematic file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.sch

Here is the Eagle board file for the ESP8266 DAQ: http://rev0.net/files/wifi_ws_v10.brd

Enclosure

The enclosure for the ESP8266 DAQ was created with Autodesk Inventor 3D CAD software, and is 3D printed (in this case using a Makerbot Replicator 2). The enclosure is made of 2 separate pieces, which are assembled by snapping them together.

Here are the Autodesk Inventor files for the enclosure: http://rev0proto.com/files/ESP8266_Enclosure.zip

Code

Basic project template for connecting to Wi-Fi access point (SSID and WPA2 key hard-coded) and posting temperature/humidity + single ADC channel to a Thingspeak channel: http://rev0proto.com/files/ESP8266_DAQ.ino

Photos

Total Project Cost

Component Cost Source
ESP-12E Module $3.33 eBay
PCB $1.40 DirtyPCBs
FT-232-RL $4.50 Mouser
MAX11629 $3.93 Mouser
AP1117 $0.28 Mouser
Passives/Misc. Components $0.50 Digi-Key
Total Price ~$13.94