Over 10 years we help companies reach their financial and branding goals. Engitech is a values-driven technology agency dedicated.

Gallery

Contacts

411 University St, Seattle, USA

engitech@oceanthemes.net

+1 -800-456-478-23

Display Screens Sensors and Modules Tech

What is OLED Technology?

OVERVIEW Nowadays we see oled display being used everywhere be it the phones , TVs , laptops or PCs , smartwatches . They sure are better than old chunky CRT TV displays that were bulky and didn’t deliver the desired picture quality , with the introduction of the LCD and backlight LEDs the things sure got better with the chunkiness of the display gone but the picture quality still wasn’t what one desired of but with the release of the OLED display all these problems became a thing of past. OLED or organic light emitting diode were invented in 1987 by Ching Tang and Steven Van Slyke from Kodak but it was until 2004 when SONY released a OLED TV. In fact in CES 2019 , there were some innovative inventions that were released in the OLED domain with the companies trying to come up with foldable display and some exceptional picture quality. TYPES OF OLED Passive Matrix Oled (PMOLED) Pmoleds have strips of cathode , anode and organic layer. The anode strips are perpendicular to cathode strips it is their intersection that makes a pixel . External circuitry applies current to the cathode and anode strips to decide which pixel to light up. They are used in MP3 players , cell phones etc. Active Matrix Oled(AMOLED) Amoleds have full layer of anode and cathode and organic molecules . The anode layer overlaps the TFT matrix array . The TFT array is the matrix circuitry that decides which pixel gets turned on form the image. Since they consume less electricity they are used in TV screens , BillBoards, Computer Monitors. Transparent Oled A Transparent Oled has all the components cathode, anode, substrate transparent and when off the display is 85 percent transparent. When switched ON the display allows the transfer of light in both the directions. Top Emitting Oled The Top Emitting Oled is have substrate that is either opaque or transparent . They are best suited for active matrix design . They are used in smartcards                   Foldable Oled They are substrate that made of flexible metallic foil , plastic . They are durable and are easier to replace in case of damage . They are used in smart clothing , GPS receivers , IC computers. White Oled They are made of white light that is more uniform and energy efficient rather than fluorescent lights. They posses true color of incandescent lights BESIDES THESE OLEDS ARE ALSO CATEGORIZED ON THE BASIS OF BASE COLOUR Monochrome Blue Monochrome white Yellow Colour NO OF PINS 3 Pins (supports only I2C) 7 Pins(supports both I2C and SPI) BASED ON INTERFACE ICs    SSD1306     SSD1331 BASED ON SIZE 0.91 inch(128×32) 0.96 inch(128×64) HOW OLEDs WORKS Both the LCD and OLED have similar display mechanism . The difference lies in the fact that OLED has the smallest display unit made of pixels that are usually 0.3mm x 0.3mm . Inside each pixel they are 3 different type of color filters . When the size of the color filter is reduced then human eye losses its ability to view each color individually and sees them as a mixture. Next each pixel is converted into digital form for future reproduction of the image. Earlier the image reproduction was done using backlight white , colour filters, glass , diffuser . When the light would glow each color filter would light up too. Behind the filters a polarizer lcd sheet is used which reproduces the image , the problem with this was the black colour produced wasn’t exactly black due to the back light being ON constantly . This issue was rectified using tiny light sources for each pixel due to which organic led was used . If we apply positive voltage to the anode termina the electrons would combine with the holes in the LUMO layer producing light. Work is also being done to remove the need for light source and add doping material in the emission layer which will release light of the certain color due to the energy difference in the conduction and valence layer corresponding to their wavelengths FIG -1 SIZE OF A SINGLE PIXEL FIG-2 RGB COLOR FILTERS INSIDE A PIXEL FIG -3 CONVERTING EACH COLOR INTO BINARY FIG -4 CROSS SECTION VIEW OF OLED FIG-5 CHANGING THE ORIENTATION OF THE POLARIZER TO GENERATE DIFFERENT COLORS FIG -6 ELECTRON HOLE PAIR COMBINATION TO GENERATE LIGHT FIG – 7 DOPING OF SUBSTRATE TO GENERATE LIGHT OF VARIOUS WAVELENGTH USE CASES OF OLED DISPLAY Raspberry Pi Based SSD1306 OLED Video PlayerThis project uses Raspberry pi and OpenCv to display videos on the Oled display ESP8266 Weather WidgetThis project used ESP8266 and weather API to display real time weather conditions on the 0.96 inch display. Tinyduino gamepadThe project used joystick , push buttons , arduino uno , custom designed PCB , USB module  and ssd display to play games on the tiny 0.96 inch screen Bluetooth SmartwatchThe project uses 0.96 display , bluetooth module , tiny arduino , lipo battery to connect to the phone and display all kinds of medical stats and time Speedometer for bikes The project uses gps module neo6m and ssd1306 display to show speed of the vehicle on the display and raise an alarm in case of overspeeding.                                                                                                 HOW TO CONNECT THE DISPLAY WITH THE MICROCONTROLLER WE WILL BE COVERING THE DETAILS ON HOW TO CREATE AN EMBEDDED DRIVER FOR THE DISPLAY IN THE NEXT BLOG . IN THIS WE’LL BE COVERING A BRIEF OVERVIEW OF THE 2 METHODS THAT CAN BE USED TO COMMUNICATE WITH THE DISPLAY. I2C SPI I2C Using I2C we’ll be communicating with the microcontroller by the help of SCL the clock

Display Screens I2C Modules Sensor/Module Interfacing Sensors and Modules Tech

CONFIGURING THE OLED WITH STM32 MCU

In previous blog we covered a brief overview of how the OLED display works in microscopic level and also understood various types of OLED displays available in the market . In this blog we’ll be discussing  how to configure the SSD1306  display with the microcontroller and we’ll be  making the embedded driver as well.128×64 display is a dot matrix display , hence 128×64 =8192 total pixels . It is by turning on/off these pixels we display graphical image of any shape . It is the current provided to each pixel that varies the brightness. HARDWARE DESCRIPTION OLED Display chosen is driven by SSD1306 Driver IC although they are other ICs such as SSD1331 which can be used to drive the display . These ICs  are CMOS OLED Driver controller for dot-matrix system . OLED has 256 brightness steps .Besides 128×64 , 128×32 display resolution is also available. Specification of ssd1306 128×64 OLED Display Type: OLED (Organic Light Emitting Diode) Display Size: 128×64 pixels Display Driver: ssd1306 Display Colors: Monochrome (White), Yellow, and Blue Operating Voltage: 3.3V to 5V Interface: I2C Operating Current: ~20mA Display Structure OLED DISPLAY is mapped using GDDRAM page structure  OF SSD1306 GDDRAM or graphic display ram is a bit mapped static RAM . It holds the bit pattern to be displayed. The GDDRAM having size 128×64 is divided into 8 pages from PAGE 0 TO PAGE 7 which is used for monochrome matrix display . When data bit D0 – D7 is sent the row0 gets filled with D0 and D7 is written into the bottom row.  Display has 64 rows , 128 columns divided into 8 pages . Each page has 128 columns and 8 rows. Display 128 columns known as segments For displaying the graphical data in the first location , page address and column address both are set to 0 with the end address of page and column also being selected End of column and End of the page is 7FH and 07H respectively SSD1306 BLOCK DIAGRAM PIN ARANGEMENT SSD1306 FUNCTIONAL BLOCK DIAGRAM SSD1306 BLOCK DIAGRAM PIN ARANGEMENT SSD1306 FUNCTIONAL BLOCK DIAGRAM ADDRESSING MODE 1. PAGE ADDRESSING MODE 2.Horizontal Addressing Mode 3.Vertical Addressing Mode 1. PAGE ADDRESSING MODE In page addressing mode, after the display RAM is read/written, the column address pointer is increased automatically by 1.                                                                If the column address pointer reaches column end address, the column address pointer is reset to column start address but page address pointer not points to next page. Hence, we need to set the new page and column addresses in order to access the next page RAM content. We need to set lower two bits to ‘1’ and ‘0’ for Page Addressing Mode. In page addressing mode, the following steps are required to define the starting RAM access pointer location: Set the page start address of the target display location by command B0h to B7h. Set the lower start column address of pointer by command 00h~0Fh. Set the upper start column address of pointer by command 10h~1Fh 2.Horizontal Addressing Mode In horizontal addressing mode, after the display RAM is read/written, the column address pointer is increased automatically by 1. If the column address pointer reaches column end address, the column address pointer is reset to column start address and page address pointer is increased by 1. When both column and page address pointers reach the end address, the pointers are reset to column start address and page start address We need to set last two digits to ‘0’ and ’0’ for horizontal addressing mode. 3.Vertical Addressing Mode In vertical addressing mode, after the display RAM is read/written, the page address pointer is increased automatically by 1. If the page address pointer reaches the page end address, the page address pointer is reset to page start address and column address pointer is increased by 1. When both column and page address pointers reach the end address, the pointers are reset to column start address and page start address. We need to set last two digits to ‘0’ and ’1’ for vertical addressing mode. In normal display data RAM read or write and horizontal/vertical addressing mode, the following steps are required to define the RAM access pointer location: Set the column start and end address of the target display location by command 21h. Set the page start and end address of the target display location by command 22h. Hardware Pinout SDAThis pin is used to send data between master and slave with the acknowledgement of the master SCLThis is a clock signal that helps keeps the process in synchronization VCCA power supply of 3.3 V is required . More than 3.3V may damage the module GNDThis ground pin is connected to the ground supply ALGORITHM Select the I2C slave address and specify the operation that will be performed i.e Read 0x79 or Write 0x78. #define SSD1306_I2C_ADDR 0x78 Set the clock divide ratio and oscillator frequency . Bit 3-0 sets the clock divide ratio , Bit 7-4 sets the oscillator frequency SSD1306_WRITECOMMAND(0xD5); //–set display clock divide ratio/oscillator frequency SSD1306_WRITECOMMAND(0xF0); //–set divide ratio Set the multiplex ratio switching to any value ranging from 16-63 SSD1306_WRITECOMMAND(0xA8); //–set multiplex ratio(1 to 64) Display start line addressing in which the starting address of the display ram is determined . In our case this is set to zero and RAM row 0 is mapped to col 0 SSD1306_WRITECOMMAND(0x40); //–set start line address Set memory addressing mode using page addressing mode, horizontal addressing mode, vertical addressing mode. SSD1306_WRITECOMMAND(0x10); //00,Horizontal Addressing Mode;01,Vertical Addressing Mode;10,Page Addressing Mode (RESET);11,Invalid SSD1306_WRITECOMMAND(0xB0); //Set Page Start Address for Page Addressing Mode,0-7 Set column address using a triple byte first specifies the column setting , second column start and third column  end . Do the same for the page SSD1306_WRITECOMMAND(0x00); //—set low column address SSD1306_WRITECOMMAND(0x10); //—set high column address Set pre-charge period and VCOMH deselect level SSD1306_WRITECOMMAND(0xDB); //–set vcomh Entire display is on using A4H and A5H command SSD1306_WRITECOMMAND(0xA4); //0xa4,Output follows RAM content;0xa5,Output ignores RAM content The normal functionality of the

Embedded MCU's Kinetic Sensor/Modules Sensor/Module Interfacing Sensors and Modules SPI Modules STM32 MCU's STM32F1

Implementation of MPU6050 with STM32

In the last blog I talked about the basics of MPU6050, this time let’s see how to interface it with the STM32 based controller and get the values of accelerometer and Gyro sensor. But before  starting first, let’s see the I2C block and the STM32 I2C block to get some idea of the basic structure of the I2C protocol. Figure 1: I2C Hardware Circuit The above circuit diagram shows the hardware connection of the I2C protocol in open drain configuration. The external pull up resistors are being used to make the circuit work efficiently. These days the controllers come with the internal pull up resistors so while writing the code for the same these resistors can be pulled up in the configuration. Before proceeding further lets understand certain terms like pull up, pull down, open drain etc. While using an I/O pin, in the digital domain it has values as LOGIC 1 (HIGH), LOGIC 0 (LOW) and Z-STATE (HIGH IMPEDANCE or FLOATING or TRI-STATE). The purpose of pull up and pull down is to maintain these states of the pin while working. PULL-UP means that the pin is internally connected to the power supply via a resistor and is read as LOGIC 1. PULL-DOWN means that the pin is internally connected to the ground via a resistor and is read as LOGIC 0. In between the two in the configuration, when the pin is neither pull-up nor pull-down and the analog value cannot be represented in the logic value, this state is termed as Z-STATE where there is a floating value.    Figure 2: Pull-up and Pull-Down Configuration Now let’s understand the Push-Pull and Open Drain configurations. PUSH-PULL Configuration: This configuration consist of a pair of complementary transistors which works as: For LOGIC 0, the transistor connected to the ground is turned on to sink an electric current from the external circuit. For LOGIC 1, the transistor connected to the power supply is turned on, and it provides an  electric current to the external circuit connected to the output pin. The slave address of the MPU-6050 id 0b110100x, a 7-bit long. Here the LSB bit i.e.x in the 7-bit long address is determined by the logic level at AD0 pin.If x=0 i.e., pin AD0 is Logic LOW otherwise Logic HIGH. Figure 3: Push-Pull Configuration   Figure 4: The Logic 0 and 1 for Push-Pull Configuration   OPEN-DRAIN Configuration: This configuration consist of a single transistors which works as: For LOGIC 0, the transistor connected to the ground is turned on to sink an electric current from the external circuit. For LOGIC 1, it cannot supply any electric current to the external load because the output pin is floating, connected to neither the power supply nor the ground. Hence the Open-Drain has two states LOGIC 0 (LOW) and LOGIC 1 (Z-STATE). This configuration use external pull up resistor. Figure 5: Open-Drain Configuration   Figure 6: The Logic 0 and 1 for Open-Drain Configuration I2C Let’s analyze the functional block diagram of the STM32. As shown in the figure, the I2C protocol consists of SDA and SCL lines along with an additional pin SMBA used in SMB protocol known as System Management Bus. The figure shows that there is a single Data Register along with the single Shift Register as the protocol is half -duplex. The address block is also there and a comparator to compare the addresses. The control logic consists of Control Register (CR 1 and CR2) and Status Registers (SR1 and SR2)  along with the Clock Control Register for generating the clock for the communication. Figure 7: I2C Block Diagram I2C Implementation Of Figure 9: Pin Connections Above is the pin connection of the MPU6050 with the STM32F411CE. Now set up the stm32 environment as follows: Step 1 Step 2 Step 1 Set up the RCC ad the SYS in the STM32Cube IDE as shown: Step 2 Now enable the I2C1 in the standard mode. Now starting with the code create a mpu6050.h file in the Inc folder and mpu6050.c file in Scr folder. We are all done. Let’s start with the code. In total there are around 80 registers in the IC but during the code all the registers are not required there are certain sets of registers which we are going to use which we will be defining in the header file mpu6050.h. These registers are: Name of the Register Address of the Register (Hex) Function REG_MPU6050_ADDR 0xD0 It is the device address for the MPU6050 module REG_SMPLRT_DIV 0x19 This register specifies the divider from the gyroscope output rate used to generate the Sample Rate for the MPU-6050. REG_GYRO_CONFIG 0x1B This register is used to trigger gyroscope self-test and configure the gyroscopes’ full scale range. REG_ACCEL_CONFIG 0x1C This register is used to trigger the accelerometer self test and configure the accelerometer full scale range. This register also configures the Digital High Pass Filter (DHPF). REG_ACCEL_XOUT_H 0x3B These registers store the most recent accelerometer measurements. REG_TEMP_OUT_H 0x41 These registers store the most recent temperature sensor measurement. REG_GYRO_XOUT_H 0x43 These registers store the most recent gyroscope measurements. REG_PWR_MGMT_1 0x6B This register allows the user to configure the power mode and clock source. It also provides a bit for resetting the entire device, and a bit for disabling the temperature sensor. REG_WHO_AM_I 0x75 This register is used to verify the identity of the device. The contents of WHO_AM_I are the upper 6 bits of the MPU-60X0’s 7-bit I2C address. The least significant bit of the MPU-60X0’s I2C address is determined by the value of the AD0 pin. The value of the AD0 pin is not reflected in this register. Apart from these registers we have two structures and the function definitions that we are using in the main file. Lets now jump directly towards the mpu6050.c file and see how things are working. In this phase, keep in mind the 3 things. Initializing the mpu6050. Read the RAW values of accelerometer and gyroscope Convert the RAR values to ‘g’ and ‘dps’ for Accelerometer

  • 1
  • 2

Stay Updated With Us

Error: Contact form not found.