yaESP – A multipurpose ESP8266 peripheral board
- 1 Connections
- 2 Schematic
- 3 Enclosure
- 4 On Board Functions
- 5 Off Board Extensions
- 6 Comments
The yaESP is an exploration of the the new low cost WiFi b/g/n ESP8266 modules and features a number of shared peripherals occupying the 9 available I/O. Programmable in C as well as LUA, the ESP8266 has a strong community building around it. The peripheral features are as listed as per the I/O connection as follows (4 & 5 are reversed). Pins with suffix a/b/c are options depending on board population.
|0||PROG||PRG||Button & Connector & Auto Reset|
|1&3||TX&RX||USB||CH340G USB to serial converter|
|2||DHT||DHT11 - temperature and humidity sensor|
|4a||OPTO||ISO||Connector for isolated input by optocoupler|
|4b||OPTO||VS1838B - IR receiver for remote control|
|5||LED||RGB||WS2812B RGB LED & connector|
|12a||1WIRE||KTC||Connector for thermocouple by MAX31850|
|12b||1WIRE||1WR||Connector for off board devices|
|13a||AUDIO||Amplified speaker by IS31AP4991|
|13b||AUDIO||SPK||Connector with low side 5V switch by N-FET|
|14a||RELAY1||OTA||Connector with one half of A3910 H-bridge|
|14b||RELAY1||OTA||Connector with low side 5V switch by N-FET|
|15a||RELAY2||OTB||Connector with one half of A3910 H-bridge|
|15b||RELAY2||OTB||Connector with low side 5V switch by N-FET|
|16a||BUTTON||Physical button for user interface|
|16b||BUTTON||Wake from sleep by reset connection|
|16c||BUTTON||BTN||Connector for off board function|
|ADCa||ADC||Microphone input amplified by MCP6L91|
|ADCb||ADC||Light sensor ALS-PT19-315C in voltage divider|
|ADCc||ADC||ANA||Connector for off board analog input|
The schematic illustrates the connections.
The enclosure is a three layer acyclic sandwich:
On Board Functions
Measuring temperature and humidity
The on board DHT11 can measure temperature to ±2°C and humidity to ±5?RH. Alternatively for better accuracy and resolution the DHT22/AMS2302 is also supported.
Receiving IR remote signals
Shared with the optocoupler input on 4a/4b is a VS1838B infrared remote demodulator. This device will receive most TV remote control codes modulated at the standard 38kHz.
Listening for sounds
An amplified microphone is connected to the on board ADC. The amplifier is an MCP6L91 configured in inverting form. This input is shared with the light sensor ADCb as well as ADCc, the off board analog connector ANA.
Measuring light level
A phototransistor light sensor ALS-PT19-315C, in a voltage divider, is connected to the ADC input. This input is shared with the microphone ADCa as well as ADCc, the off board analog connector ANA.
A speaker, amplified by IS31AP4991, is available for audio playback and PWM beeping. The amplifier (13a) is shared with a low side switch (13b).
Off Board Extensions
Measuring high temperatures
Thermocouples can be used to measure a wide temperature range, K-type probes are available for a few dollar that can measure up to 800°C. Higher temperatures are possible with an upper limit of around 1300°C. The thermocouple is polarized and connects to the pins labeled KTC, the negative pin on the PCB is marked with a negative symbol. This option requires populating IC4, the MAX31850 thermocouple amplifier and a few discrete resistors and capacitors.
Measuring multiple temperatures
The 1Wire bus can be used to connect multiple devices simultaneously, it requires no additional on board hardware and does not conflict with the thermocouple amplifier. The common 1Wire temperature sensor is the DS18B20 by Maxim, which has a temperature range of -55°C to +125°C and is accurate to ±0.5°C over the range of -10°C to +85°C.
Switching a 120v AC load
An electromechanical relay or a solid state relay can be use to switch large AC voltages. The SSR-40DA is a common solid state relay that can switch up to 40 Amps and 150 volts. This relay can be controlled with options 14b, 15b or 13b, a low side 5v switch with off board connectors OTA, OTB or SPK. An electromechanical relay can also be used with the same conenctions keeping in mind the coil should be rated for 5v.
Sensing an AC voltage
The connector labeled ISO provides an optically isolated input along with a few discrete components depending on the AC voltage to be sensed. The optoisolator is part SFH6186-2. For sensing a 24vAC signal, a diode is required for reverse protection along with a pair of 1k ohm series resistors for current limiting. Isolated DC sensing can also be implemented with suitable values parts.
Controlling a DC motor
A small DC motor, up to 5v and 500mA can be speed controlled in forward and reverse by the H bridge. This makes use of options 14a and 15a and requires IC1 and IC3 to be populated, the A3910 H-bridge and 74LVC2G04 level shifter. Motor connections are OTA and OTB and optionally have back EMF protection diodes.
Multiple single direction motor operation can also be implemented, see the next section on switching a DC load.
Switching a 5v DC load
Small DC loads up to 2 Amps can be switched directly by any of the low side N-channel MOSFET switches. These are options 14b, 15b and 13b, with off board connectors OTA, OTB and SPK respectively. Back EMF protection diodes are optional for OTA and OTB. Current limiting resistors are optional for OTA, OTB and SPK. Pulse width modulation can be applied to these switches as well.
Connecting more RGB LEDs
The yaESP board has a level shifted WS2812b RGB LED on board running from 5v. This is a serial shifted LED with the data out on the RGB connector. Additional WS2812B LEDs can be added for individual control. The level shifter is part 74LVC1T45.
Sensing a reed switch
A passive reed switch or active PIR sensor can be connected using the BTN connector. This interface has a 3.3 volt pullup resistor and is active low.
Measuring analog voltages
The ANA connector can feed the internal analog to digital converter thru a resistive divider. The range into the divider is 0 to 3 volts.
Leave a comment below if you have an interesting application in mind …