Evolution of a Blog

This blog has evolved as you can tell by comparing the title with most of my recent posts. The title should really be something like "The Physical Interface Side of Computing". It will still feature Raspberry Pi and Arduino from time to time but my current hardware of choice is a BeagleBone Black with JavaScript and Node.js providing the development environment.

Monday, February 16, 2015

Arduino Nano : LCD Projects Platform - Assembly

    1. Cut the header strips (10) into four segments of 15 pins each.  It
      is easy to cut these strips to size using a small wire cutter.  Simply
      position the jaws of the wire clipper over the pin where the cut is to
      be made (e.g. 16th pin from end in this case) and squeeze.  The cut
      should be pretty even as it will follow the cavity where the pin was
    2. Carefully solder the four header strips from above to the front of
      the PCB (side with labels).  Make sure that the header strips are flush
      with the PCB and that the Nano will fit into the inner two strips (see
    3. Double check that all the contacts have been cleanly and neatly
      soldered as the display module will cover these solder points once it is
      installed!!! Continuity test with a volt ohm meter would be a good thing.
    4. If you are planning on using the 5v power plug (3) then a two pair
      wire (not provided) should be soldered to the front of the board at this
      time as the solder points for the power plug will also be covered by
      the LCD once it has been installed. Note that the power plug can
      actually be installed after the fact but the ideal case is to do it now.
    5. Install the three pin jumper (6) for the LCD power option.   The
      default is to have the jumper on the PWM side but if you need every PWM
      pin then you can drive the backlight from the 5v power (though without
      brightness control). 
    6. The TFT LCD (2) module should have electrical tape covering the
      metal underside of the SD card slot.  Do not remove this!  If the
      electrical tape is missing then it should be replaced before proceeding
      as contact between the pins coming through the PCB and the metal SD card
      slot is bad!
    7. Install the LCD (2) and the three push buttons (5) on the reverse
      side of the PCB from the headers.   Make sure these items are mounted
      flush to the board and that the buttons are perpendicular to the PCB
      surface.  The bends on the button contacts should be facing long ways
      relative to the PCBs long dimension (Image 3).   It is important that
      these buttons be mounted at the same heights so the protroud evenly from
      the case!
    9. Here are images of the PCB ready to be inserted into the case.
    10. The PCB can now be inserted into the front of the 3D printed case
      (13) with the two wires for the power socket exposed through the power
      socket hole and soldered to the socket (if you are using said socket).
    11. If you are planning on using the six pin header (7) to expose pins
      to the outside of the case it should be mounted now (a little epoxy does
      the trick).   The left most pin of this header, when looking from the
      outside of the case, can be bent down and soldered to the PCB ground
    12. The back of the case can now be attached using the four screws
      (14).   The posts on the back of the case (12) should firmly press the
      PCB against the front of the case.   The reset button extender (15) can
      be used to make it easier to reset the Nano though this has the
      disadvantage of making an accidental reset possible!
Once assembled all pins of the Nano are available via the two headers.  Note, however, that a number of pins are used by various functions!   The pins that are available without caveat are D2, D3, D6, and D7 as well as pins A1 to A7.  The serial port pins, D0/Rx and D1/Tx are also available.  D5 can be available if you use jumper the Backlight to use constant 5v lighting rather than variable PWM lighting from pin D5.  Pins D4 and D12 can also be available but only if the SD Card functionality is sacrificed.

    Sunday, February 15, 2015

    Arduino Nano / LCD Projects Platform - Overview

    The "Arduino Nano / 1.8" TFT LCD Projects Platform" consists of a 3D printed case that wraps a custom designed PCB on which is mounted an Arduino Nano, a 1.8" TFT LCD with an SD Card Reader, and three push buttons which are exposed to the front of the enclosure.

    This kit is intended for someone that already has an Arduino based project in mind or underway that can benefit from a compact and flexible package that provides a small LCD, a user input capability, an SD Card Reader, and access to the Arduino's pins (of course).   It could also serve as a platform for a new Arduino user to experiment with the LCD display and SD functionality.
    The PCB is designed such that headers can be used to access all of the pins of the Arduino Nano for jumpers.  Alternatively the solder points for the header can be used to directly connect leads.   The enclosure is designed to allow for either a six pin header through the case or the void for that header can be used for a ribbon cable.  There is also a port for a power connector.
    The Nano shipped with the kit comes loaded with a program demonstrates the use of the TFT LCD, the SD Card Reader, the three buttons connected to a single analog pin, and a Temperature Sensor that is provided with the kit for purposes of this example (as well as to illustrate general capabilities of the enclosure).

    More about this project can be found in these posts:

    Parts List
    Demo Software

    There is also a video overview on You Tube:

    Arduino Nano / LCD Projects Platform - Demo Software

    The Arduino Nano shipped with this kit comes with a demo program already installed that assumes you have connected the enclosed DHT-11 temperature and humidity sensor with the data lead connected to digital pin 3 of the Nano.   The included jumper wire can be used for this purpose.   If you have not installed the externally facing six pin header then the jumper wire can be run through the case using the slot provided for that header.

    The demo program ilustrates the use of the TFT LCD, the SD Card Reader, the three buttons connected to a single analog pin, and a Temperature Sensor that is provided with the kit for purposes of this example (as well as to illustrate general capabilities of the enclosure).
    The program displays a menu that allows for selection of four functions:
    • Display Current Temperature and Humidity
    • Display Historical Graph
    • Adjust Backlight (with setting saved to EEProm Memory)
    • Close Log File and Stop
    Note that this is a pretty large sketch and that it consumes 97% of the Nano's memory.   This is probably (at least partially) due to coding techniques that could be improved, however, more memory can be made available if the bootloader is deleted from the Nano with programming of the Nano then done via the ICSP pins which are exposed through the enclosure.  This gets 2K back but is an advanced topic!

    Link to Source Code

    Arduino Nano / LCD Projects Platform - Parts List

    1. Two layer Printed CIrcuit Board (PCB)
    2. 1.8" TFT LCD with SD Card Reader/Writer
    3. Power Socket
    4. Arduino Nano
    5. Pushbuttons
    6. TFT LCD Backlight Jumper
    7. Six Pin Header (can be used to exposing connections through the case)
    8. DHT-11 Temperature/Humidity Sensor (for demonstration project)
    9. Three Connector Patch Cable (for demonstration project)
    10. Four Sixteen Pin Headers (once broken into pieces, used to mount the Arduino Nano and/or to expose its pins)
    11. Resistors for three buttons on an analog pin
    12. Back of 3D Printed Case
    13. Front of 3D Printed Case 
    14. Screws for Case
    15. Nano Reset Button Extender 
    Below are the parts needed for to assemble an Arduino Nano/LCD Projects Platform assuming you have purchased the PCB and printed your own case but are sourcing the rest of the parts yourself:

    ITEM eBay Link (UK) Search Terms
    1.8" TFT LCD with SD Card Reader Link 1.8" Serial SPI TFT LCD Display Module +128X160 PCB Adapter Power IC SD Socket
    Power Socket Link 2.1mm x 5.5mm Round Panel Chasis Mount Female Socket DC Connector Jack Plug
    Arduino Nano Link USB Nano V3.0 ATmega328P 5V 16M Micro-controller Board For Arduino
    Pushbuttons Link Quality Momentary Tactile Push Button Switch SPST Miniature/Mini/Micro/Small PCB
    Six Pin Header Link Stackable Si Pin Header for Arduino
    Breakable Headers Link Gold Breakable 40 Pin Header Male Female 2.54mm Socket Connector Way SIL Single
    Resistors Link 0.25W Carbon Film Resistor 10kΩ
    DHT-11 Link DHT11 Digital Humidity & Temperature Sensor
    Screws for Case Link Stainless Steel No2 x 1/2" Pozi Countersunk Self Tapping Screws M2.2 x 13mm
    Backlight Jumper Link 2.54mm Circuit Board Shunts Short Jumper Cap
    Connector Patch Cable Link Male to Female Jumper Wire Ribbon Cable Pi Pic Breadboard Arduino

    1. The links are from the eBay in the UK and may not work with the passing of time.  Hence the search terms which should return the right product regardless of what source.
    2. The Arduino Nano is shown as a China Clone but you can go more expensive!  Remember that a lot of the clones do not have a bootstrap loaded.
    3. The "Breakable Headers" are used as the source for the four 16 pin headers for the Arduino -AND- for the three pin Backlight Jumper (female for the former and male for the latter).
    4. There are a number of different 1.8" TFT LCD modules out there.   The only one that fits the PCB and case are the ones marked with "HY-1.8 SPI" below the display.

    Monday, August 25, 2014


    Printer stopped working and on a little examination this is what I found.  Not sure yet what happened but replacing the RAMPS with new connectors has the printer back and happy.

    Tuesday, July 15, 2014

    Heat and Gas Monitor / Switch

    This device was originally designed to monitor a 3D printer for temperature or gas (e.g. smoke) above a certain threshold at which point the printer would be powered down.   The circuit consists of an Arduino Nano connected to a temperature sensor and a gas sensor.   Two LEDs and a buzzer provide feedback.  The circuit drives a relay that can close the PS_ON circuit of an ATX type power supply (or a relay that is part of the power supply circuit for the printer).

    There are two different boards with one being 50x50mm that would have the relay mounted off the board as shown in the picture to the right.   The two sensors are also mounted off the board as is the buzzer (upper right of photo).

    The other board configuration is 50x100mm and has room for the relay on the PCB.  The relay could be part of a power supply circuit (DC or even AC) but the PCB is really designed to be part of an PS_ON circuit of an ATX power supply as it has an bypass switch that can be used to close that circuit.

    Both of the boards are available in a kit form as there are a wide variety of ways that they could be mounted and as many ways to connect the board to sensors.

    The PCB also has a connection point for the serial port of the Arduino for diagnostic information output by the sketch that drives the monitor.

    As stated above, the monitor was designed for a 3D Printer but it could be used to monitor just about anything for heat and gas where a relay needs to be triggered.  I used the MQ-2 sensor looking for smoke but other MQ sensors could be used for other gas types.

    Below is a documentation index for the Heat and Gas Monitor / Switch PCB:

    Part 1 - Introduction
    Part 2 - Hardware Configuration Options
    Part 3 - Operation
    Part 4 - Software Configuration
    Part 5 - Assembly

    Monday, July 14, 2014

    3D Printer (RepRap) Monitor - Part 5 - Assembly

    Choosing the Right Board

    The larger board allows for a relay to be mounted on the board itself.   This is the configuration that works best for a power supply, such as an ATX, that has a "PS_ON" (or switch on) circuit.   The larger board could also be used for a single relay, of sufficient amperage, that provides power via a single bus.   However, DO NOT wire the "PS_ON" connection on the PCB to anything but a PS_ON circuit!

    Choosing the Mounting Location

    Two examples of mounting are shown here though others are certainly possible.  The major question will be one of where the two sensors need to be located relative to where the PCB can be mounted.   If the PCB can be mounted where the sensors need to be located then the sensors can be surface mounted on the PCB.   If not then leads will be required to connect the sensors to the PCB.   Likewise the monitors LEDs, reset, and bypass switch can all be surface mounted on the PCB or run remotely depending on placement of the PCB.

    Surface Mount or Headers

    Two strips of breakable headers can be used to provide mounts for most of the components and connection points on the PCB.   This can allow for easy removal of the Arduino Nano as one example. 


    There are solder points on the PCB that expose a number of available pins (including power) on the Arduino Nano.   These could be used for a variety of purposes such as connecting additional sensors and/or relays. 


    Actual assembly is straightforward.   Either solder the components (or leads) to the board in the places marked or solder on the appropriate headers!  Header strips can be easy broken into the proper lengths using a small wire cutter positioned on top of the pin where a cut needs to be made.  A pin is lost with each cut.  Edges can be sanded to make a smooth end to the header.

    Polarity and/or Pin Positioning

    The short lead on the LED is the ground.   The PCB shows how the Nano should be mounted as it does for all of the components and connections.  The reset button should be mounted as shown by the picture to the right.

    The larger PCB provides a place where a relay can be mounted.   Small cable ties are provided for this purpose.   The larger PCB also allows for a bypass switch that mechanically closes the "PS_ON" circuit assuming that circuit is connected to the PCB.   Do NOT connect anything but a PS_ON circuit to the PCB.