adafruit lcd display raspberry pi made in china
Honestly 14$ vs let"s say 25$ would be acceptable, but the original displays are at 40$. From a shop which delivers to Germany it would be around 50$.
Yes, in the meantime I"ve also noticed that the IC is mentioned on ALI too and I assume the missing last number is a mistake (or because it"s a replica) so its interface should be identical to the Adafruit original.
Oh mostly by coincidence I found a very similar display: http://www.wide.hk/index.php?route=prod ... duct_id=66 Here it makes associations between the pin descriptions:
Required a bit of measuring to find out what pins are connected on the bonnet and also a bit of guessing, but the first display worked instantly and the second soon after.
To be clear, I"m speaking of the mainstream SBC Raspberry Pis, like the Pi 4 model B, the Compute Module 4, the Pi Zero 2 W, and even in many cases the Pi 400. The Pico and Pico W are both readily available, at least in most markets where I"ve looked (local shortages always exist, but typically not for months or years like with full-size Pis).
A service has even been set up since early this year just to scan different vendors to find when Pis are in stock, and alert people via Twitter and other means. Long-time followers of rpilocator.com know how short-lived Raspberry Pis are at official retailers like Adafruit and Pi-Shop, even with purchasing limitations in place.
Sadly, the only reliable way to buy a Pi immediately is to pay scalping prices on eBay or buy bundles that include often-unneeded components to pad out the price of a normally-$35 Pi to $100 and beyond.
Raspberry Pi is one of the few SBC vendors (maybe the only one) to tackle the most important feature for adoption and ongoing end-user happiness: support.
Instead of throwing hardware at the wall, seeing what sticks, and relying on developer communities to support their hardware with distributions like Armbian, Raspberry Pi actively supports their boards, all the way back to the original Pi model B. They ship Raspberry Pi OS. They continually improve their documentation and focus on a great end-user experience for beginners and advanced users.
And because of the second point, Raspberry Pi can produce a limited number of Pi models based on the Broadcom BCM2711 SoC. This is the same issue plaguing car manufacturers. Even behemoths like Nvidia, Intel, AMD, and Apple are still being affected.
Because of the shortages, Raspberry Pi have not been able to increase production to meet demand, therefore they have to prioritize where the Pis they make go... and right now they are still prioritizing OEM partners over end-user retailers like Adafruit, PiShop.us, Micro Center, and other retailers selling individual units.
This is far from ideal, and many in the maker/hacker community (myself included) feel betrayed by an organization that grew quickly based on the grassroots adoption of the Raspberry Pi since 2012.
How many of the commercial and industrial users of the Pi would be incorporating it into their products (thus depending on Pi stock for their own survival) without the huge community of individual developers, makers, hobbyists, and educators who made the Raspberry Pi as popular as it is today?
With all this in mind, and since there hasn"t been an official update since Eben Upton"s post on the Raspberry Pi blog in April, I asked directly about the shortage. Eben said, basically:
We value our approach to software support, maintenance and quality over and above everything else. You can be confident that our software will run on all Raspberry Pis even those now over ten years old, and it is still being updated!
Indeed, that"s why people pay double, or even triple, the MSRP for a used Raspberry Pi. For some projects, getting things running on the Pi (and knowing they"ll have software updates for years) is still much easier than doing the same on another SBC.
And though the Pi 4"s BCM2711 is getting long in the tooth—most competing boards are already far surpassing it in CPU, memory, and IO performance—it is still a great option for energy-efficient computing and certain edge use cases.
If you want a slightly faster and more generic computer, buying a used "one liter" PC (one of those little PCs you see strapped to a monitor at a doctor"s office) can get you something on par with—or faster than—a Pi 4 for less than $80, or cheaper if you get lucky. But these PCs lack some features like GPIO or any kind of HAT compatibility, so are only an option if you use the Pi as a generic computer.
If you want a comparable SBC with features like GPIO and a faster CPU and GPU, with native SATA ports or other more exotic features, Khadas, Radxa, OrangePi, and other vendors have made some great hardware over the past two years, with many options under $100.
But getting started with a Pi clone can be daunting—unlike the first-time experience with a Pi, where you have helpful Getting Started Guide and a plethora of blog posts, videos, and books available, you may encounter a sparse documentation page (if anything) pointing you to an ISO download and telling you to flash an image to a microSD card.
Where Raspberry Pi assumes nothing and guides you along every step, most other manufacturers assume you"re familiar with SBCs, flashing ISOs, and quite possibly debugging problems over a USB serial connection!
But the CB1 is an outlier in my experience. Almost every non-Pi board I test requires more work than just "download ISO, flash it, and the SBC boots and works". Some images don"t have basic functionality like HDMI or networking, and sometimes you can"t even find an image with a modern and secure Linux OS, only Android images (which is unhelpful for general use).
Connecting an LCD to your Raspberry Pi will spice up almost any project, but what if your pins are tied up with connections to other modules? No problem, just connect your LCD with I2C, it only uses two pins (well, four if you count the ground and power).
In this tutorial, I’ll show you everything you need to set up an LCD using I2C, but if you want to learn more about I2C and the details of how it works, check out our article Basics of the I2C Communication Protocol.
There are a couple ways to use I2C to connect an LCD to the Raspberry Pi. The simplest is to get an LCD with an I2C backpack. But the hardcore DIY way is to use a standard HD44780 LCD and connect it to the Pi via a chip called the PCF8574.
The PCF8574 converts the I2C signal sent from the Pi into a parallel signal that can be used by the LCD. Most I2C LCDs use the PCF8574 anyway. I’ll explain how to connect it both ways in a minute.
I’ll also show you how to program the LCD using Python, and provide examples for how to print and position the text, clear the screen, scroll text, print data from a sensor, print the date and time, and print the IP address of your Pi.
Connecting an LCD with an I2C backpack is pretty self-explanatory. Connect the SDA pin on the Pi to the SDA pin on the LCD, and the SCL pin on the Pi to the SCL pin on the LCD. The ground and Vcc pins will also need to be connected. Most LCDs can operate with 3.3V, but they’re meant to be run on 5V, so connect it to the 5V pin of the Pi if possible.
If you have an LCD without I2C and have a PCF8574 chip lying around, you can use it to connect your LCD with a little extra wiring. The PCF8574 is an 8 bit I/O expander which converts a parallel signal into I2C and vice-versa. The Raspberry Pi sends data to the PCF8574 via I2C. The PCF8574 then converts the I2C signal into a 4 bit parallel signal, which is relayed to the LCD.
Before we get into the programming, we need to make sure the I2C module is enabled on the Pi and install a couple tools that will make it easier to use I2C.
Now we need to install a program called I2C-tools, which will tell us the I2C address of the LCD when it’s connected to the Pi. So at the command prompt, enter sudo apt-get install i2c-tools.
Next we need to install SMBUS, which gives the Python library we’re going to use access to the I2C bus on the Pi. At the command prompt, enter sudo apt-get install python-smbus.
Now reboot the Pi and log in again. With your LCD connected, enter i2cdetect -y 1 at the command prompt. This will show you a table of addresses for each I2C device connected to your Pi:
We’ll be using Python to program the LCD, so if this is your first time writing/running a Python program, you may want to check out How to Write and Run a Python Program on the Raspberry Pi before proceeding.
There are a couple things you may need to change in the code above, depending on your set up. On line 19 there is a function that defines the port for the I2C bus (I2CBUS = 0). Older Raspberry Pi’s used port 0, but newer models use port 1. So depending on which RPi model you have, you might need to change this from 0 to 1.
The function mylcd.lcd_display_string() prints text to the screen and also lets you chose where to position it. The function is used as mylcd.lcd_display_string("TEXT TO PRINT", ROW, COLUMN). For example, the following code prints “Hello World!” to row 2, column 3:
On a 16×2 LCD, the rows are numbered 1 – 2, while the columns are numbered 0 – 15. So to print “Hello World!” at the first column of the top row, you would use mylcd.lcd_display_string("Hello World!", 1, 0).
You can create any pattern you want and print it to the display as a custom character. Each character is an array of 5 x 8 pixels. Up to 8 custom characters can be defined and stored in the LCD’s memory. This custom character generator will help you create the bit array needed to define the characters in the LCD memory.
The code below will display data from a DHT11 temperature and humidity sensor. Follow this tutorial for instructions on how to set up the DHT11 on the Raspberry Pi. The DHT11 signal pin is connected to BCM pin 4 (physical pin 7 of the RPi).
By inserting the variable from your sensor into the mylcd.lcd_display_string() function (line 22 in the code above) you can print the sensor data just like any other text string.
These programs are just basic examples of ways you can control text on your LCD. Try changing things around and combining the code to get some interesting effects. For example, you can make some fun animations by scrolling with custom characters. Don’t have enough screen space to output all of your sensor data? Just print and clear each reading for a couple seconds in a loop.
We have used Liquid Crystal Displays in the DroneBot Workshop many times before, but the one we are working with today has a bit of a twist – it’s a circle! Perfect for creating electronic gauges and special effects.
LCD, or Liquid Crystal Displays, are great choices for many applications. They aren’t that power-hungry, they are available in monochrome or full-color models, and they are available in all shapes and sizes.
Today we will see how to use this display with both an Arduino and an ESP32. We will also use a pair of them to make some rather spooky animated eyeballs!
Waveshare actually has several round LCD modules, I chose the 1.28-inch model as it was readily available on Amazon. You could probably perform the same experiments using a different module, although you may require a different driver.
There are also some additional connections to the display. One of them, DC, sets the display into either Data or Command mode. Another, BL, is a control for the display’s backlight.
The above illustration shows the connections to the display. The Waveshare display can be used with either 3.3 or 5-volt logic, the power supply voltage should match the logic level (although you CAN use a 5-volt supply with 3.3-volt logic).
Another difference is simply with the labeling on the display. There are two pins, one labeled SDA and the other labeled SCL. At a glance, you would assume that this is an I2C device, but it isn’t, it’s SPI just like the Waveshare device.
This display can be used for the experiments we will be doing with the ESP32, as that is a 3.3-volt logic microcontroller. You would need to use a voltage level converter if you wanted to use one of these with an Arduino Uno.
The Waveshare device comes with a cable for use with the display. Unfortunately, it only has female ends, which would be excellent for a Raspberry Pi (which is also supported) but not too handy for an Arduino Uno. I used short breadboard jumper wires to convert the ends into male ones suitable for the Arduino.
Once you have everything hooked up, you can start coding for the display. There are a few ways to do this, one of them is to grab the sample code thatWaveshare provides on their Wiki.
The Waveshare Wiki does provide some information about the display and a bit of sample code for a few common controllers. It’s a reasonable support page, unfortunately, it is the only support that Waveshare provides(I would have liked to see more examples and a tutorial, but I guess I’m spoiled by Adafruit and Sparkfun LOL).
Open the Arduino folder. Inside you’ll find quite a few folders, one for each display size that Waveshare supports. As I’m using the 1.28-inch model, I selected theLCD_1inch28folder.
Once you do that, you can open your Arduino IDE and then navigate to that folder. Inside the folder, there is a sketch file namedLCD_1inch28.inowhich you will want to open.
The error just seems to be with a couple of the Chinese characters used in the comments of the sketch. You can just ignore the error, the sketch will compile correctly in spite of it.
You can see from the code that after loading some libraries we initialize the display, set its backlight level (you can use PWM on the BL pin to set the level), and paint a new image. We then proceed to draw lines and strings onto the display.
Unfortunately, Waveshare doesn’t offer documentation for this, but you can gather quite a bit of information by reading theLCD_Driver.cppfile, where the functions are somewhat documented.
After uploading the code, you will see the display show a fake “clock”. It’s a static display, but it does illustrate how you can use this with the Waveshare code.
This library is an extension of the Adafruit GFX library, which itself is one of the most popular display libraries around. Because of this, there isextensive documentation for this libraryavailable from Adafruit. This makes the library an excellent choice for those who want to write their own applications.
As with the Waveshare sample, this file just prints shapes and text to the display. It is quite an easy sketch to understand, especially with the Adafruit documentation.
The sketch finishes by printing some bizarre text on the display. The text is an excerpt from The Hitchhiker’s Guide to the Galaxy by Douglas Adams, and it’s a sample of Vogon poetry, which is considered to be the third-worst in the Galaxy!
Here is the hookup for the ESP32 and the GC9A01 display. As with most ESP32 hookup diagrams, it is important to use the correct GPIO numbers instead of physical pins. The diagram shows the WROVER, so if you are using a different module you’ll need to consult its documentation to ensure that you hook it up properly.
The TFT_eSPI library is ideal for this, and several other, displays. You can install it through your Arduino IDE Library Manager, just search for “TFT_eSPI”.
There is a lot of demo code included with the library. Some of it is intended for other display sizes, but there are a few that you can use with your circular display.
To test out the display, you can use theColour_Test sketch, found inside the Test and Diagnostic menu item inside the library samples. While this sketch was not made for this display, it is a good way to confirm that you have everything hooked up and configured properly.
A great demo code sample is theAnimated_dialsketch, which is found inside theSpritesmenu item. This demonstration code will produce a “dial” indicator on the display, along with some simulated “data” (really just a random number generator).
In order to run this sketch, you’ll need to install another library. Install theTjpeg_DecoderLibrary from Library Manager. Once you do, the sketch will compile, and you can upload it to your ESP32.
One of my favorite sketches is the Animated Eyes sketch, which displays a pair of very convincing eyeballs that move. Although it will work on a single display, it is more effective if you use two.
The first thing we need to do is to hook up a second display. To do this, you connect every wire in parallel with the first display, except for the CS (chip select) line.
The Animated Eyes sketch can be found within the sample files for the TFT_eSPI library, under the “generic” folder. Assuming that you have wired up the second GC9A01 display, you’ll want to use theAnimated_Eyes_2sketch.
The GC9A01 LCD module is a 1.28-inch round display that is useful for instrumentation and other similar projects. Today we will learn how to use this display with an Arduino Uno and an ESP32.