[EN] Using the DHT22/DHT11 Temperature and Humidity Sensor Module with ESP8266

This article uses the DHT22 and DHT11 temperature and humidity measurer modules with Python. They are sensor modules that operate using a single signal cable which will save the microcontroller’s port connection. In addition, MicroPython has a library prepared for DHT22 and DHT11 implementation, making it convenient, time-saving and reduce errors that may be caused by manual programming.

There are 3 examples in this article: code17-1 is a normal reading of values, but code17-2 is a loop to read again. By finding the highest and lowest values and display on the LCD module as shown in Figure 8 and example code17-3 showing the average value of temperature and humidity.

Figure 1 Result from code17-1
Read More

[EN] Binary Search Tree

This article is about programming C/C++ language with Arduino Nano, Arduino Uno, LGT8F328P [NANO F328P-C] and ET-BASE AVR EASY32U4 (Figure 1) or other boards and platforms using C language for learning to code another type of data structure management program that has different storage and management methods, called BST or Binary Search Tree, as in Figure 2, which is a structure that can be applied to collecting data with attributes in which the data on the left node is less than current node and the right node is greater than current node or the opposite, the left node is greater and the right noe is less. Thus, searching for data in the event that the tree is balanced both left and right on the BST structure saves time or number of searches per round by half of available data, for example, there are 100 data sets in the first round, if the current node is not what you’re looking for it, the choice left is to find from the left or right node. This selection causes the data of the other side to be ignored or cut it in half approximately but if the Binary Search Tree is unbalanced, the search speed will not be much different from the Sequential Search.

ET-BASE AVR EASY32U4
Figure 1 ET-BASE AVR EASY32U4
Read More

[EN] Doubly Linked-List

This article is about programming C/C++ language with Arduino Nano, Arduino Uno, LGT8F328P [NANO F328P-C], ET-BASE AVR EASY32U4 or other boards and platforms that use C language to store temperature/humidity data from the DHT11 sensor (Figure 1) with a dual linked list data structure. The basics of memory reservation, access, memory deallocation can be read in the previous article (Singly Linked List).

Figure 1 Arduino Uno and DHT11
Read More

[TH] Binary Search Tree

บทความนี้เป็นการเขียนโปรแกรมภาษา C/C++ กับบอร์ด Arduino Nano, Arduino Uno, LGT8F328P [NANO F328P-C] และ ET-BASE AVR EASY32U4 (ภาพที่ 1) หรือบอร์ดอื่น ๆ และแพล็ตฟอร์มอื่น ๆ ที่ใช้ภาษา C เพื่อเรียนรู้การเขียนโปรแกรมจัดการโครงสร้างข้อมูล (Data Structure) อีกประเภทหนึ่งซึ่งมีวิธีการจัดเก็บและจัดการที่แตกต่างกันไปอันมีชื่อว่าต้นไม้แบบ BST หรือ Binary Search Tree ดังในภาพที่ 2 ซึ่งเป็นโครงสร้างที่สามารถนำไปประยุกต์เกี่ยวกับการเก็บข้อมูลที่มีคุณลักษณะที่ข้อมูลทางกิ่งด้านซ้ายมีค่าที่น้อยกว่าตัวเอง และกิ่งด้านขวามีค่ามากกว่าต้นเอง หรือทำตรงกันข้ามคือกิ่งซ้ายมีค่ามากกว่า และกิ่งด้านขวามีค่าน้อยกว่า ทำให้การค้นหาข้อมูลในกรณีที่ต้นไม้มีความสมดุลย์ทั้งทางซ้ายและทางขวาบนโครงสร้าง BST ประหยัดเวลาหรือจำนวนครั้งในการค้นหาลงรอบละครึ่งหนึ่งของข้อมูลที่มี เช่น มีข้อมูล 100 ชุด ในรอบแรกถ้าตัวเองยังไม่ใช่ข้อมูลที่กำลังค้นหา จะเหลือทางเลือกให้หาจากกิ่งทางซ้ายหรือขวา ซึ่งการเลือกทำให้ข้อมูลของอีกฝั่งนั้นไม่ถูกพิจารณา หรือตัดทิ้งไปครึ่งหนึ่งโดยประมาณ แต่ถ้าเป็นกรณีที่ Binary Search Tree นั้นขาดความสมดุลย์จะส่งผลให้การค้นหามีความเร็วไม่แตกต่างกับการค้นหาแบบลำดับ (Sequential Search) เท่าใดนัก

ET-BASE AVR EASY32U4
ภาพที่ 1 บอร์ด ET-BASE AVR EASY32U4
Read More

[TH] Doubly Linked-List

บทความนี้เป็นการเขียนโปรแกรมภาษา C/C++ กับบอร์ด กับบอร์ด Arduino Nano, Arduino Uno, LGT8F328P [NANO F328P-C] และ ET-BASE AVR EASY32U4 หรือบอร์ดอื่น ๆ และแพล็ตฟอร์มอื่น ๆ ที่ใช้ภาษา C เพื่อจัดเก็บข้อมูลอุณหภูมิ/ความชื้นจากเซ็นเซอร์ DHT11 (ดังภาพที่ 1) ด้วยโครงสร้างข้อมูลแบบลิงค์ลิสต์คู่ โดยพื้นฐานของการจองหน่วยความจำ การเข้าถึง การยกเลิกการจองหน่วยความจำสามารถอ่านได้จากบทความก่อนหน้านี้ (Singly Linked List)

ภาพที่ 1 บอร์ด Arduino Uno และเซ็นเซอร์ DHT11
Read More

[EN] Queue data structure with array and Singly Linked List.

This article describes Queue Data Structures previously written in the Python Queue Data Structure article and is frequently used with the MicroPython example, but this article is written in C via Arduino IDE to use with microcontroller board LGT8F328P, SAM-D21, ESP8266, ESP32 and ESP32-S2 as shown in Figure 1 by using an example of the array structure and a single link list as a queued data structure. This article is probably the last article on JarutEx.

Figure 1 ESP32-S2, LGY8P326P and SAM-D21
Read More

[EN] Stack data structure with Singly Linked List.

This article describes a stack data structure to write programs in C on various platforms using a single linked list data structure as a stack data store with examples of the array as storage and test the operation with the microcontroller board LGT8F328P, SAM-D21, ESP8266, ESP32 and ESP32-S2 as shown in Figures 1 and 2. In case of wanting to use with other platforms, you can still modify the code for use such as the same.

Figure 1 ESP32, LGY8P326P and SAM-D21
Read More

[EN] Arduino: Control robot’s movement via browser with esp8266 Part 2

Based on the previous article that uses a single esp8266 for controlling the Agent, the number of pins that the esp8266 microcontroller (as written in the MicroPython article about machine.Pin) is limited. Many of the pins are used at boot up causing unintended errors such as the wheel spinning when the system starts and stops when the system finishes booting, etc. Therefore, in this article, a microcontroller board LGT8F328P is added as shown in Figure 1, or the reader may change to other Arduino family microcontrollers, such as Arduino Nano or Arduino Uno, etc. by giving that LGT8F328P is part of the Actuator that acts as a movement in the environment. It can be commanded to go forward, backward, turn left, turn right and stop, reducing the workload of the esp8266 and making it more responsive to WiFi communication.

Figure 1 LGT8F328P is integrated into a robotic car system to control the movement
Read More

[EN] Arduino: Control the movement of the robot car through the browser with the esp8266.

From the article Controlling a Servo 2-Wheel Robot in the ESP8266+RoboServo and the DC electric motor in VisionRobo Car: Drive Motor, we have taken the 2nd built-in robot car from the Raspberry Pi to the ESP8266 to operate via WiFi using the guidelines from the ESP-01s+Relay article. Let’s rewrite Arduino’s C/C++ with the WebServer class from the ESP8266 article to MicroPython. Thus, by the end of this article, the robot can be operated in the first example by connecting a phone or communication device. Go to 192.168.4.1 and order it to go forward, backward, turn left, turn right, or stop.

Figure 1 The robot in this article
Read More

[EN] Generate temperature and humidity graphs with data from Singly Linked List.

From the article Singly Linked List Data Structures, the use of the DHT11 sensor module with the STM32F103 microcontroller, and the use of the TFT display module based on the st7735s controller, the idea of this article is to take an example of using a singly linked list data structure to collect the temperature and humidity values to find the maximum, minimum, average, together with the data in the list to display in the form of a graph as shown in Figure 1.

Figure 1 Result of the article
Read More