ESP8266: Adafruit VEML6070 I2C Test

ESP8266: Adafruit VEML6070 I2C Test

 

ESP8266: Adafruit VEML6070 I2C Test
ESP8266: Adafruit VEML6070 I2C Test


Connection:

– NodeMCU GPIO0 -> D1 -> SCL (VEML6070)
– NodeMCU GPIO4 -> D2 -> SDA (VEML6070)
– NodeMCU +3.3 -> 3V3 -> VCC (VEML6070)
– NodeMCU GND -> GND -> GND (VEML6070)

Arduino code:

#include <Wire.h>
#include "Adafruit_VEML6070.h"

Adafruit_VEML6070 uv = Adafruit_VEML6070();

void setup() {
Serial.begin(9600);
Serial.println("VEML6070 Test");
uv.begin(VEML6070_1_T); // pass in the integration time constant
}


void loop() {
Serial.print("UV light level: "); Serial.println(uv.readUV());

delay(1000);
}

 

ESP8266: Adafruit VEML6070 I2C Test
ESP8266: Adafruit VEML6070 I2C Test

 

ESP8266: Adafruit VEML6070 I2C Test
ESP8266: Adafruit VEML6070 I2C Test

 

 

 

ESP8266: HT-16k33 7 Segment I2C Test

 

ESP8266: HT-16k33 7 Segment I2C Test

ESP8266: HT-16k33 7 Segment I2C Test
ESP8266: HT-16k33 7 Segment I2C Test

 

 

Connection:

– NodeMCU GPIO0 -> D1 -> SCL (HT-16k33)
– NodeMCU GPIO4 -> D2 -> SDA (HT-16k33)
– NodeMCU +3.3 -> 3V3 -> VCC (HT-16k33)
– NodeMCU GND -> GND -> GND (HT-16k33)

 

Library:

https://github.com/adafruit/Adafruit_LED_Backpack 

 

Arduino code:

/*************************************************** 
This is a library for our I2C LED Backpacks

Designed specifically to work with the Adafruit LED 7-Segment backpacks 
----> http://www.adafruit.com/products/881
----> http://www.adafruit.com/products/880
----> http://www.adafruit.com/products/879
----> http://www.adafruit.com/products/878

These displays use I2C to communicate, 2 pins are required to 
interface. There are multiple selectable I2C addresses. For backpacks
with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
with 3 Address Select pins: 0x70 thru 0x77

Adafruit invests time and resources providing this open source code, 
please support Adafruit and open-source hardware by purchasing 
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries. 
BSD license, all text above must be included in any redistribution
****************************************************/

// Enable one of these two #includes and comment out the other.
// Conditional #include doesn't work due to Arduino IDE shenanigans.
#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
//#include <TinyWireM.h> // Enable this line if using Adafruit Trinket, Gemma, etc.

#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

Adafruit_7segment matrix = Adafruit_7segment();

void setup() {
#ifndef __AVR_ATtiny85__
Serial.begin(9600);
Serial.println("7 Segment Backpack Test");
#endif
matrix.begin(0x70);
}

void loop() {


// print a hex number
matrix.print(0xBEEF, HEX);
matrix.writeDisplay();
delay(500);

// print a floating point 
matrix.print(12.34);
matrix.writeDisplay();
delay(500);

// print with print/println
for (uint16_t counter = 0; counter < 9999; counter++) {
matrix.println(counter);
matrix.writeDisplay();
delay(10);
}

// method #2 - draw each digit
uint16_t blinkcounter = 0;
boolean drawDots = false;
for (uint16_t counter = 0; counter < 9999; counter ++) {
matrix.writeDigitNum(0, (counter / 1000), drawDots);
matrix.writeDigitNum(1, (counter / 100) % 10, drawDots);
matrix.drawColon(drawDots);
matrix.writeDigitNum(3, (counter / 10) % 10, drawDots);
matrix.writeDigitNum(4, counter % 10, drawDots);

blinkcounter+=50;
if (blinkcounter < 500) {
drawDots = false;
} else if (blinkcounter < 1000) {
drawDots = true;
} else {
blinkcounter = 0;
}
matrix.writeDisplay();
delay(10);
}
}

 

 

PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter

PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter


PKTH100B temperature and humidity sensor

 

PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter
PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

Rated voltage DC9V~DC30V
measuring range Temperature: -40 DEG C, ~120 DEG C
Humidity: 0 ~ 100%rh
measurement accuracy Temperature: + 0.3, resolution 0.1
Humidity: + 3%rh resolution 0.1 RH
Output interface RS485
Communication protocol MODBUS RTU
communicationaddress 1-247,
baud rate 1200 bit/s, 2400 bit/s, 4800 bit/s, 9600 bit/s, 19200 bit/s
Average power consumption <0.1W
Installation method Rail installation, interior wall mounting, ceiling mounting
Product size 65*46*29mm

 

PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter
PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter
PKTH100B temperature and humidity sensor 485 communication transmitter MODBUS RTU and KMtronic LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

 

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display

 

Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display

 

Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display
Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display

 

Pymodbus is a full Modbus protocol implementation using twisted for its asynchronous communications core.

 

import struct

from struct import *
from pymodbus.client.sync import ModbusTcpClient
# from pymodbus.client.sync import ModbusSerialClient as ModbusClient

import logging
logging.basicConfig()
log = logging.getLogger()
log.setLevel(logging.DEBUG)

// IP KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
host = '192.168.1.199'
port = 502

client = ModbusTcpClient(host, port)
# client = ModbusClient(method='rtu', port='/dev/ttyUSB0', timeout=1)
client.connect()


# First digital input address
address = 0
# Written value
value = 1221

# It will send '1221' to the output 
client.write_register(address, value, unit=1)

print "-----------------------------"

 

Output

kr@ubuntu-server:/var/www/html/python-test$ python ModBus-LED-Display.py
DEBUG:pymodbus.transaction:Current transaction state - IDLE
DEBUG:pymodbus.transaction:Running transaction 1
DEBUG:pymodbus.transaction:SEND: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x0 0x4 0xc5
DEBUG:pymodbus.client.sync:New Transaction state 'SENDING'
DEBUG:pymodbus.transaction:Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
DEBUG:pymodbus.transaction:Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
DEBUG:pymodbus.transaction:RECV: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x0 0x4 0xc5
DEBUG:pymodbus.framer.socket_framer:Processing: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x6 0x0 0x0 0x4 0xc5
DEBUG:pymodbus.factory:Factory Response[WriteSingleRegisterResponse: 6]
DEBUG:pymodbus.transaction:Adding transaction 1
DEBUG:pymodbus.transaction:Getting transaction 1
DEBUG:pymodbus.transaction:Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
-----------------------------
kr@ubuntu-server:/var/www/html/python-test$

 

Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display
Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display

 

Testing RS485 Serial Port Meter Red LED Display PLC Communication MODBUS-RTU / ASC

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter

RS485 Serial Port Meter Red LED Display PLC Communication MODBUS-RTU / ASC

 

 

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

KMtronic ModBus Test software
KMtronic ModBus Test software

 

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter
KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter

 

This software utility is written for testing Modbus slave devices. Modbus protocol exist for serial port (RTU) and for Ethernet (TCP). Modbus allows for communication between many devices connected to the same network. Free replacement for applications like ModScan, Modbus Poll etc. Support for Modbus TCP and Modbus RTU protocols. Modbus Master Simulator supports multiple Modbus slave devices.