This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:hardware2:actuators_light [2023/10/03 10:24] – ktokarz | en:iot-open:hardware2:actuators_light [2023/11/23 10:39] (current) – pczekalski | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Optical Output Devices ==== | + | ====== Optical Output Devices |
- | + | {{: | |
- | === Light-Emitting Diode === | + | == Light-Emitting Diode == |
- | Unlike the other diodes, the light-emitting diode, also called LED, is a special | + | Unlike the other diodes, the light-emitting diode, also called LED, is a particular |
- | * The cathode' | + | * the cathode' |
- | * The anode' | + | * the anode' |
<figure led1> | <figure led1> | ||
Line 11: | Line 11: | ||
</ | </ | ||
- | The LED is one of the most efficient light sources. Unlike incandescent | + | The LED is one of the most efficient light sources. Unlike incandescent bulbs, LED transforms most of the power into light, not warmth; it is more durable, works for a more extended period and can be manufactured in a smaller size.\\ |
- | The semiconductor material determines the LED colour. Diodes are usually | + | The semiconductor material determines the LED colour. Diodes are usually silicon, and LEDs are made from elements like gallium phosphate silicon carbide. Because the semiconductors used are different, the voltage needed for the LED to shine is also different.\\ |
- | When the LED is connected to the voltage and turned on, a huge current starts to flow through it, and it can damage the diode. That is why all **LEDs have to be connected in series with a current-limiting resistor** (figure {{ref> | + | When the LED is connected to the voltage and turned on, a considerable |
Current limiting resistors resistance is determined by three parameters: | Current limiting resistors resistance is determined by three parameters: | ||
Line 20: | Line 20: | ||
* //U// – Combined voltage for LED and resistor. | * //U// – Combined voltage for LED and resistor. | ||
- | To calculate the resistance | + | A short guide on calculating |
- Find out the voltage needed for the diode to work //U_D//; you can find it in the diode parameters table. | - Find out the voltage needed for the diode to work //U_D//; you can find it in the diode parameters table. | ||
- | - Find out the amperage needed for the LED to shine //I_D//; it can be found in the LEDs datasheet, but if you can’t find it, then 20 mA current is usually a correct and safe choice. | + | - Find out the amperage needed for the LED to shine //I_D//; it can be found in the LEDs datasheet, but if you can't find it, then 20 mA current is usually a correct and safe choice. |
- Find out the combined voltage for the LED and resistor; usually, it is the feeding voltage for the scheme. | - Find out the combined voltage for the LED and resistor; usually, it is the feeding voltage for the scheme. | ||
- Insert all the values into this equation: //R = (U – U_D) / I_D// | - Insert all the values into this equation: //R = (U – U_D) / I_D// | ||
Line 58: | Line 58: | ||
LED's brightness can be controlled easily with a PWM signal.\\ | LED's brightness can be controlled easily with a PWM signal.\\ | ||
There exist LEDs with more than one light-emitting chip in one enclosure. They are made as two-coloured or RGB elements with coloured controlled separately. There are two internal configurations of such elements: | There exist LEDs with more than one light-emitting chip in one enclosure. They are made as two-coloured or RGB elements with coloured controlled separately. There are two internal configurations of such elements: | ||
- | * common anode - anodes of all internal LEDs are connected | + | * common anode - anodes of all internal LEDs are connected (for sample MCU connection, look in figure {{ref> |
* common cathode - cathodes of all internal LEDs are connected (for sample MCU connection, look in figure {{ref> | * common cathode - cathodes of all internal LEDs are connected (for sample MCU connection, look in figure {{ref> | ||
Line 71: | Line 71: | ||
</ | </ | ||
- | === Digital LED === | + | == Digital LED == |
- | <todo # | + | Digital LED does not have anode or cathode connections available externally. They have power supply pins and two pins for data transmission, |
- | Digital LED does not have anode or cathode connections available externally. They have power supply pins and two pins for data transmission, | + | |
<figure smartled1> | <figure smartled1> | ||
- | {{ : | + | {{ : |
< | < | ||
</ | </ | ||
<figure smartled2> | <figure smartled2> | ||
- | <todo @pczekalski> | + | {{ : |
< | < | ||
</ | </ | ||
Line 88: | Line 87: | ||
<code c> | <code c> | ||
#include < | #include < | ||
- | + | ||
- | #define PIN | + | #define PIN |
- | #define NUMPIXELS | + | #define NUMPIXELS |
+ | |||
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, | Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, | ||
- | |||
- | void setup() { | ||
- | pixels.begin(); | ||
- | } | ||
- | |||
- | void loop() { | ||
- | // Set the color of the NeoPixel LED | ||
- | setColor(255, | ||
- | |||
- | // Optional: Delay to make the color change visible (in milliseconds) | ||
- | delay(1000); | ||
- | } | ||
void setColor(uint8_t red, uint8_t green, uint8_t blue) { | void setColor(uint8_t red, uint8_t green, uint8_t blue) { | ||
Line 112: | Line 99: | ||
pixels.show(); | pixels.show(); | ||
} | } | ||
+ | |||
+ | void setup() { | ||
+ | pixels.begin(); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | // Change the colour of the NeoPixel LED | ||
+ | setColor(255, | ||
+ | delay(1000); | ||
+ | setColor(0, 255, 0); // Green color (R, G, B) | ||
+ | delay(1000); | ||
+ | setColor(0, 0, 255); // Blue color (R, G, B) | ||
+ | delay(1000); | ||
+ | } | ||
+ | |||
</ | </ | ||
- | === Displays | + | == Displays == |
- | Using a display is a quick way to get feedback information from the device. There are many display technologies. For IoT solutions, low-power, easy-to-use displays are used: | + | A display is a quick way to get feedback information from the device. There are many display technologies. For IoT solutions, low-power, easy-to-use displays are used: |
* 7-segment LED display, | * 7-segment LED display, | ||
* LED matrix display, | * LED matrix display, | ||
Line 123: | Line 125: | ||
* electronic ink display (E-ink). | * electronic ink display (E-ink). | ||
- | **7-segment LED display** | + | **7-segment LED display**\\ |
- | <todo # | + | The seven-segment LED display is built with seven LEDs forming the shape, making it possible to display symbols similar to digits and even some letters. Usually, the eighth LED is added as the decimal point. 7-segment displays can have similar internal connections as RGB LEDs, common anode or common cathode. If there is more than one digit in the element, all the same segments are also connected. Such displays need special controllers or the software part that displays separate digits in a sequence one by one. To avoid unnecessary blinking or differences in the brightness of digits, software for sequential displays is written using timers and interrupts. As for the RGB LEDs, 7-segment displays need a separate resistor for every segment. Sample 2-digit 7-segment module is present in the figure {{ref> |
- | The seven-segment LED display is built with seven LEDs forming the shape, making it possible to display symbols similar to digits and even some letters. Usually, the eighth LED is added as the decimal point. 7-segment displays can have similar internal connections as RGB LEDs, common anode or common cathode. If there is more than one digit in the element, all the same segments are also connected | + | |
<figure 7segled> | <figure 7segled> | ||
Line 133: | Line 134: | ||
- | **LED matrix display** | + | **LED matrix display**\\ |
- | <todo # | + | LED matrix displays offer the possibility of displaying not only digits and letters but also pictograms and symbols. The most popular versions have 8 rows and 8 columns (figure {{ref> |
- | LED matrix displays offer the possibility of displaying not only digits and letters but also some pictograms and symbols. The most popular versions have 8 rows and 8 columns (figure {{ref> | + | |
<figure ledmatrix> | <figure ledmatrix> | ||
Line 142: | Line 142: | ||
</ | </ | ||
- | **Liquid-Crystal Display (LCD)** | + | **Liquid-Crystal Display (LCD)**\\ |
+ | Monochrome LCD uses modulating properties of liquid crystal to block the passing-through light. Thus, when a voltage is applied to a pixel, it is dark. A display consists of layers of electrodes, polarising filters, liquid crystals and a reflector or backlight. Liquid crystals do not emit light directly but through reflection or backlight. Because of this reason, they are more energy efficient. Small, monochrome LCDs are widely used to show little numerical or textual information like temperature, | ||
- | Monochrome LCD uses modulating properties of liquid crystal to block the passing-through light. Thus, when a voltage is applied to a pixel, it is dark. A display consists of layers of electrodes, polarising filters, liquid crystals and a reflector or back-light. Liquid crystals do not emit light directly but through reflection or backlight. Because of this reason, they are more energy efficient. Small, monochrome LCDs are widely used in devices to show a little numerical or textual information like temperature, | + | < |
- | + | {{ : | |
- | < | + | |
- | {{ : | + | |
< | < | ||
</ | </ | ||
- | < | + | < |
{{ : | {{ : | ||
- | < | + | < |
</ | </ | ||
Line 179: | Line 178: | ||
</ | </ | ||
- | **Organic Light-Emitting Diode Display (OLED)** | + | **Organic Light-Emitting Diode Display (OLED)**\\ |
+ | OLED display uses electroluminescent materials that emit light when the current passes through these materials. The display consists of two electrodes and a layer of an organic compound. OLED displays are thinner than LCDs, have higher contrast, and can be more energy efficient depending on usage (figure {{ref> | ||
- | OLED display uses electroluminescent materials that emit light when the current passes through these materials. The display consists of two electrodes and a layer of an organic compound. OLED displays are thinner than LCDs, have higher contrast, and can be more energy efficient depending on usage. OLED displays are commonly used in mobile devices like smartwatches and cell phones, and they are replacing LCDs in other devices. OLED displays come as monochrome or RGB colour devices. Small OLED display modules usually have an onboard control circuit that uses digital interfaces like I2C or SPI. | + | < |
- | + | ||
- | < | + | |
{{ : | {{ : | ||
< | < | ||
</ | </ | ||
- | < | + | < |
{{ : | {{ : | ||
< | < | ||
Line 220: | Line 218: | ||
- | **Electronic Ink Display | + | **Monochrome |
+ | E-ink display uses charged particles to create a paper-like effect. The display comprises transparent microcapsules filled with oppositely charged white and black particles between electrodes. Charged particles change their location depending on the orientation of the electric field; thus, individual pixels can be either black or white (figure {{ref> | ||
- | E-ink display uses charged particles to create a paper-like effect. The display comprises transparent microcapsules filled with oppositely charged white and black particles between electrodes. Charged particles change their location depending on the orientation of the electric field; thus, individual pixels can be either black or white. The image does not need power to persist on the screen; power is used only when the image is changed. Thus e-ink display | + | <figure eink1> |
+ | {{ :en:iot-open: | ||
+ | < | ||
+ | </ | ||
- | < | + | < |
- | {{ : | + | {{ : |
< | < | ||
</ | </ | ||
- | < | + | < |
{{ : | {{ : | ||
< | < | ||
Line 246: | Line 248: | ||
digitalWrite(8, | digitalWrite(8, | ||
| | ||
- | Eink.InitEink(); | + | |
- | + | Eink.ClearScreen();// | |
- | Eink.ClearScreen();// | + | Eink.EinkP8x16Str(14, |
- | + | Eink.EinkP8x16Str(10, | |
- | Eink.EinkP8x16Str(14, | + | Eink.EinkP8x16Str(6, |
- | Eink.EinkP8x16Str(10, | + | Eink.EinkP8x16Str(2, |
- | Eink.EinkP8x16Str(6, | + | Eink.RefreshScreen(); |
- | Eink.EinkP8x16Str(2, | + | |
- | + | ||
- | Eink.RefreshScreen(); | + | |
} | } | ||
void loop() | void loop() | ||
Line 262: | Line 261: | ||
} | } | ||
</ | </ | ||
- | <todo @pczekalski>Add paper colourfully | + | |
+ | ** Colourful e-Ink displays **\\ | ||
+ | Recent advances in E-Ink (E-Paper) technology present the ability to display coloured information. Various approaches are present in the engineering of colourful E-Ink displays, along with multiple technologies for the presentation of colours. | ||
+ | |||
+ | Tri-colour e-Ink displays with predefined colour areas are a development of the black-white ones where part of the capsules (usually the upper half), instead of containing black microcapsules, | ||
+ | |||
+ | Grayscale e-Ink displays benefit from the fact that microcapsules inside a pixel sphere do not travel simultaneously. As some capsules have more charge than others, it is possible to design and charge them the way that variable external charge can pull or push not all of them but just partially. In practice, it enables the presentation of grayscale in a single pixel as observed from a distance. A principle of operation is present in figure {{ref> | ||
+ | |||
+ | <figure eink3> | ||
+ | {{ : | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Opposite to the above, multicolour e-Ink displays provide a true selection of colours per pixel and are implemented in various | ||
+ | |||
+ | **Multicolour with filtering**\\ | ||
+ | In this construction, | ||
+ | < | ||
+ | <figure eink4> | ||
+ | {{ : | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | **Multicoloured capsules in a single sphere (ACEP Advanced Colour ePaper)**\\ | ||
+ | In this approach, capsules in a single sphere are multicoloured rather than black-white. Microcapsules of different colours have slightly different charging, so a variating external electric field applied to the single sphere controls the colour of the capsules on the top of the sphere that is visible to the user. A single sphere can then present a wide range of colours. This kind of display uses subtractive colour mixing (CMY/CMYK). A principle of operation is present in figure {{ref> | ||
+ | < | ||
+ | |||
+ | <figure eink4> | ||
+ | {{ : | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | **Multicoloured capsules in separate spheres**\\ | ||
+ | This approach is theoretical as manufacturing such devices is inefficient because of the need to compose a matrix of spheres with different colours of microcapsules nearby. A domain of such spheres composes a single pixel. A principle of operation is present in figure {{ref> | ||
+ | |||
+ | <figure eink6> | ||
+ | {{ : | ||
+ | < | ||
+ | </figure> |