Go Down

Topic: Sampling 5 sensors data with esp8266 (Read 113 times) previous topic - next topic

Marciokoko

I understand the esp8266 only has 2 gpio pins I could use to connect to sensors.  Currently I have a simple setup where an esp01s samples data from a dht22.  The esp01s is running on its own as a mcu.

I want to add a UV sensor and an mq sensor and maybe even a dust and light sensor.  Would I need to move up to a nano or is there something I can do and keep my esp on its own?

KASSIMSAMJI

#1
Jul 19, 2019, 07:06 am Last Edit: Jul 19, 2019, 07:10 am by KASSIMSAMJI
I understand the esp8266 only has 2 gpio pins I could use to connect to sensors.
that's right but you can free rx/tx and use them as GPIOs as well

Code: [Select]



void setup() {


pinMode(1, FUNCTION_3);   //GPIO 1 (TX) swap the pin to a GPIO.

// pinMode(1,OUTPUT);


pinMode(3, FUNCTION_3);   //GPIO 3 (RX) swap the pin to a GPIO.

// pinMode(3,OUTPUT);

}



but make sure you have 100uF electrolytic cap. across RST and Gnd to make sure it(esp01) won't lock into a boot mode
Expert To Be: Machine Learning And Computer/Machine Vision (ML/CV/MV)

noiasca

use a esp8266-12e or a more beginner-friendly Wemos D1 or NodeMCU

12e http://s.click.aliexpress.com/e/FjplSBm
NodeMcu http://s.click.aliexpress.com/e/ofu7mzE
Wemos D1 http://s.click.aliexpress.com/e/VyYiT1q

these come with more GPIOs than the Standard ESP8266.
DE: Wie man Fragen postet:
1. was hat man (Sketch und Hardware)
2. was SOLL es machen
3. was macht es: IST (Fehlverhalten, Fehlermeldungen, Serial.Output ...)
4. Eine Frage stellen bzw. erklären was man erwartet

Go Up