Saturday, May 14, 2016

invested in a microcontroller board - part 2



This is the following post to a previous post of a blog post series on my venture into tinkering with Arduino microcontroller boards. I have been doing a lot of reading about the Atmel's ATmega microcontroller architecture and programming. I also have been doing sporadic research of all the Arduino compatible sensor shields and breakout boards out there, and I have been itching to start playing with them. Yesterday the $3.99 Arduino Uno compatible board arrived from China.

I immediately sprung into action to take it for a drive. I downloaded and installed the Arduino IDE (Integrated Development Environment) into my Windows 7 desktop machine. First, I have to manually install the driver that is a part of the Arduino IDE download. However the Device Manager reports that the virtual COM port cannot start.

I did a bit of research and realize the cheap Chinese Uno knockoff utilizes a different USB to serial chip so I needed to find the driver for it. Once I have the driver I can now use the Arduino IDE and all is well.

successfully installed the driver for the CH340 USB to serial converter - virtual COM port

the easiest program (sketch) to test the board is a blinking LED

Once I know the board is good I started scrounge the house for something I can starting playing with the microcontroller board. I was very surprised what I managed to find. I found a 9Vdc power supply, a 9V battery clip, my old trusty Radio Shack bread solderless prototyping board, some electronic parts like relays, and even a brand new 20x4 dot matrix LCD display. The LCD display was from circa 1995 so didn't keep my hope high that I can find the datasheet for it, let alone making it work.

without a plug for the 9V input I soldered the battery clip directly onto the board


the back side of the LCD display

some other miscellaneous old electronics

amazing how much fun this $3.99 brings

One possible application for the Arduino Uno is building a oil pressure and temperature gauge set for Isolde. I have been shopping for gauges and parts that are required to do the installation and I found them to be quite expensive for what they are. Additionally I don't want to create a ghetto of gauges. Instead my idea is a multi-function display that can be configured to display different information.

Here are some gauges and parts that I looked at.







When I started searching for similar parts sold directly from China, I found some that are much cheaper. While the cheap gauges are lesser in quality, I decided to order them to see. My thought is I can always just use the pressure and temperature senders.

the adapter plate for Isolde for half the price

it is true; you can buy a oil pressure gauge with sender for just $14 USD shipped

Today I spent a few hours wiring up the LCD display to the Arduino Uno. To my surprise I was able to find the datasheet for the LCD display. Mine is a older version of OMC20481 made in Japan by Optrex. It has a very popular and still available Hitachi HD44780 LCD display controller. What is more surprising is the display is supported by the Arduino LCD library.

When I first power up the LCD and wrote the mockup program, the display has no sign of life whatsoever. My heart sunk thinking there can be all sort of problem with this very old model. It could be the command protocol. I triple checked my wiring and found no error. Eventually I was able to identify the problem. It is the LCD display contrast adjustment trimmer potentiometer setting despite I have tried adjusting it to no avail. It turns out I just didn't think to set the bias so low with the range of 0 to 5V. The display is only visible when the bias is set to circa 0.5V!

Once I have the display, I have to sort out some messaging protocol differences among the many variants of the HD44780 based LCD displays. The other thing that I have to carefully sort out is the LED backlight without damaging them as I do not trust the current datasheet. I was able to power the backlight off the 5V Vcc of the Arduino with just a single current limit resistor.


here is my simple mockup program

here is another iteration of more realistic mockup with a loop of reporting actual ambient temperature using the internal function of the Atmel AVR uP; there are 6 analog inputs

there is no display artifact from the constant update

Of course, the internal temperature sensor is ill-suited for sensing ambient temperature because of the chip's self-heating. It serves more of a curiosity than of practical use except to accurately report the uC's own internal temperature.

Having playing with these, I have no doubt the implementation of a multi-function display for Isolde is extremely easy to do. I am waiting for he micro OLED display to arrive and try that in place of this big LCD display.

my thought is to place a discrete small display where the iPhone is in this photo as a multifunction display

I went ahead and bought a 3-pack of the Arduino Uno because it is so cheap and so much fun.

No comments:

Post a Comment