Confusion to Clarity – Raspberry Pi and Arduino Displays

Posted: January 06, 2017 at 01:16 AM EST
Updated: January 18, 2017 at 10:25 PM EST
— Added HMI info in jargon section.
Updated: January 11, 2017 at 08:24 PM EST
— Minor revisions and corrections.
— Added some links.

Hi all.  Welcome to my first post of 2017.  I hope you had a good holiday and will have a happy new year.

I want to share with you my journey from confusion to (some) clarity regarding displays for the Raspberry Pi and the Arduino.  I’m going to do a little raving on about one company.  This does not mean I’m slighting other companies.  I’m just sharing my experience.  I’ll also briefly discuss the concept of marrying the two devices together.  Disclaimer, all this is based only on my research.  I have yet to put most of this into practice.  It’s a work in progress.

Over the last few years I have been increasing my interest in the Raspberry Pi single board computer.  This small Linux based machine allows you to run the types of programs that a normal desktop computer would, and also allows you to do physical computing.  This means that you can control electronic devices with the Pi in the outside world.

https://www.raspberrypi.org/

https://en.wikipedia.org/wiki/Raspberry_Pi

https://www.raspberrypi.org/products/

https://www.raspberrypi.org/products/model-b-plus/

https://www.raspberrypi.org/products/raspberry-pi-2-model-b/

https://www.raspberrypi.org/products/raspberry-pi-3-model-b/

https://en.wikipedia.org/wiki/Physical_computing

Over a period of time, I’ve acquired a Raspberry Pi model b+ and a model 2.  I obtained the usual accessories including a power supply, case, memory card, WiFi dongle, HDMI cable, etc.

My main interest in the topic is to use the device to do scientific experiments.  I would describe the Pi as a general purpose computer with physical computing capability.  It either has, or can have easily added the following: substantial storage, HDMI, video, sound, Ethernet, USB, WiFi, & Bluetooth. It also runs a complete Linux (Debian based) operating system by default called Raspbian.  Other operating systems can be installed.  And, in addition, it has some physical computing capabilities.  It has various electrical pins / signals available to allow it to communicate with other electronic devices like lights, sensors, motors, etc.  It can act as a controller for a large number of projects and has a large following of fans.

One thing I hadn’t gotten for the Pi previously was its own small display, something I’ll discuss in this article.

Some of the experiments I want to run require very precise control of the electrical signals, with millisecond or multi microsecond precision.  I found out one significant limitation of the Pi in this regard.  The operating system is always doing multiple things at once.  It may be writing to the sd card, responding to a mouse or keyboard, sending data over the network, or doing internal “Linuxey” things.  So, it tends to send signals out of the control pins when it gets around to it.  If you need something to happen within 1/2 second (500 milliseconds) of the time you send the command, this is not a problem.  However, for really tight precision, it can be.

So, I started looking around for other options.  The other 800 pound gorilla in the hobby electronics physical computing room is the Arduino.

https://www.arduino.cc/

https://en.wikipedia.org/wiki/Arduino

https://www.arduino.cc/en/Main/Products

https://www.arduino.cc/en/Main/ArduinoBoardUno

https://www.arduino.cc/en/Main/ArduinoBoardLeonardo

https://www.arduino.cc/en/Main/ArduinoBoardMega2560

I would call the Arduino a controller computer which does very little general computing stuff unless you prod it and tweak it and add to it.  By default, most Arduinos do not have substantial storage, HDMI, video, sound, Ethernet, USB, WiFi, or Bluetooth.  They don’t have an operating system.  You load one program, which is far and away less complicated than a web browser or word processor; and it runs THAT program.  Period.  But, what Arduino does have going for it is that it has a perhaps better variety (not necessarily quantity) of electrical pins / signals.  It is lower cost in some cases.  And, for my purposes, because the system is not busy doing all those “Linuxey” or “Windowsey” things, it can just concentrate on getting those signals in and out of those pins.  It can do this more precisely than a Pi can.  The Arduino can also boot quickly and start up it’s designated application, which helps it recover quickly from a power failure.  The Arduino also can act as a controller for a large number of projects and has a large following of fans.

At this point, I’m not concerned with cost cutting or specifying the minimum controller for a project.  I’m only interested in working as a hobbyist and using what’s available at hand that will let me prototype quickly.

I ended up buying some “starter kits” for both the Pi and the Arduino.  Those include accessories like those mentioned before for the Pi.  The one for the Pi also included some components for electronic experiments.  For the Arduino, the kit came with an Arduino Mega 2560 board as well as components for electronic experiments and some sensors.

I also wanted to add a display to the Arduino, and in this case, it’s a bit harder since it has no native video output.  Thus starts my journey into confusion.

I went to a major electronics retailer’s brick and mortar store.  This vendor carries lots of hobby electronics parts including Raspberry Pi products and Arduino products.  I had a shopping list of things I wanted from their website and it said they had the stuff in stock.  I was immediately disappointed.  They DO have a huge selection … everywhere in that part of the store.  Everything was hanging in more or less random order, or so it looked.  Many items did not have any labeling out front where you could identify them.  A sales representative and I searched for one item on my list for half an hour and couldn’t find it even though the computer assured us it was in stock.  He gave up on it.  I looked through ALL their products once more and eventually found it.  While not the retailer’s fault, almost all these products contained NO documentation.  Not even a “getting started” pamphlet.  Some contained a web address on the packaging.  Some did not.  I personally don’t like that.  I’d rather have at least some guidance on or in the package.

I did end up buying a 4.3 inch TFT display which could potentially be used with either the Pi or the Arduino.  I went to their website and the instructions said to contact them after buying and they’d tell me how to connect the thing.  SAY WHAT?  I eventually found some more data by googling around, but I was not impressed.

Let’s take a jargon pit stop.

TFT means Thin Film Transistor and is a type of display technology.

https://en.wikipedia.org/wiki/Thin-film-transistor_liquid-crystal_display

You may also see IPS, which means in plane switching, and is more advanced.

https://en.wikipedia.org/wiki/IPS_panel

A display is made up of lots of dots, or pixels, which you can see if you get really close or use a magnifying glass to look at it.  Generally, there is a red, a green, and a blue pixel which make up each white “dot” that you see.  Something has to feed these little monsters with the data they’re hungry for to determine which pixels to light up and when.

There are two basic ways to send that data to the display.  First is a parallel interface, where many wires send data at the same time to the display device.  Strictly making this up for an example, you could have 8 wires for red, 8 wires for green, 8 wires for blue, 10 wires for row number, and 10 wires for column number.  Remembering our binary math, assuming each wire is on or off, you could have 256 shades of each of red, green, and blue (24 bit color), and could accommodate up to 1024 rows and 1024 columns.  You could put all the data on the wires and activate a clock signal to tell the display to light up that pixel.  This would be VERY fast.  However, it takes 45 wires, which means 45 connections to your controller.  That’s a problem, since you may not have that many.  There are variations on the theme.  You could use only 10 main wires and a few more to tell the unit whether you want to send it color data or coordinate data.  But, you still need lots of wires.  This is like cars going down a multi lane freeway side by side.

A small caveat.  I’m talking about DIGITAL video signals.  I’m not going to address ANALOG video, like composite or S-Video, or component video, or even VGA, which is still analog.  All these can be used, but they are subject to noise and distortion that digital signals are not.

https://en.wikipedia.org/wiki/Composite_video

https://en.wikipedia.org/wiki/S-video

https://en.wikipedia.org/wiki/Component_video

https://en.wikipedia.org/wiki/Video_Graphics_Array

On the other hand, digital forms of video include:

DVI – https://en.wikipedia.org/wiki/Digital_Visual_Interface

HDMI – https://en.wikipedia.org/wiki/HDMI

Display Port – https://en.wikipedia.org/wiki/DisplayPort

You can even send video over USB.

https://en.wikipedia.org/wiki/USB_video_device_class

The Raspberry Pi has a video interface called DSI, as well as supporting composite and HDMI video.

https://en.wikipedia.org/wiki/Display_Serial_Interface

Sending the data bits directly to the target device through wires and with processes that don’t conform to common standards is sometimes called Bit Banging, although that term is frequently used to refer to serial communications.

https://en.wikipedia.org/wiki/Bit_banging

The alternative to a parallel interface is a serial interface.  This sends data bits out one or a few signal lines one after the other, like cars following along behind each other on a two lane road.  All the digital video signals discussed above are primarily serial, although they may have multiple signal lines.  Serial interfaces are usually, but not always, slower than parallel interfaces.  Serial interfaces have the advantage of not requiring as many signal lines, which means a lot when using up pins on a micro controller.  Yes, you want to drive the display, but you may not need ultra fast refresh rates and you may want to use some of those pins for other things.  It’s not much good to have video and not be able to do the rest of your experiment.

HMI Means Human Machine Interface.  These displays can be used for this purpose.

https://en.wikipedia.org/wiki/Human%E2%80%93machine_interface

So, back to the discussion.

I ended up returning the 4.3 inch display (with parallel interface) and decided to look for a serial device.

Here continues the confusion part of my story.  I literally spent a day or two googling every combination of TFT, IPS, display, raspberry pi, and arduino that I could think of.  I found lots of people saying they had displays working, lots of people selling them, and little info on how they worked or how to get it done.  Confusion reigned supreme.

Then, (voices sing) I found one vendor where I could get some clarity.  Again, I’m not slighting others, but I was very impressed with their website.  Hopefully, their customer service will be equally as good.

The vendor is adafruit.

https://www.adafruit.com/

I found all these amazing and sometimes hard to find attributes on their website:

  1. Clear English descriptions
  2. Pricing
  3. Quantity in stock
  4. Specifications
  5. Data Sheets
  6. Instructions
  7. Videos
  8. Tutorials
  9. Suggestions to alternate products
  10. Forums

I was blown away.  They actually go out of their way to provide a wide array of products, tell you what they are, tell you how to use them, tell you how to buy them, and tell you what you can do with them.  IMAGINE THAT!

I haven’t bought anything from them yet, but I anticipate doing so.  I can’t tell you the end of the story, because it’s still going on.

However, here’s their section on displays.  This may change at some point in the future.

https://www.adafruit.com/category/63

I may buy this 5 inch display:

https://www.adafruit.com/products/1596

along with its controller:

https://www.adafruit.com/products/1590

I still have more research to do before making a final decision though.

For the Pi, I did not buy this type of display.  Because the Pi has its own DSI connector, you can connect to that and use no normal signal pins at all.  Thus, I bought the OFFICIAL Raspberry Pi 7 inch display.

https://www.raspberrypi.org/products/raspberry-pi-touch-display/

https://www.raspberrypi.org/blog/the-eagerly-awaited-raspberry-pi-display/

https://www.adafruit.com/product/2718

https://www.element14.com/community/docs/DOC-78156/l/raspberry-pi-7-touchscreen-display

I still may add a TFT display to the Pi like the one I mentioned for the Arduino if I want to run that display separately from the Pi’s main display.  I need to do more research on that too.

Another vendor I’ve heard good things about is SparkFun.  Their website has many, but not necessarily all, of the attributes that adafruit has.

https://www.sparkfun.com/

Here’s their display section:

https://www.sparkfun.com/categories/76

For our fellow makers in the UK, here’s a source in London.  As I mentioned before, I haven’t tried any of these, including this one.

https://thepihut.com/

https://thepihut.com/collections/raspberry-pi-screens

https://thepihut.com/products/official-raspberry-pi-7-touchscreen-display

I also mentioned the possibility of marrying a Raspberry Pi to an Arduino.  There are many potential advantages of doing that.  I may get to talk about that in a future article but can’t do so here.  However, here are a couple of options I ran across.

AlaMode:

http://wyolum.com/projects/alamode/

My friend at the Forsyth Makerspace in Cumming, Georgia (USA) mentioned the following to me:

http://makerspaceforsyth.com/

Lattepanda:

http://www.lattepanda.com/

http://www.zdnet.com/article/meet-the-lattepanda-a-tiny-windows-10-pc-for-the-internet-of-things/

Actually, Lattepanda normally runs Windows 10.  However, I suspect it could run Linux as well.  It’s not the same as a Raspberry Pi though.

Finally, here are a couple of beginner and a few more advanced books.

https://www.amazon.com/Getting-Started-Arduino-Electronics-Prototyping/dp/1449363334/

https://www.amazon.com/Exploring-Arduino-Techniques-Engineering-Wizardry/dp/1118549368/

https://www.amazon.com/Getting-Started-Raspberry-Introduction-Fastest-Selling/dp/1680452460/

https://www.amazon.com/Exploring-Raspberry-Pi-Interfacing-Embedded/dp/1119188687/

https://www.amazon.com/Python-Programming-Arduino-Pratik-Desai/dp/1783285931/

Well, that’s it for now.  I hope this helps you explore the world of hobby electronics, Arduino, Raspberry Pi, small displays, and physical computing.  While not specifically discussed, if you wanted to use these to build an Internet Of Things thing (IOT), you could.  Have fun.

Ron