[EN] ESP8266+Soil Moisture Sensor

This article uses the ESP8266 to read the values ​​from the soil moisture sensor. The appearance of the selected sensor is shown in Figure 1. The circuit of the sensor is shown in Figure 2 which there’s a part for the conversion of resistance from current flow to analog and digital values. In which the digital sector has to be rotated to adjust the resistance from the variable resistor. After that, the voltage obtained by adjusting the resistance is used as a comparator of the voltage obtained by the sensor circuit and output the data as a digital signal as a value of 0 or 1, but in this article choose to read the value from analog signal via A0, which is 10 bits analog to digital converter (ADC) consequently the value read from analog signal will be integer start from 0 to 1024. The example program is written in Python along with showing the converted values ​​from the ADC displayed on the web page.

Read More

[TH] ESP8266+Soil Moisture Sensor

บทความนี้เป็นการนำ ESP8266 มาใช้อ่านค่าจากเซ็นเซอร์ความชื้นของดิน ซึ่งหน้าตาของเซ็นเซอร์ที่เลือกใช้เป็นดังภาพที่ 1 โดยวงจรของการทำงานตามภาพที่ 2 จะมีส่วนของการแปลงความต้านทานจากการไหลของกระแสไฟเป็นค่าแบบแอนาล็อกและดิจิทัล ซึ่งในภาคของดิจิทัลนั้นต้องทำการหมุนเพื่อปรับค่าความต้านทานจากตัวต้านทานปรับค่าได้ หลังจากนั้นค่าแรงดันที่ได้จากการปรับค่าความต้านทานจะถูกใช้เป็นตัวเปรียบเทียบแรงดันที่ได้รับจากวงจรเซ็นเซอร์ และนำออกข้อมูลเป็นสัญญาณดิจิทัลเป็นค่า 0 หรือ 1 แต่ในบทความนี้เลือกใช้การอ่านค่าจากสัญญาณแอนาล็อกผ่านเข้าทางขา A0 ซึ่งเป็นภาคแปลงสัญญาณแอนาล็อกเป็นดิจิทัล (ADC: Analog to Digital Converter) ขนาด 10 บิต ทำให้อ่านค่าแรงดันที่ได้รับเป็นค่าจำนวนเต็มในช่วง 0 ถึง 1024 โดยตัวอย่างโปรแกรมเขียนด้วยภาษาไพธอน พร้อมแสดงค่าที่แปลงจาก ADC แสดงผ่านเว็บ

Read More