VREL #6: Color Temperature and Brightness Compensation Laboratory

The laboratory is located at Silesian Technical University, Poland, Gliwice Akademicka 16, room 319.

Introduction

The lab consists of two light sources placed on top of the pyramid-shaped tower (figure 1). The tower is divided into two sections:

  • Bright side - opened to ambient light and simultaneously illuminated by LEDs
  • Dark side - only illuminated by LEDs

The user can experiment with controlling the brightness of LEDs and measuring the intensity and colour of the light.

Figure 1: Tower view

Prerequisites

The user needs to know:

Beginners:

  • Basic knowledge of ESP8266 NodeMCU v2,
  • ESP8266 Arduino programming,
  • Basic knowledge of I2C Interface,
  • Basic knowledge of I2C programming using Arduino I2C library,
  • Knowledge of PWM controller chip PCA9685,
  • Operation and method of PWM current control,

Undergraduates additionally:

  • Knowledge of PWM controller chip PCA9685,
  • Knowledge of I2C extender chip TCA9548A,
  • Knowledge of light sensor chip TCS34725,
  • Division of white light sources due to colour temperature,
  • Measure of light intensity,

Masters additionally:

  • Construction and operation of Cree Dynamic White LEDs,
  • Knowledge of PWM controller chip PCA9685,
  • Knowledge of I2C extender chip TCA9548A,
  • Knowledge of light sensor chip TCS34725,
  • Division of white light sources due to colour temperature,

Technical details

The main aim of the laboratory is to do different experiments with LED light. The user can start with simple PWM controlling of LED. Next, try to keep a constant level of brightness on a bright part of the model. The other aim is to keep the same level of lighting on a dark part of the model, as is on the bright side. The diagram of the main part is shown in figure 3, and diagram of LEDs connection is in figure 2

Figure 2: LEDs connections
Figure 3: Microcontroller with PWM and sensors.

Sensors

A camera gives a general view on the bright side of the tower, and the second camera at the bottom of the tower gives a view of how both parts of the ground are illuminated (bright and dark) ambient light and RGB sensors are used as sensors for measuring brightness and colour of light. The following devices are connected directly to the main I2C controller:

I/O Device I2C address Description
PCA9685A0x40hPWM LED controller
TCA9548A0x70hI2C Extender

In the system, there are three TCS34725 light sensors. Sensors have the same I2C addresses (0x29h) but are connected to different channels of I2C extender (TCA9548A). I2C extender address is 0x70h.

Remember to always select the appropriate multiplexer channel before referring to the correct light sensor
TCA9548A I2C channelSensors I2C AddressPositionInput/outputRemarks
Channel 0Sensor TCS34725 RGB - Main0x29hBottom of brightsideOutputMain sensor of mixed light
Channel 1Sensor TCS34725 RGB - DarkSide0x29hBottom of darksideOutputSensor of only LED light
Channel 2Sensor TCS34725 RGB - Ambient 0x29hTop of TowerOutputAmbient light sensor
Channel 3 - - Output N/C
Channel 4 - - Output N/C
Channel 5 - - Output N/C
Channel 6 - - Output N/C
Channel 7 - - Output N/C

Actuators

In the system, there are two CREE dynamic LEDs. Each consists of four LED structures with two cold-white and two warm-white lightning. First LED is placed on top of the bright/openside of the tower and the second LED is placed on top of the dark/close side. The each LEDs light intensity must be appropriately controlled using PWM current controller which is separate for every white colour of each LED. ( Each PWM channel controls two LED structures with identical light colour.) As PWM controller has been used a 16-channel PWM chip - PCA9685 (Address - 0x40H). PCA9685 is connected directly to the microcontroller's I2C master interface.

ActuatorPositionInput/outputRemarks
Channel 0 On the boardInputLED0/bright side warm-white
Channel 1 On the boardInputLED1/bright side cold-white
Channel 2 On the boardInputLED2/dark side warm-white
Channel 3 On the boardInputLED3/dark side cold-white
Channel 4 On the boardInputN/C
Channel 5 On the boardInputN/C
Channel 6 On the boardInputN/C
Channel 7 On the boardInputN/C
Channel 8 On the boardInputN/C
Channel 9 On the boardInputN/C
Channel 10 On the boardInputN/C
Channel 11 On the boardInputN/C
Channel 12 On the boardInputN/C
Channel 13 On the boardInputN/C
Channel 14 On the boardInputN/C
Channel 15 On the boardInputN/C

Software, libraries and externals

Platformio.ini
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
lib_deps = Wire, EmonLib, Adafruit NeoPixel, Encoder,DHT sensor library, 
Adafruit Unified Sensor, LCD, 
PubSubClient, KS0108_PCF8574, CoAP simple library

Communication

You can connect your ESP8266 microcontroller via its integrated WiFi interface to the separated IoT network. Then you can communicate with other, already connected devices and even provide some information to the cloud. In details, there is a dedicated MQTT broker waiting for you. You can also set up your own soft Access Point and connect another node directly to yours.

The communication among the devices can be done using MQTT messages, exchanging data among other nodes (M2M) and you can even push them to the Internet.

Using your Node, you can access it and publish/subscribe to the messages once you connect your ESP to the existing wireless network (this network does not provide access to the global internet and is separated but please note there are other developers and IoT nodes connected to this access point:

  • SSID: internal.IOT
  • Passkey: IoTlab32768
  • Setup your microcontroller for DHCP, to automatically obtain an IP address, your ESP will obtain the address from the 192.168.90.X pool.
  • MQTT server is available under the fixed address: 192.168.90.5, and the credentials to publish/subscribe are:
    • User: vrel
    • Password: vrel2018

Limits

At the same time, only one user can be programming the controller, although analysing the signal by others (unlimited number) the user has sense. Model is provided to work continuously, without service breaks.

Support

In case of problems contact: jaroslaw.paduch@polsl.pl

en/iot-open/remotelab/sut/color.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0