Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 4.92 KB

README.md

File metadata and controls

94 lines (66 loc) · 4.92 KB

Sensorbox-2

Sensorbox2 measures the current(A) and current direction for up to three phases with CT's and a MAINS voltage input. It can also receive these measurements directly from a (D)SMR5 smart meters P1 port. These measurements are then sent every two seconds to the connected SmartEVSE(s).

The Sensorbox2 uses a PIC microcontroller which does the CT measurements and sends this information to the ESP32. The ESP32 processes the P1 port (Smart Meter connection) data and RS485 communication to the SmartESVE. The PIC will be (re)programmed by the ESP32 module. At powerup the ESP32 looks for a PIC18F26K40.hex file in the /data folder and, when found programs the PIC18F26K40 microcontroller.

Upgrading firmware

Versions 2.1.0 and higher have wifi, webserver and MQTT active on your Sensorbox-2; it all works similarly to the SmartEVSEv3. To upgrade from your old, non-wifi Sensorbox-2 firmware, upgrade your SmartEVSE firmware to version v3.7.2 or higher.

Once your SmartEVSEv3 detects your Sensorbox-2's old firmware, it will present the LCD screen with a new option: SB2 WIFI, with default . Select , the Sensorbox will presents itself as a Wifi Acces Point "smartevse-xxxx"; the password is shown on the LCD screen. Connect with your phone to that access point, go to http://192.168.4.1/ and configure your Wifi password.

THIS IS A ONE TIME OPERATION!

After you updated your Sensorbox-2 to v2.1.0 or higher, this function will not work anymore, and it will not be shown in your SmartEVSEv3 menu. You are supposed to update your firmware through the /update page on the Sensorbox-2 webserver, or through the ESPtouch or USB procedure as described in the SmartEVSEv3 docs.

Modbus Registers

Modbus RTU address is fixed to 0x0A, speed is 9600 bps

Input Registers (FC=04)(Read Only):

Register  Register  
 Address   length (16 bits)
 0x0000      1       Sensorbox version 2             = 0x0114 (2 lsb mirror the 3/4 Wire and Rotation configuration data)
                                                       0x0115 = 4 wire, CCW rotation
                                                       0x0116 = 3 wire, CW rotation      
                                                       0x0117 = 3 wire, CCW rotation  
 0x0001      1       DSMR Version(MSB),CT's or P1(LSB) 0x3283 = DSMR version 50, P1 port connected (0x80) CT's Used (0x03)                    
 0x0002      2       Volts L1 (32 bit floating point), Smartmeter P1 data
 0x0004      2       Volts L2 (32 bit floating point), Smartmeter P1 data
 0x0006      2       Volts L3 (32 bit floating point), Smartmeter P1 data
 0x0008      2       Amps L1 (32 bit floating point), Smartmeter P1 data
 0x000A      2       Amps L2 (32 bit floating point), Smartmeter P1 data
 0x000C      2       Amps L3 (32 bit floating point), Smartmeter P1 data
 0x000E      2       Amps L1 (32 bit floating point), CT imput 1
 0x0010      2       Amps L2 (32 bit floating point), CT input 2
 0x0012      2       Amps L3 (32 bit floating point), CT input 3
 
 with sensorbox software version >= 0x01xx, the following extra registers are available

 0x0014      1       WiFi Connection Status  xxxxxACL xxxxxxWW = WiFi mode (00=Wifi Off, 01=On, 10=portal started)
                                                  ||\_ Local Time Set
                                                  |\__ Connected to WiFi
                                                  \___ AP_STA mode (portal) active
 0x0015      1       Time Hour(msb) Minute(lsb)
 0x0016      1       Time Month(msb) Day(lsb)
 0x0017      1       Time Year(msb) Weekday(lsb)
 0x0018      2       IP address Sensorbox
 0x001A      2       MAC Sensorbox (4 LSB bytes) http://SmartEVSE-012345.local can be derived from this
 0x001C      4       Password portal (8 bytes)


Holding Registers (FC=06)(Write):

 Register  Register  
 Address   length (16 bits) 
 0x0800      1       Field rotation setting (bit 0)      00000000 0000000x -> 0= Rotation right 1= Rotation Left
                     3/4 wire configuration (bit 1)      00000000 000000x0 -> 0= 4Wire, 1= 3Wire
 0x0801      1       Set WiFi mode                       00000000 000000xx -> 00 = disabled, 01 = enabled, 02 = start portal.   

Example:

Request Sensorbox2 data:
0a 04 00 00 00 14 f1 7e

Sensorbox2 replies with:
0a 04 28 00 14 32 83 43 66 80 00 43 66 4c cd 43 69 19 9a 3e 12 9a 61 3f 9f 83 80 be 41 4a 5a 3b ea 00 3b bb 6f f3 6b 3a 45 8d e3 ca cb
4 wire CW --^^
DSMR ver(50) --^^
P1 + CT connected ^^
Volts L1 ------------| 230.5 V  |			 
					 
Request 3 wire grid setting:
0a 06 08 00 00 02 0b 10		

Next sensorbox2 data:
0a 04 28 00 16 32 03 43 66 e6 66 43 66 80 00 43 69 19 9a 3d 66 9c 53 3f 97 99 d2 be a2 8a 28 bb 59 73 10 bb 08 29 4d 3b 8f 23 79 ca e6 			 
------------^^ changed to 3 wire, CW setting.