Skip to content

Latest commit

 

History

History
925 lines (758 loc) · 32.4 KB

Edgebox-ESP-100-Arduino.md

File metadata and controls

925 lines (758 loc) · 32.4 KB
description title keywords image slug last_update
EdgeBox-ESP-100 Getting Start with Arduino
EdgeBox-ESP-100 Getting Start with Arduino
Edge
PLC Control
Control system
/Edgebox-ESP-100-Arduino
date author
03/10/2023
Peter Pan

Edgebox-ESP-100

EdgeBox-ESP-100 is an ESP32-based controller designed for lightweight automation solutions. It supports analog input, effectively monitoring and controlling in a remote environment, ideal for PID control loops, logic sequencing control, or a gateway with flexible wireless and field sensors expansion.

Besides EdgeBox-ESP-100, We also have the other 2 Edge products for different solutions in the Edge family, powered by Raspberry Pi. To help you understand the differences deeply and choose the most suitable part for your projects, please refer to the Seeed Studio Edge Series Page.

It offers isolated CAN, RS485 Fieldbus connections, and rich IO resources for extensive facilities and sensors input, for both digital and analog signals. It is perfectly satisfactory to the PLC and field automation applications.

Since it contains on-chip Wi-Fi and BLE functions, and also includes a 4G LTE module Cellular, EdgeBox-ESP-100 can be utilized to establish an industrial gateway, enabling the original PLC to connect the network or cloud.

This portable box comes with rugged hardware, an electrical design, and an aluminum alloy enclosure, by which it maintains its function in a wide temperature range and provides high surge and short circuit protection, for diverse deployment methods based on your business.

Features

  • Multi-Fieldbus Support: CAN, RS485, Ethernet
  • Multi-wireless Capability: On-chip Wifi, BLE connectivity; built-in Cellular 4G LTE module
  • Reliable Hardware Design: Rugged, maintenance-reduced structure
  • Reliable Electrical Design: High isolation, High surge, and short circuit protection
  • IEC 61131-3 compliant programs support (under development)
  • Programmable with ESP-IDF, Arduino

Specifications comparison

Parameters

Detail

Basic

CPU

ESP32S3

Memory

512KB + 8MB RAM

Storage

16MB Flash

Wireless

WiFi

on-chip 2.4 GHz

Bluetooth

on-chip Bluetooth 5.0, BLE

Cellular

4G - A7670G SIMCom LTE Cat 1 module

LoRa

Supported*

Interface

Ethernet

100M RJ45 *1

USB

USB2.0 A*1

CAN BUS

CAN BUS *1 (Isolated)

RS Serial

RS485 *1 (Isolated)

Digital Input

4 (Isolated) onboard

DC input Voltage - 24V

Digital Output

6 (isolated)

Recommended Voltage - 24V

Analog Input

4 (Isolated)

Input: 0 ~ 20 mA default, 0-10V optional

Analog Output

2 (Isolated)

Output: 0 ~ 5 V

Power Supply

10.8 ~ 36 V

Extra features

RTC

RTC

Encryption Chip

Atecc608a(optional)

Operation temperature

-20 to +60 °C

Certification

RoHS, CE, FCC, UKCA

Warranty

2 Years

Hardware overview

Front Overview

Side Ports

  1. 4 X LEDs
  2. Ethernet Port
  3. CAN bus and RS485 Port
  4. Multi-Func phoenix connector

LED Indicator:

LED Name Signal Description
PWR Power Status
Cellular 4G/LTE
ACT Serial TX status Multiplexed with U0TXD
ERR Serial RX status Multiplexed with U0RXD

Ethernet Port:

pir
PIN# Signal Description
1 TXP
2 TXN
3 RXP
4 N.C.
5 N.C.
6 RXN
7 N.C.
8 N.C.
Yellow LED ACTIVE Active when TX and RX data come through
Green LED LINK Active when LINK UP

CAN bus and RS485 Port:

pir
PIN# Signal Description
1 N.C.
2 N.C.
3 N.C.
4 CAN_H
5 CAN_L
6 N.C.
7 RS485_A
8 RS485_B
Yellow LED ACTIVE Active when TX and RX of CAN BUS data come through
Green LED LINK Active when TX and RX of RS485 data come through

:::note

1. The 120 Ohm termination resistor for RS485 has been installed inside.
2. The 120 Ohm termination resistor for CAN BUS has been installed inside.

:::

Multi-Func phoenix connector

pir
Fucntion PIN No. PIN No. Fucntion
S/S 2 1 DO_24V
DI0 4 3 DO_0V
DI1 6 5 DO0
DI2 8 7 DO1
DI3 10 9 DO2
AGND 12 11 DO3
AI0 14 13 DO4
AI1 16 15 DO5
AI2 18 17 AO0
AI3 20 29 AO1
AGND 22 21 AGND
GND 24 23 +24V

:::note 1. 24AWG to 16AWG cable are suggested 2. GND and AGND are isolated 3. All AGND signals are connected internally 4. DC voltage for input is 24V(+- 10%) 5. DC voltage for output should be 24V(+- 10%). the current capacity is 1A. :::

TOP Ports

pir
  1. Wi-Fi Antenna Port (SMA Female)
  2. SIM CARD
  3. Reset
  4. USB PORT (5V power output only)
  5. 4G/LTE Antenna Port (SMA Female)

GPIO Multiplex

Pin Name ESP32S3 IO Type Function
DO0 IO40 Digital Output Digital Output 0
DO1 IO39 Digital Output Digital Output 1
DO2 IO38 Digital Output Digital Output 2
DO3 IO37 Digital Output Digital Output 3
DO4 IO36 Digital Output Digital Output 4
DO5 IO35 Digital Output Digital Output 5
DI0 IO4 Digital Input Digital Input 0
DI1 IO5 Digital Input Digital Input 1
DI2 IO6 Digital Input Digital Input 2
DI3 IO7 Digital Input Digital Input 3
AO0 IO42 Analog Output Analog Output 0
IO41 Analog Output Analog Output 1
RS485 IO17 U1TXD
IO18 U1RXD
IO8 RS485_RTS
4G/LTE IO48 U2TXD WWAN
IO47 U2RXD
IO21 PWR_KEY
IO16 PWR_EN
Ethernet IO10 FSPI_CS0 Connected to W5500
IO11 FSPI_MISO
IO12 FSPI_MOSI
IO13 FSPI_SCLK
IO14 INT #
IO15 RST #
CAN_TXD IO1 CAN BUS TX
CAN_RXD IO2 CAN BUS RX
TXD0/LED_ACT# U0TXD Programming/Debug and LED driver
RXD0/LED_ERR# U0RXD
Beep IO45 Beep High active Enables Buzzer
Reset IO0 Reset button
I2C IO19 I2C_SCL
IO20 I2C_SDA
IO9 Alarm or Wake up from PCF8563

Programming/Debug port

pir
Debug port ESP32 IO Other Function
RXD RXD0 LED_ACT#
TXD TXD0 LED_ERR#
GND GND
GPIO0 IO0 RESET Button

:::note

The GIPIO0 is also connected to the Reset Button. And the RXD, TXD of UART0 are used in download mode. These allow the users to develop the EdgeBox-ESP-100 in bare meta.

:::

Built-in Devices

I2C PIN Map & Built-in I2C Devices

  • I2C PIN Map:
I2C PIN ESP32 IO
I2C_SDA IO20
I2C_SCL IO19
I2C_INT IO9
  • Built-in I2C Devices and Address:
Device Address Function
FM24CL64B 0x50 Retain memory
PCF8563 0x51 RTC
Atecc608a 0x68 Crypto device
SGM58031 0x48 ADC

4G LTE

pir
A7670G 4G module ESP32 IO Function
PWR_EN IO16 Enable power for A7670G through SY8089A
PWRKEY IO21 PWR_KEY
RXD IO48 U2TXD
TXD IO47 U2RXD

Analog Input (SGM58031)

SGM58031 (I2C address 0x48) IO
CH1+ AI0
CH2+ AI1
CH3+ AI2
CH4+ AI3
SDA IO20/I2C_SDA
SCL IO19/I2C_SCL

:::note

The default input type is 4-20ma. 0-10V Input type is optional.

:::

Analog Output

The dual Analog Output channels are made up by PWM and LPF technology.

Analog output ESP32 IO
AO0 IO42
AO1 IO41

Electrical specifications

How-to Power

pir

Power consumption

The power consumption of the EdgeBox-ESP-100 strongly depends on the application, the mode of operation and the peripheral devices connected. The given values have to be seen as approximate values.

:::note

On condition of power supply 24V

:::

Mode of operation Current(ma)
Idle 81

Getting started with Ardunio Programming

Requirement

Hardware requirement

You need to prepare the following:

  • 1 x EdgeBox-ESP-100
  • 1 x PC
  • 1 x USB to Serial Adopter
  • 1 x PH2 Phillips head Screwdriver (Optional)
  • 1 x Allen Key H2.5
  • 1 x 12V3A(Minimun input power requirement) Power supply

Software requirement

Preparation

Hardware

  • STEP 1: Remove the case and locate the Programming port

  • STEP 1-1: Please locate and remove the two black allen socket head screws

pir
  • STEP 1-2: Then remove the 3 M.3 PH2 Phillips head screws.
pir
  • STEP 1-3: Now you should be able to locate the Programming port.
pir
  • STEP 2: connect the USB-to-Serial to the Edgebox-ESP-100

The connection should follow as below

pir

:::caution

Make sure the connection is right, Edgebox-ESP-100 is powered off during the connection.

:::

Edgebox-ESP-100 USB-To-Serial
RXD TX
TXD RX
GND GND
GPIO0 GND (Program Download mode)
Unconnected when used as serial debugger

Software

  • STEP 1: Download the Ardunio IDE 2.0.X from the Arduino offical website and then install it.

  • STEP 2: Find and Install ESP32 from the board manager.

  • STEP 2-1: Open the Arduino IDE and click the Board Tab (Second tab) to open the Board Manager

  • STEP 2-2: In the Search Bar please type in ESP32 and press enter, now you should be able to see the esp32 board library listed.

  • STEP 2-3: Select the latest Version from the verion dropdown manu, e.g. at the time this wiki is written the latest verion is version 2.0.7

:::note

Please install version >= 2.0.7 of the esp32 board library.

:::

  • STEP 2-4: Click Install
pir

Edgebox-ESP-100 Controlling Solenoid with Arduino

Wiring diagram

pir

Code

Here is the code for cycling through all the Solenoid, Please copy the code to the Arduino IDE Code editor

void setup() {
  //setup DO pins to output mode
  pinMode(DO0, OUTPUT);
  pinMode(DO1, OUTPUT);
  pinMode(DO2, OUTPUT);
  pinMode(DO3, OUTPUT);
  //setup DO pins default to Logic LOW
  digitalWrite(DO0, LOW);
  digitalWrite(DO1, LOW);
  digitalWrite(DO2, LOW);
  digitalWrite(DO3, LOW);
}

void loop() {
  //Switch on DO0 and Swith off DO3
  digitalWrite(DO0, HIGH);
  digitalWrite(DO3, LOW);
  delay(2000);

  //Switch on DO1 and Swith off DO0
  digitalWrite(DO0, LOW);
  digitalWrite(DO1, HIGH);
  delay(2000);

  //Switch on DO2 and Swith off DO1
  digitalWrite(DO1, LOW);
  digitalWrite(DO2, HIGH);
  delay(2000);
  
  //Switch on DO3 and Swith off DO2
  digitalWrite(DO2, LOW);
  digitalWrite(DO3, HIGH);
  delay(2000);
}

Upload code

  • STEP 1: Now please plug-in the USB-To-Serial adptor your PC and the connection of Edgebox-ESP-100 with USB-To-Serial convertor should set to download program mode.

:::note

Do not Power Up the Edgebox-ESP-100 until next step

:::

  • STEP 2: Power up the Edgebox-ESP-100

  • STEP 3: Select Board and PORTS

  • STEP 3-1: Open the Board and Port selection window

pir
  • STEP 3: Select Boards and PORTS from the Board and Port selection window in this case we can put edgebox into the search bar and select Edgebox-ESP-100 as the board, and select Port according to your USB-to-Serial adaptor. Then press OK to comfirm.
pir
  • STEP 4: Press upload code button to upload the code.
pir
  • STEP 5: reset Power to monitor the Edgebox-ESP-100 controlling Solenoid.
pir

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.