This week is about electronics and more specificaly abour all kind of outputs:
This week is about the various foundations, organizations and infrastructure that are "behind the curtain" to make all this great adventure possibleTopics covered (course) Video recording (course) Video recording (recitation) Students and Labs My files
An organic light-emitting diode (OLED) is a light-emitting diode (LED) in which the emissive electroluminescent layer is a film of organic compound that emits light in response to an electric current. This organic layer is situated between two electrodes; typically, at least one of these electrodes is transparent.
Foldable OLED displays are exciting - as these displays will enable new device form factors - such as phones that open into tablets, smart bands that open into smartphones and more. In 2019 we will finally see the first foldable smartphones on the market!
At short term and .. at an affordable cost, there are nice small OLED screen you can get for a few $ and I bought one to integrate to my capstone project
There are (at least) 4 pins to connect the OLED board to our MCU: GND, VCC and two for I2C communication.
(from Sparkfun) The Inter-integrated Circuit (I2C) Protocol is a protocol intended to allow multiple "slave" digital integrated circuits ("chips") to communicate with one or more "master" chips. Like the Serial Peripheral Interface (SPI), it is only intended for short distance communications within a single device. Like Asynchronous Serial Interfaces (such as RS-232 or UARTs), it only requires two signal wires to exchange information. Each I2C bus consists of two signals: SCL and SDA. SCL is the clock signal, and SDA is the data signal. The clock signal is always generated by the current bus master; some slave devices may force the clock low at times to delay the master sending more data (or to require more time to prepare data before the master attempts to clock it out). This is called "clock stretching" and is described on the protocol page.
The schematic is quite simple: no active component, just a few traces to route the 4 pins to the right place on the platorm board/
This is the exact same process as last week/
Note: I'm still searching how to get the drill map out of KiCad and how to use it (idealy using the mods) to drill the holes on the board
I'm using the Adafruit library. My screen size is 128 by 64 pixels. You can use them individualy to display a picture or use pre-built funtions to display text in various size.
As explained on Adafruit web site, Pixels — picture elements, the blocks comprising a digital image — are addressed by their horizontal (X) and vertical (Y) coordinates. The coordinate system places the origin (0,0) at the top left corner, with positive X increasing to the right and positive Y increasing downward
Coordinates are always expressed in pixel units; there is no implicit scale to a real-world measure like millimeters or inches, and the size of a displayed graphic will be a function of that specific display’s dot pitch or pixel density. If you’re aiming for a real-world dimension, you’ll need to scale your coordinates to suit. Dot pitch can often be found in the device datasheet, or by measuring the screen width and dividing the number of pixels across by this measurement.
Here is how display a simple message
Here are more details on the code (see here to get the full code for this example
There are primitives in the library, to draw a line for example. But we are limited with the screen resolution and what looks like a line will be in reality a set of pixels, like shown here
This is a proof of concept where I play with text size and color inversion
The mezzanine is connected to the same board I used last week. Here is how it looks like
I will be using the same OLED screen for my final project (picture on the right) and for the wildcard project (picture on the left). Picture on the center is the back of the pcb of the final project
In this example, we play we the text size. The first two lines are set with a default magnification factor of 1 but the third one is set to 2.
Even with a monochrome screen, some fantasy is still possible: the second line is displayed with white text on a black background
You may ask.... how does it work to display a letter, like "A" on the screen, assuming it is in fact just a wide array of pixels ? The answer is within the drawChar() function within the library. There’s only one font (to save on space) and it’s meant to be 5x8 pixels, but an optional size parameter can be passed which scales the font by this factor (e.g. size=2 will render the text at 10x16 pixels per character). All ASCII character representations are stored in a separate file in the library.
Regarding power consumption, there are two elements to consider:
To compare theory and reality, I used a small USB dongle we have at my day job. Here is the measurement with the MCU only
When the OLED screen is connected, it does not increase a lot. I read 52mA on the dongle but not all dots were On. Far from the 20mA...
This week is my proof of concept. I know it works and how to connect it. There is another challenge in front of me: for the capstone project, I want to design a double side PCB, with the MCU part on the rear part and with the accessories (OLED, RFID card reader, ..) on the front side. I have to search more on how to do this