Skip to main content

Posts

Showing posts from September, 2018

Why ADC value of the Arduino is 0-1023?

Why ADC value of  the Arduino is 0-1023? Analog Signal In this article, it will be explained that why Arduino board reads the ADC value (0-5V) is 0 - 1023. (see more  Arduino - AnalogRead ) Because IC chip of Arduino Board (Uno, leonardo, Mega2560, etc.). Can read ADC values up to 10 bits or 2 ^ 10 = 1024*  So the analog value on the Arduino board is 0 - 1023 (no unit). For some Arduino boards, such as Due, M0, MRK1X00, etc., the ADC (0-3.3V) can be read in 12 bit or 2 ^ 12 = 4096 level (resolution is 8,10,12 bits. See more ) ADC from Voltmeter vs. Arduino Board (10 bit) Comparison table with ADC (10 bits) After understanding the comparison. You can use the Arduino board to read the ADC values and write a program to compare ADC value to voltage. see more  Arduino - Analog Read Voltage  To apply for Other Applications.

ทำไมค่า ADC ของบอร์ด Arduino ถึงมีค่า 0-1023

ทำไมค่า ADC ของบอร์ด Arduino ถึงมีค่า 0-1023 สัญญาณแอนะล็อก ในบทความนี้จะเป็นการอธิบายว่าบอร์ด Arduino เวลาอ่านค่า ADC (ค่าแอนะล็อก 0-5V) ค่าที่ได้คือ 0 - 1023 ดูการใช้งานการอ่านค่าอนาล็อกเพิ่มเติมได้ที่  Arduino กับการอ่านค่าแอนะล็อก    สาเหตุมาจากไอซีของบอร์ด Arduino (Uno, leonardo, Mega2560, อื่นๆ) มีความสามารถในการอ่านค่า ADC ได้ละเอียดสุด 10 บิต หรือ 2^10 = 1024 ระดับ* ทำให้ค่าแอนะล็อกที่บอร์ด Arduino อ่านได้ มีค่า 0 - 1023 (ไม่มีหน่วย) * สำหรับบอร์ด Arduino บางรุ่น เช่น Due, M0, MRK1X00, etc. จะสามารถอ่านค่า ADC (0-3.3V) ได้ละเอียดสุด 12 บิต หรือ 2^12 = 4096 ระดับ (สามารถกำหนดความละเอียดเป็น 8,10,12 บิตได้ ดูเพิ่มเติม ) ADC จากโวลต์มิเตอร์เทียบกับบอร์ด Arduino (10 บิต) ตารางเทียบค่าความต่างศักย์กับค่า ADC (10 บิต) หลังจากเข้าใจการเปรียบเทียบเเล้ว สามารถใช้บอร์ด Arduino อ่านค่า ADC เเล้วเขียนโปรเเกรมเพื่อเปรียบเทียบค่าเเอนะล็อกที่อ่านได้ไปเป็นค่าความต่างศักย์  ดูเพิ่มเติมได้จากบทความ  Arduino กับการอ่านค่าความต่างศักย์   เพื่อประยุกต์ใช้งานในงานอื่นๆ ต่อไป 

Arduino - Analog Read Voltage

Arduino - Analog Read Voltage Analog Signal This article is a continuation of  Arduino - AnalogRead , read analog signal from potentiometer same old article, but this article add calculate ADC from 0 - 1023 to 0-5volt Voltage = Analog value * (5.0/1023) Arduino board read analog value from potentiometer Example Program After uploading the program onto the Arduino board, see the results of running the program from Serial Monitor or Serial Plotter. Serial Monitor  Serial Plotter

Arduino กับการอ่านค่าความต่างศักย์

Arduino กับการอ่านค่าความต่างศักย์ สัญญาณอนาล็อก ในบทความนี้จะเป็นบทความต่อเนื่องจาก บทความ Arduino กับการอ่านค่าแอนะล็อก โดยจะอาศัยหลักการอ่านค่าแอนะล็อกมาจากตัวต้านทานปรับค่าได้เหมือนกัน แต่จะเพิ่มการคำนวนโดยแปลงค่าแอนะล็อกที่อ่านได้จาก 0-1023 กลับไปเป็นค่าความต่างศักย์ 0-5V วิธีการแปลงค่าแอนะล็อกเป็นค่าความต่างศักย์สามารถทำได้โดยการหาค่าที่ละเอียดที่สุดของบอร์ดที่สามารถอ่านได้จากนั้นนำไปคูณกับค่าแอนะล็อกของบอร์ดที่สามารถอ่านได้ หรือใช้สูตร ความต่างศักย์ = ค่าแอนะล็อกที่บอร์ดอ่านได้ * 5 / 1023 Arduino อ่านค่าแอนะล็อกจากตัวต้านทานปรับค่าได้ ตัวอย่างโปรแกรมที่ใช้ หลังจากอัพโหลดโปรเเกรมลงบนบอร์ด  Arduino  ดู ผลลัพธ์การรันโปรแกรมได้จาก Serial Monitor หรือ Serial  Plotter Serial Monitor Serial Plottor

Arduino - AnalogRead

Arduino - AnalogRead Analog Signal What is Analog Signal? Analog Signal is a continuous signal. It is different from the discrete digital signal. Analog signal are use for electronic system, mechanical, hydraulic, and other system. Arduino board specifications (in this case use Arduino Uno Board): Read analog value from 0-5V. 10-bit resolution (0-1023) Readable resolution 5V/1024 = 0.0049V (4.9mV) It takes about 100 microseconds / 1 time In this article, you will lean how to use Arduino boards to read analog signals. Using the Arduino board to read the analog signal from potentiometer.  Arduino board read analog value from potentiometer Example Program After uploading the program onto the Arduino board, see the results of running the program from Serial Monitor or Serial Plotter. Serial Monitor  Serial Plottor

Arduino กับการอ่านค่าแอนะล็อก

Arduino กับการอ่านค่าแอนะล็อก สัญญาณอนาล็อก สัญญาณแอนะล็อก คือ สัญญาณที่มีลักษณะต่อเนื่อง โดยมีลักษณะแตกต่างกับ สัญญาณดิจิทัล ที่มีลักษณะไม่ต่อเนื่อง สัญญาณแอนะล็อกใช้งานกับระบบ อิเล็กทรอนิกส์  รวมถึง ระบบเครื่องกล ไฮดรอลิก และระบบอื่น ๆ ขีดความสามารถของบอร์ด Arduino (ในตัวอย่างนี้ใช้บอร์ด Arduino Uno) อ่านค่าแอนะล็อกได้ตั้งแต่ 0-5V ความละเอียด 10 บิต (0-1023) ความละเอียดที่สามารถอ่านได้ 5V/1024 = 0.0049V (4.9mV) ใช้เวลาในการอ่าน 100 ไมโครวินาทีในการอ่านค่า 1 ครั้ง ในบทความนี้จะเป็นตัวอย่างการใช้งานบอร์ด Arduino ในการอ่านค่าสัญญาณแอนะล็อก โดยให้บอร์ด Arduino อ่านค่าสัญญาณแอนะล็อกจากตัวต้านทานปรับค่าได้โดยใช้วงจรดังนี้ Arduino อ่านค่าแอนะล็อกจากตัวต้านทานปรับค่าได้ ตัวอย่างโปรแกรมที่ใช้ หลังจากอัพโหลดโปรเเกรมลงบนบอร์ด  Arduino  ดู ผลลัพธ์การรันโปรแกรมได้จาก Serial Monitor หรือ Serial  Plotter Serial Monitor Serial Plottor

Arduino - Button

Arduino - Button Button And Switch This article will give an example how to use Arduino board with a switch. The Arduino board reads the digital status of the switch as an input to execute an your functions. There are two types of switching circuits. pull-up (Normally the status is '1', If you press the button status is set to '0') pull-down (Normally the status is '0', If you press the button status is set to '1') Switching circuit, pull-down In this article, we will select a pull-up circuit ( Normally the status is '1', If you press the button   status is set to '0' ) Example. pull-up circuit switch Example Program Arduino has special functions for internal pull-up circuits. So we can use only switch. (Must be declared as INPUT_PULLUP) Internal pull-up circuit switch Example Program After uploading the program onto the Arduino board, see the results of running the program from Serial Monitor o

Arduino กับการใช้งานสวิทซ์

Arduino กับการใช้งาน ปุ่มกด สวิตซ์แบบต่างๆ ในบทความนี้จะเป็นตัวอย่างการใช้งานบอร์ด Arduino กับสวิตซ์ โดยให้บอร์ด Arduino อ่านค่าสถานะทางดิจิทัลของสวิตซ์เพื่อเป็นอินพุตไปสั่งงานฟังก์ชันต่างๆ ตามที่ผู้ใช้ต้องการ สำหรับวงจรในการต่อสวิตซ์นั้นจะมีอยู่ 2 แบบคือ  แบบ  pull-up (โดยปกติสถานะจะมีค่าเป็น '1' แต่ถ้ากดปุ่ม สถานะจะมีค่าเป็น '0') แบบ  pull-down  (โดยปกติสถานะจะมีค่าเป็น '0' แต่ถ้ากดปุ่ม สถานะจะมีค่าเป็น '1') วงจรสวิตซ์แบบ pull-up, pull-down สำหรับในบทความนี้จะต่อวงจรแบบ  pull-up ( โดยปกติมีค่าเป็น '1' แต่ถ้ากดปุ่มจะมีค่าเป็น '0' ) โดยตัวอย่างการต่อมีดังนี้ ต่อสวิตซ์แบบ pull-up ตัวอย่างโปรแกรมที่ใช้ แต่ภายใน บอร์ด Arduino  มีฟังก์ชันพิเศษสำหรับใช้งานวงจร  pull-up ภายใน ดังนั้นจึงสามารถ ต่อเพียงเเค่สวิตซ์ได้ (แต่ต้องมีการประกาศเป็น INPUT_PULLUP) ต่อสวิตซ์โดยใช้วงจร pull-up ภายใน ตัวอย่างโปรแกรมที่ใช้ หลังจากอัพโหลดโปรเเกรมลงบนบอร์ด  Arduino  ดู ผลลัพธ์การรันโปรแกรมได้จาก Serial Mo