This is an Arduino Mega compatible CPU module. It is designed to be used for GPIO, communication, ADC, NTC (temperature), etc.
* What is QWIIC? This is a product line of Arduino I2C peripherals sold by Sparkfun, USA. Reference link
The GPIO port is a port that can be used for 5V input/output or PWM output. In fact, it is the same as the I/O terminal on a regular Arduino. However, a TVS diode for surge blocking is installed internally.
The RS485 port assigned to Channel 3 is a port that uses the MAX13487 chip, which automatically switches the transmission and reception directions. Therefore, there is no need for users to handle sending/receiving directly.
Please connect a voltage between DC12 and 24V into one of the DC jack and terminal blocks. Determine the power capacity according to the total number of connected I/O modules. If there are less than five, 24V 1A is suitable. If it is more than that, choose a larger capacity.
- LED blinking : This is a program that blinks the LED.
const int StatusLED = 13; void setup() { pinMode(StatusLED, OUTPUT); } void loop() { digitalWrite(StatusLED, HIGH); delay(1000); digitalWrite(StatusLED, LOW); delay(1000); }
- ADC analog input: This is a program that receives current/voltage input.
void setup() { Serial.begin(9600); } void loop() { int ADI_mA = analogRead(A0); int ADI_DCV = analogRead(A5); Serial.print(" ADC_mA = "); Serial.print(ADI_mA) ; Serial.print("\r\n" ); Serial.print(" ADC_DCV = "); Serial.print(ADI_DCV); Serial.print("\r\n" ); delay(200); }
- NTC Temperature: NTC temperature measurement program. (Measurement range -40 ~ 99℃ / error +/-1 degree)
int16_t ntcRead_a4(void);
#include "CFMEGA.h" void setup() { Serial.begin(9600); } void loop() { int NTC_a4 = ntcRead_a4(); Serial.print(" TEMP = "); Serial.print(NTC_a4) ; Serial.print("\r\n" ); delay(1000); }
- RS232 communication: Eco communication program for channel 1 (Tx1, Rx1).
void setup() { Serial.begin(9600); Serial1.begin(9600); } void loop() { if (Serial1.available() > 0) { char rx_Byte = Serial1.read(); Serial.print("I received: "); Serial.print(rx_Byte); Serial1.print(rx_Byte); } }
If the total number of connected modules is 8 or less, a 24V, 1A SMPS is suitable. If the total number is 8 or more, use a 24V, 2A SMPS.