Friday, November 29, 2019

16 Million Colour generation by using MQTT protocol



 The mixing of colours has always been an intriguing phenomenon in the field of science. This project mainly deals with colour models. Using only three colours namely red, green and blue (RGB) we produce over 16 million variety of colours. Here, I showed how a simple communication protocol like MQTT can be used to manipulate the remotely placed light emitting sources to display the beauty of the world. I use ‘Node MCU’, an open source LUA based firmware for the purpose of communication between the clients. The goal of this project is to show how we can establish the communication from broker to clients by using a lightweight messaging protocol. The applications of this project is vast as all the digital systems use RGB displays. Also, a significant texture to the photographs, video graphs and arts has been provided by the RGB models.


Problem Statement
 A digital monitor or digital displays are made up of tiny units called pixels. These pixels are comprised of three light units, one for red, one for green, and one for blue. We can’t use CMYK models. So, here I'm defining a technique to mix these colours well-known as RGB colour model.




Objective of the project
The main purpose of the RGB colour model is for the sensing, representation, and display of images in electronic systems, such as televisions and computers, though it has also been used in conventional photography. Before the electronic age, the RGB colour model already had a solid theory behind it, based in human perception of colours.



The RGB colour model mapped to a cube. The horizontal x-axis as red values increasing to the left, y-axis as blue increasing to the lower right and the vertical z-axis as green increasing towards the top. The origin, black is the vertex hidden from view. It also deals with the colour management.
The primary goal of colour management is to obtain a good match across colour devices; for example, the colours of one frame of a video should appear the same on a computer LCD monitor, on a plasma TV screen, and as a printed poster. Colour management helps to achieve the same appearance on all of these devices, provided the devices are capable of delivering the needed colour intensities.

Description of communication protocol used



MQTT stands for MQ Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks. The design principles are to minimise network bandwidth and device resource requirements whilst also attempting to ensure reliability and some degree of assurance of delivery. These principles also turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected devices, and for mobile applications where bandwidth and battery power are at a premium.
The MQTT protocol defines two types of network entities: a message broker and a number of clients. An MQTT broker is the server that receives all messages from the clients and then routes the messages to the appropriate destination clients. An MQTT client is any device (from a micro controller up to a full-fledged server) that runs an MQTT library and connects to an MQTT broker over a network.


About Node MCU


NodeMCU is an open source IoT platform. It includes firmware. The term "NodeMCU" by default refers to the firmware rather than the development kits. The firmware uses the Lua scripting language. It is based on the eLua project. NodeMCU is able to support the MQTT IoT protocol, using Lua to access the MQTT broker. A microcontroller (MCU for microcontroller unit) is a small computer on a single metal-oxide-semiconductor (MOS) integrated circuit chip. Some microcontrollers may use four-bit words and operate at frequencies as low as 4 kHz, for low power consumption (single-digit mill watts or microwatts). 

Selection and Description of software



“Adafruit.io” is a cloud service. It can handle and visualize multiple feeds of data.
Specifications of Adafruit io include:
  • Display our data in real-time, online.
  • Makes our project internet-connected: Control motors, read sensor data, and more!
  • We can connect projects to web services like Twitter, RSS feeds, weather services, etc…
  • Connects our project to other internet-enabled devices
Block Diagram
*Schematic representation of working of Node MCU

Components Required
·       Node MCU
·       Light emitting diodes(Red, Green, Blue)
·       Mobile to send input
·       Power supply
·       Jumper cables
·       Wi-Fi Connectivity
·       Breadboard
Circuit Design

Simulation by using Labview

Result (output obtained)


RGB Colour Model

RGB colour model is an additive colour model in which red, green and blue colours are mixed together in various proportions to form a different array of colours. The name was given with the first letters of three primary colours red, green and blue. In this model, colours are prepared by adding components, with white having all colours in it and black without the presence of any colour. RGB colour model is used in various digital displays like TV and video displays, Computer displays, digital cameras and other types of light-based display devices.


RGB is also called an "Additive" colour system, because it starts at black, and then colour is added.
RGB models have a wide range of applications namely in the field of photography, art, televisions etc…

Advantages
·       Allocate more quantization levels to the areas of colour space that correspond to the low spatial activity.
·       Perceptually weighted distortion metric as a cost function .
·       A method that tries iteratively reduces false contouring after pixel mapping phase.
·       No transformations required to display data on the screen.
·       It is considered as the base colour space for various applications.
·       It is a computationally practical system.
·       With the help of additive property, it is used in video displays.
·       It relates simply to CRT applications.
·       This model is very easy to implement.

Applications
1.    RGB models in display : The main application of the RGB colour model is to display digital images. It is used in cathode ray tubes, LCD displays, and LED display such as television, computer monitor or large screens. Each pixel on these displays is built by using three small and very close RGB light sources. At a common viewing distance, these colours cannot be distinguished separately and viewed as a single solid colour.
RGB is also used in component video display signals. It consists of three signals red, green and blue which carried on three separate pins or cables. These types of video signals are the best quality signal which can be carried on the standard SCART connector.

2.    RGB in Cameras : Digital cameras for photography that use a CMOS or CCD image sensor mostly perform with some type of RGB colour model. Current digital cameras are equipped with an RGB sensor which helps to perform the evaluation of light intensity in a crucial manner. And this results in the optimum value of exposure in each image.

3.    Philips HUE : Philips Hue is a line of colour changing LED lamps and white bulbs which can be controlled wirelessly (smart bulb).It generates around 16 million colours wherein widely used in IOT applications or to make home smart. It also uses MQTT as its main communication protocol.


Conclusion
Scientists found three colours namely red, green and blue which produce many other colours while mixing. They called these colours as primary colours. When combined red and green produce yellow, blue and green produce cyan, red and blue produce magenta. And this technology is later made as a colour model and is named as an RGB colour model.
The main purpose of this colour model is for the sensing, representation, and display of images in an electronic system. The evolution of the RGB colour model creates a huge development in the digital field. It was used in different electronic devices like TV, monitor, cameras, printers, etc.
So,I hereby by focusing on the pros, designed such a model that has a great significance in this digital and colourful world. I also represented how to control a remotely present light sources just by using a lightweight protocol like MQTT through Wi-Fi.


Guided by : 
Kavyashree M K
Professor @JSSSTU,Mysuru.


No comments:

Post a Comment