Adventures using low-cost parts in embedded hardware projects

How to avoid surprises constructing your "Internet of Things" hardware projects.

Arduino TFT display
Credit: Stephen Glasskeys

Finding low-cost parts

No one doubts that microcontrollers and embedded hardware boards are more popular than ever. Popular too are a growing stable of low-cost hardware add-ons: Sensors, "piggyback" expansion boards, Ethernet cards, gyroscopes, small low-power color displays. In possession of an old Arduino board, I decided to find an inexpensive color display I could use to wire to an Uno. Ultimately, this project will be used as part of a larger "Internet of Things" homebrew project.

I found (what I thought) was a perfect candidate: A 1.8" color TFT display, known as the SainSmart ST7735R module. It has a very attractive price of less than twelve U.S. dollars.  

Houston, we have a problem

The module arrived undamaged, and I downloaded the documentation and user manual from SainSmart's page. But unfortunately, the sample source I downloaded didn't appear to work. Perhaps my Uno had incompatible firmware. Unsure I began to research, finding  comments on Amazon about the same display module. Comments about the display were a mixed bag:  Some users reported problems getting the source to work, others none.

Hardware community to the rescue

Doing more research, I ran across this excellent tutorial by Hans Luijten on how to use the ST7735R color display with an Arduino. Hans explained in detail how he modified code originally used with an Adafruit display to drive the SainSmart ST7735R. Using this guide, I used his source to successfully drive my color TFT display.

Since getting the display to work, I haven't experienced any bugs or hardware issues. The display has even been left on for two days straight, cycling continually through modified test code.

Building on Hans' work, I modified his code slightly, taking out everything pertaining to the Adafruit's joystick hardware. I also added a few descriptive comments where I thought appropriate, and placed this modified code on GitHub.

Lessons learned

With hardware projects, preparation and research are everything. Inexpensive hardware parts are great for embedded projects, providing a way for independent hardware developers to "level the playing field" with large companies possessing greater resources. On the flip side, cheap useless parts cost money, time, and developer energy -- taking resources away from the important stuff -- making that next great hardware design a reality.

This article is published as part of the IDG Contributor Network. Want to Join?

ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon