RFID-activated High-Current Power Supply Switch

More details forthcoming.

Notes: 2N3904 transistors were replaced by ones with a much lower VCE voltage. The 220uF decoupling capacitor is critical to avoid odd slow powerup oscillations (likely due to relay inductance).

Schematic at EasyEDA

PDF schematic

The enclosure is a Hughes SatTV box I bought at a thrift store for #1, tossed the board, and saved the power supply for a future project.

What this does: allows an RFID reader to switch the power on a 12V power supply that sources about 20A.  An automotive relay is used to switch the output of the power supply. They keypad activates the relay, and the relay uses a latch configuration to keep the relay on after they keypad output goes low again.

This would be a very simple circuit if not for the fact that the keypad has a power-on glitch (output is activated for about a second), and the power supply whose output is switched is also used to power the keypad! The solution is to have two transistors in series switch the relay switch — one transistor is controlled by the keypad, the other by a 555 timer circuit that does not go high until about 7 seconds after power is turned on.

Finally, the switched output is also tied to a 12V automotive indicator lamp, to remind users that the power supply is on.  The entire system is turned off by just turning off the power supply.

 

 

Posted in Uncategorized | Leave a comment

Backslash line continuation in code comments

I spent several hours this weekend tracking down a bug that highlights something I never knew about GCC (and the Arduino IDE, which uses GCC). At first I was inclined to blame the limited Arduino IDE, but that in itself based on GCC. So I replicated the behavior using command line GCC on a the code below, on both Linux and a Mac.

Compile and run the following code in GCC:


#include <stdio.h>

int main()
{
printf(“Hello Line 1\n”) ; // this is a comment
printf(“Hallo Line 2\n”) ; // comment with back \
printf(“Hullo Line 3\n”) ; // This line will not print – try it!
printf(“Hillo Line 4\n”) ; // last line
}

Line 3 does not print!

As a long time UNIX user, I get what is going on — the backslash forces a line continuation — so line 3 is effectively considered part of the comment on line 2!

But why does GCC parse this way? C/C++ already doesn’t care about line breaks and continuations, since all parsing has well defined delineations.  In fact, // is an “exception” that doesn’t require a matching terminating delineation — it is the line feed.  But the norm is that it is only used for one-line comments.  Except I guess those one-line comments can be continued on the next line …

I came across this issue while editing/debugging a font set and display library for an Arduino display project. I am posting this in case someone else ever tries to google the answer.

Posted in Uncategorized | Tagged , , | Leave a comment

Arduino Class Sunday July 24 2016

This is a reference post for the Intro Arduino class I am teaching at Decatur Makers on July 24, 2016, from 6pm-9pm.   See the Decatur Makers website for cost and registration info.

Getting Started with the Arduino!

Low-cost user-friendly microcontrollers have made it possible for anyone to quickly create small electronic projects.  Many DIY projects use microcontrollers.  This getting-started session will introduce users to the Arduino system and provide hands on activities with a low cost kit of electronic components, as well as your own Arduino (open hardware clone) to take home.  

What we will (try to) cover:

Code for class (the LCD display uses the stock code from the LCD display demo)

  • LCD display will use the standard arduino.cc tutorial code above. CONNECT RW TO GROUND.  This is not stated, though shown in the diagram.
  • IF TIME — analog reading, using stock arduino.cc tutorial (AnalogInOutSerial) and we will modify to demonstrate plot monitor

What you need to bring — a laptop computer.  Windows, Mac, or Linux. Macs sometimes have problems with the drivers (see below).

What you will receive! — an Arduino Uno (clone), breadboard, ~20 jumper wires, ~10 assorted colored LEDs, assorted resistors (10 each of 220/1K/10K/100K Ohm), potentiometer, ~5 pushbuttons with caps, 16×2 LCD display

BEFORE the class

These Arduinos use the CH340 USB serial driver.  You need to install that driver on your computer.  Follow these instructions from Instructables.Com.

If you have not done this, please arrive at the class 45 minutes early.  Based on past experiences, it works fine for most, but there are always a handful of Windows and Mac computers where the installation requires some kicking of the tires.

Reference Material

http://www.arduino.cc is an excellent reference.  It contains an online reference guide to the language and programming environment, and explains each of the example sketchs (programs) built into the programming environment.

All the components in the kit provided are standard components used in many electronic projects.

Adafruit (http://www.adafruit.com) and Sparkfun (http://www.sparkfun.com)  are two common online companies to buy components and kits for microcontroller-based projects (such as LCD displays).  These companies also often have tutorials on their website for each of these components.  eBay is another place to buy many of these components — asian manufacturers often sell and ship direct for much less money than US or European manufacturers, with the tradeoff of a longer shipping time and unknown documentation.

Fixing Driver Issues

Some OSX users had trouble.  Seemed to be fixed by

Additional Code

Here is my sketch for a CW  (morse code) beacon/message sender.  (ZIP file) You can change the #defines for your desired words per minute and the outgoing text, and the program will loop and key the message at the interval specified in the code.

Posted in Uncategorized | Leave a comment

Tontec 480×320 touchscreen display with Raspberry Pi

Last December, I purchased a Tontec 480×320 touchscreen display for use with a Raspberry Pi.  Complete with case (amazon link).  I bought it along with a Raspberry Pi Model B in order to play with software-defined radio (SDR), motivated by the FreqShow example at Adafruit.  In fact, I wanted to get this example working.

But the display sold by Adafruit is not the display I bought, and I found a lot of online questions trying to get the Tontec display working with Raspberry Pi.  X windows applications worked, but the pygame library returned errors, and I tracked it down to the ability of the distribution I had installed to work with the graphics (not X windows) mode.

After several hours and lots of installs and reinstalls, the following two steps worked to get the Tontec display working.  Note that this was as of December 2015, and maybe jessie has changed by now.

Now the instructions of the example at Adafruit work.  I tried taking a short-cut and installing rtl-sdr from a package using apt-get — it did not work quite right.  The instructions on adafruit (download and compile from github) worked.

Tip: I don’t like the Pi automatically booting into X windows.  It is annoying.  You can disable it with sudo systemctl disable lightdm.service.  If you want to manually get X windows started, you can always run /etc/init.d/lightdm (start | stop) to do so.

 

 

Posted in Uncategorized | Tagged , | Leave a comment

Serial communication with a Kenwood TS-570D

I am setting up an amateur radio station at my local maker space, Decatur Makers.  Our transceiver is a Kenwood TS-570D.

I have spent a lot of time debugging how to get serial communications working between the Kenwood and a computer. Here is what I have learned. I have duplicated these results with two different computers (a Mac and a Linux box).

  • The Kenwood connector is male.  Odd but true.  You need a straight through female-female DB9 cable to connect to a typical 9 pin serial port.   Some gender adapters and female-female cables are configured as null modem cables, so be sure.
  • No handshaking or hardware/software flow control; BUT
  • The RTS (request to send) pin must be set high on the computer for the Kenwood to respond.  It will still receive commands if the RTS is not set, but not send responses.
  • The maximum baud rate that works is 4800 (8-N-1 or 8-N-2). Nothing faster worked.  Online forums confirm similar results.

When I do all the above, I can successfully open a terminal window and send CAT control commands to the radio.  If  you have never done this, these commands are the basis of amateur radio – computer communication for control.  Examples:

  • Send FA; The radio will return FA00007123456; — where the long number is the radio frequency in Hz.
  • Send FA00007121321; and the front panel of the radio will switch to 7.12132 MHz (radio does not display last digit, but it is stored)
Posted in Uncategorized | Tagged | Leave a comment

KX3 as a (good enough) antenna analyzer

So I am working on a DIY antenna analyzer/impedance meter.  But I need to validate my design against a known antenna analyzer.  I do not own one.

But I do — my Elecraft KX3 can calculate SWR.  If you know the menus, you can bypass the tuner, press/hold the TUNE button, and read the SWR. The Android app KX3 Companion does this to plot a simple 5 point SWR calculation (the author, Andrea Salvatore IU4APC, writes a lot of great Android amateur radio apps – see her KX3 companion page).

The KX3 has a mode where just about any button you can press or menu option you can change can be controlled via over its serial/USB interface.  So why not write an app?  So I did.  It took a lot of trial and error — reading the SWR from the display was tricky, as was the ordering of some of the command and picking an appropriate settling time.

My finished program is kx3swr.py.  It is written in Python.  Use of this script requires that the PySerial, ArgParse, and MatPlotLib Python modules are installed. Assuming you change the path to the serial device, I expect it will work on any platform (I developed it on OSX).  The final version is run from the command line but fully featured, and incorporates built-in band lists for the non-WARC bands plus 30m, and outputs a text list as well as graphical plots, with the ability to suppress either.

Disclaimer: this is freely distributed software, untested on your hardware, that will control your radio’s transmitter.  Use at your own risk!

Here is the command line help.

usage: kx3swr.py [-h] [-noplot] [-notext] [-waittime WAITTIME] b [b ...]
positional arguments:
b band [band band ...] (choose 10 20 30 40 80 160)

optional arguments:
-h, --help show this help message and exit
-noplot do not generate plots
-notext do not generate output text
-waittime WAITTIME change default settling time in seconds after each
measurement (default is 2.5 sec)

Here is the text output of a 20m sweep of my B&W AP-10 (whip with load coil and counterpoise) and the resulting plot.

$ ./kx3swr.py 20
running sweep for 20mband 20m
14.0 1.7
14.025 1.5
14.05 1.4
14.075 1.3
14.1 1.2
14.125 1.2
14.15 1.1
14.175 1.1
14.2 1.2
14.25 1.3
14.3 1.6
14.35 2.0

20m SWR plot creation

swr20m

The SWR can only be read to one decimal place, since it is extracted from the display of the KX3 itself.

Future plans include another command line option to sweep a start and end frequency with a specified increment.  I have never used ArgParse before, but it makes command line parsing and documenting really easy. Now that I know how the serial stuff works, I’d like to put this on a microcontroller system to take into the field with me.

I have learned a few things by having this.  For example, I operate QRP from a condo with a whip and load coil on my balcony.  I usually set the coil lead by listening to the volume, and there are usually two adjacent windings that sound about the same.  From this analysis and running some sweeps, I learned that one winding of the coil changes the resonant frequency by almost 400 kHz, and that moving the lead a 1/4 turn can shift the resonant frequency by 100 kHz.  So picking the right tap by ear alone might only get me within +/- 400 kHz of my desired resonant frequency. I also learned the importance of counterpoise length and positioning.  The above is the best case after some playing with the counterpoise and lead tap location. The KX3 has a great tuner, but a more efficient antenna is a more efficient antenna, especially for transmitting QRP!

Theory of operation: For those who are curious, the general logic of the program is as follows:

  • saves your frequency and operating mode
  • puts the antenna tuner into bypass
  • for each band
    • switches to that band and the initial frequency in the list for that band
    • sweeps a range of frequencies, and for each frequency
      • measures SWR by the TEST button, turns off transmitter 2.5sec later
      • extracts SWR from the display reading
  • restore original frequency and operating mode
  • return tuner to auto-tune
  • print output
  • plot output

This program required a lot more effort than the finished code might suggest.  There was a lot of trial and error using the KX3 Utility in command mode and sending commands, figuring out how the KX3 responded.  Sometimes order and timing matter.  Something theoretically straightforward like reading the SWR from the display turned out to be surprisingly odd. The KX3 Programmer’s Reference was a critical reference for all of this, and many thanks to Elecraft for publishing such a document.

Posted in Uncategorized | Tagged | 1 Comment

I2C LCD Shield for Arduino – save wires!

The standard character-based display used on many Arduino projects are based on the Hitachi HD44780 chip.  They are available quite inexpensively, as little as $2.59 on eBay shipped from China for a 16×2 display.  Sizes go up to 20×4 (what I usually buy), and common modes include black on green, some with backlight, and white on blue, which requires a backlight.  These displays are supported by the native LiquidCrystal library built into the Arduino LCD.  Using these displays requires, at a minimum, 6 data pins, on the Arduino.  That can eat up a lot of data pins if you are using other items.

I2C to the rescue!  I2C is a 2-wire serial communication protocol also natively supported by the Arduino.  For a little extra money, you can purchase I2C displays with a “backpack” attached that reduce the display down to an addressable I2C device, and all is needed is a clock and data line attached to pins A4 and A5.  You can make your own with shift register.  You can also purchase the backpack separately.   Several exist, based on a variety of chips. The most common (and the subject of this post) are based on the PCF8574 (and variants PCF 8574A and 8574A) I2C shift register.

In theory, all you need to do is:

  1. Connect power, ground, and the two wires
  2. Identify the I2C address of your display
  3. You are up and running!

In practice, #2 and #3 are a time-consuming trade-off.  Identification of the I2C address is not hard — if not provided by the vendor, there are many Arduino sketches out there that will scan your I2C bus and identify the address of any device that responds — it has worked on the 3 I2C devices that I have.

The hard part, and the reason I am writing this blog post, is the frustrating aspect of finding the right library to use, and the correct pin configuration for your particular LCD backpack.

If you purchased your backpack from a vendor like Adafruit or Sparkfun, they have a library on their website.  And it will work, and they will help you (as well as the online community).    The downside of these libraries is that they make affect your use of non-I2C LCD displays.

If you purchased your I2C LCD display or backback from a cheap vendor on eBay or Amazon, you (like me) likely have no documentation.  Not only is the address unknown, but the exact configuration (what pins on the shift register are connected to the LCD display, issue with how the enable and backlight are configured, etc) varies from manufacturer to manufacturer.  To make it more complicated, there are MANY LCD I2C libraries out there, and they vary in terms of how much they give you controlto specify these pin configurations vs making assumptions.

I got to a point where my display was powered and visible to the I2C scanner, but various libraries I tried were not working.  I probed the pin connections and verified there were no bad solder joints, and I even bought a 2nd LCD I2C display to compare (different vendor) and had similar problems. I became convinced that the problem was getting the library to match the exact pin configuration between the 8574  chip on the backpack and the LCD display, and a few assumptions about other LCD pins.

I found a solution.  It works!

I highly recommend using this LCD library.  I like that it covers all possible displays and interfaces, but it also retains sufficient flexibility to change the pin configuration to work with your display. It is also well-documented and actively maintained. It replaces the native LiquidCrystal library in the Arduino IDE, but works fine with my non-I2C displays.  The only downside, at least on my Mac, is that by replacing a built-in library, it means any upgrade to the IDE means re-replacing the library.  Installation is a bit tricky, but this is true for most replacement Arduino libraries.

I also highly recommend reading this post.  This post identifies 3 common variants of the 8574 backpack, and how to configure the aforementioned library to work with each variant.  My two displays were of the #3 variety on that page, and that is what ultimately worked for me.

Once your backpack is working, I recommend you also read my blog post about using a potentiometer to control the backlight power.  The jumper on the backpack just turns the backlight on and off.  Putting a potentiometer between 5V and GND and using the wiper to control the display backlight can reduce current draw from 30 mA to as low as 4 mA with no loss of readability.

Ultimately, this is a tradeoff of time and money.  You can pay a lot less on eBay, Amazon, Alibaba, etc for a low-cost display, and devote some time to getting them to work (and you may learn something, too!)  Or you can buy something from a company like Adafruit or Sparkfun, use their provided libraries, and be up and running.  You will pay more, but it will work out of the box (you hope).  For me personally, I wanted a particular display configuration they did not sell, and I found their libraries more limiting (although they work with what they sell!) than several of the open-source libraries out there.

I am somewhat surprised, given the utility of I2C devices, that there is not a more consistent standard for I2C LCD displays (this would not be hard), enforced by built-in support to the Arduino IDE LiquidCrystal library.  At least, that is what I would do if I controlled the IDE development 🙂

These are really notes to myself, but I hope someone finds them useful.  For reference, here are links to the displays I actually purchased on eBay and Amazon.

eBay 20×4 LCD I2C display white-on-blue – $8.49 (including shipping)

Amazon 20×4 LCD I2C display white-on-blue – $5.49+$2.49 shipping

I particularly like the eBay vendor frentaly since they offer prices similar to those shipped from Asia, but are located in the US in an Atlanta suburb, so shipping is quite fast! (especially since I live in Atlanta).  Not a paid endorsement — I just like their prices and location due to fast shipping. I cannot speak to product quality beyond this display and another I2C backpack I have purchased.

Next up — I am trying to figure out how possible it may be to configure one of these I2C interace boards to work with an ADS9850.

 

 

 

 

 

Posted in Uncategorized | Tagged | Leave a comment

Arduino Class Sunday Dec 13

This is a reference post for the Intro Arduino class I am teaching as part of the Atlanta Radio Club’s 2nd Sunday Tech series.  More info on the series at http://secondsunday.tech.

Getting Started with the Arduino!

Low-cost user-friendly microcontrollers have changed the face of amateur radio! Many radios and DIY projects now are microcontroller based, and the relationship between hardware and software has radically changed.  This session will introduce users to the Arduino system and provide low-cost kits for getting started.  Capabilities of the Arduino will be demonstrated, and users will have a chance to get started.  A simple CW keyer application will be demonstrated using an Arduino and an optoisolator.  Others are invited to show up and demo their projects.

When: Sunday Dec 13, 2015

Where: Decatur Makers — located in the gym building behind the First Christian Church, Decatur, 605 W Ponce de Leon Ave

Questions: contact Rob Butera (rob@butera.org, KM4MK)

I have assembled kits for this class from bulk purchases.  Each kit contains the basics for getting started, plus a few components (optoisolator, audio) that may be helpful for simple ham projects (like a CW keyer).  Cost is $13 per kit (cash or e-payment, like PayPal). Email me for availability.

Each kit includes:

  • 1 push button switch
  • 2 10K resistors
  • 2 1K resistors
  • 1 10K potentiometer
  • 1 817C optoisolator
  • TRS socket for audio cable
  • 2 red LEDs
  • 1 small breadboard
  • 20 jumper wires with pins
  • Your choice of either:
    • Arduino UNO with  USB mini cable, 9V battery adapter w DC socket plug OR
    • the smaller (but similar) Arduino Nano with USB mini cable, 9V battery adapter with lead wires

What is the difference?  They differ in the form factor, the UNO is the most common Arduino and good with shields (expansion boards). The Nano (my favorite) is a lot smaller but ideal for finished projects. They have nearly identical functionality and the same microcontroller.

What you need to do before class if buying a kit

These Arduinos are Chinese clones that use the CH340 USB serial driver.

  1. Bring a laptop computer
  2. Install the USB-serial driver for the C340G chipset.  A lot of overseas sites (Chinese, Russian) have links to it.  Some have viruses. I have use this drivers from this site without a problem for over a year on my Mac (also Linux and Windows) http://www.5v.ru/ch340g.htm
  3. Install the Arduino software from http://www.arduino.cc for your computer (Windows, Mac, Linux)

Reference Material

http://www.arduino.cc is an excellent reference.  It contains an online reference guide to the language and programming environment, and explains each of the example sketchs (programs) built into the programming environment.

All the components in the kit provided are standard components used in most electronic projects.  The optoisolator (4 pin chip that says “817C”) is the one item you may not see in many Arduino tutorials — you can find a data sheet for it (and many other integrated circuits) at this web site: https://arduino-info.wikispaces.com/Popular-ICs

Adafruit (http://www.adafruit.com) and Sparkfun (http://www.sparkfun.com)  are two common online companies to buy components and kits for microcontroller-based projects (such as LCD displays).  These companies also often have tutorials on their website for each of these components.  eBay is another place to buy many of these components — asian manufacturers often sell and ship direct for much less money than US or European manufacturers, with the tradeoff of a longer shipping time and unknown documentation.

Post-Meeting Notes — followup info and ideas for the future

  • Some OSX users had trouble.  Seemed to be fixed by
  • Here is my sketch for a CW beacon/message sender.  (ZIP file) You can simply change the #defines for your desired words per minute and the outgoing text, and the program will loop and key the message at the interval specified in the code.  There are MANY fully featured CW keyers out there, such as this one.
  • Have an earlier start time (1 hour) for people who have not gotten the serial driver to work on their computer yet.  Send an email out on what they should see if it is properly installed.
  • Next year — makerspace will have a lot of fully functional computers — use those!
  • Component changes — better TRS audio adapter, pushbutton that is more breadboard friendly
  • Consider two classes, one on basic breadboard electronics, the second one then using it with the Arduino
Posted in Uncategorized | Leave a comment

Arduino + AD9850 DDS

I’ve been playing with connecting an Arduino to an AD9850 DDS waveform generator. This is a DDS chip from Analog Devices that is capable of outputting a sine or square wave at frequencies up to 40 MHz. There are two variants of the popular low-cost boards available (such as on eBay) that provide a plug-n-play implementation of this device.  While it is easy to find the documentation for the AD9850 chip itself, it is harder to find pinput/spec information about the board itself.

This post from NR8O’s website provides most of what I used to get up and running, including using his test code – I have the same device from eBay.  This library may be useful in the future, which is an Arduino library for controlling the AD9850/1 chips.

dds-pins

Here is one page with the pinout. A copy is shown above (in case it ever goes offline).  From online reading, I believe the difference between the two sine and square wave outputs is the presence of a low-pass filter.

So how accurate is is?  When running at 20 MHz, and looking at an auto-frequency calculation on my scope, every measure I pull up is within 10 Hz of the specified frequency, and usually less. This is not a statistical sampling, but suggests the DDS is pretty solid — a lot more drift would be visually noticeable on the scope.

It appears that SineWave1 is unfiltered, while SineWave2 is filtered. At lower frequencies (like 100 kHz), the Sinewave2 output was much cleaner (less spurious scope triggering), at higher frequencies, the waveform was clearly attenuated. In theory the output is a 1Vpp sine wave, with min/max voltages at 0V and 1V. Here is the output I obtain at different frequencies (these are not average values, but “eyeballed” from the instantaneous frequency measurement. My Digilent scope only samples at 100MHz, so there will be some error at these high frequencies). The DC value remained about 0.51V at all frequencies.

Freq (MHz) Sine1Vpp Sine2Vpp
0.1 1.06 1.06
1.0 1.03 1.03
10.0 0.84 0.70
20.0 0.84 0.53
30.0 0.80 0.41

Further info on the output filter. At 1Mhz, Sin1 has its 1MHz peak at -10dBV, and the odd harmonics (not sure why just odd — crossover from the square wave generation?) have peaks at -50 dBV. The noise is at about -70 dBV. Meanwhile, Sin2 at 1 MHz has similar specs and a total lack of harmonics.

The square-wave output is 5Vpp in amplitude, and looks OK up to 1Mhz. It is harder to evaluate on my 100 MHz scope at higher frequencies (at 10 Mhz, that is only 10 samples/cycle) and there’s no cycle-triggered average feature.  The square wave has prominent odd harmonics (base at 3dBV, 3MHz peak at -2dBV or so, 5MHz peak at -3+ dBV and even harmonics at about -40 dBV.  For Square2 the even harmonics are not much more suppressed, but somewhat more at the 15+ MHz range.  The pot on the DDS board is used to adjust the square-wave duty cycle — there does not seen to be a “digital” way to do it.

This makes me suspect how clean of a source this DDS chip may be for RF applications, but we will give it a try since others have.

Important specs on this board for future applications – output sine wave is only ideally 1Vpp, and output is limited to 10.24 mA with the 3.9K value of Rset on the board (I suspect that several designs using this chip online for impedance measurements ignore this fact).

Below is a pic of the current setup with the Arduino Nano driving both an LCD display and the DDS9850 chip.  I am running out of pins, but still need more for both the analog measurements from the analog circuit and the rotary encoder for making selections.

UPDATE: I finally found board documentation here, and here is a locally stored copy in case the original vendor link disappears.

ddslcdscopeshot

 

Posted in Uncategorized | Tagged , | Leave a comment

20×4 LCD display tips — on an Arduino Nano

Using a blog for debugging notes so I can easily refer to it.

LCD displays are quite common for Arduino applications.  I have purchased a 20×4 white on blue backlit display.  Most LCD displays on Arduino are based on a Histachi HD44780U controller chip, and the displays themselves have a relatively standard 16 pin interface.  I am using a Chinese copy-cat Arduino Nano (ATMega 328), and it all works identical to the tutorial pinouts for a standard Arduino.

Things I have learned.

  • The LiquidCrystal library (built in to the default environment) will likely handle all interface needs.
  • Most examples use a pot between 5V and GND to provide a contrast control voltage, and a resistor from Bklt+ to 5V to fix the backlight.  Examples online vary on what these values should be.  Most say to use a 10K pot for the contrast — the datasheet suggests 50K to 100K, and heck, it will draw less power.  I found a 100K pot works just as well as a  with a 10K pot, and find the output voltage needs to be turned nearly all the way down to display the text.  0.7V output is barely visible, comfortable values are 0.4V to 0.3V (lower voltage is higher contrast).
  • I still had trouble controlling the display backlight.  The datasheet says to NOT connect directly to 5V (even though the Adafruit tutorial does so) — it may hurt the display, and it certainly may be a power hog! I connected another pot (22K, it is what I had) configured as a variable resistor, between Bklt+ and 5V.  This provided excellent control of the backlight — the readable settings varied from 1.7K (barely visible) to near 0K (very bright) for this resistor.  A downside of a white on blue display is the constant power to see the text — I think I would like a passive display with backlight next time.  This pot is extremely sensitive — I think a 2K-5K pot would be ideal in the future, or use a 10 turn pot if you have something larger.
  • I measured power consumption to the breadboard with the LCD display as I varied backlight settings.  Super-crazy bright was 30 mA, while very readable and still quite bright was 4 mA.  What a huge difference in consumption!  A barely readable backlight was 2 mA of consumption. The contrast control has a minimal effect on power consumption.  This likely explains why the datasheet says not to connect to 5V — there is visibly little readable difference between 4 mA and 30 mA.
  • These displays require 4 or 8 data lines, as well as the serial (I2C) interface.  It is possible to purchase variants of this display with a “backpack” chip set (soldered onto pads that already exist on the PCB in the back) that make it a true I2C device, with no data lines required.  Other sites online have rolled their own using a 74595 shift register and a transistor.  I need to keep this in mind since this is my first learning step in a project that requires both an LCD display as well as an I2C controlled DDS chip, and pins will be used quickly.
  • I also do not know if the LiquidCrystal library is using the built-in Arduino I2C hardware or implementing the I2C/serial in software.  In a perfect world I’d like both the DDS chip and display running off the same I2C bus to save pins.  But I can tackle this on a future day.
  • This is one of many steps in building an antenna analyzer … stay tuned (pun intended!)

2015-08-23 12.21.06

Posted in Uncategorized | Tagged , | Leave a comment