Last Change
25 May 2000

HAT- Description & Operation


About Me

Light Dimming
Rotary Encoders
TI Calculators
Power Supply
LCD Projects




Email Me

[News] [Description] [Operation] [Future] [Pictures] [Code] [Schematic] [I want one!]


This is the beginning of a home automation terminal. I will have one in each room of my house and on it users may change the room temperature, alarms & timers, get the outside temp, pending weather, email and phone message info, etc.


  • PIC16F876 - Digikey (was 16C66)
  • 2x16 LCD (4-bit interface with LED backlight) - MPJA.COM
  • 3x5 keypad w/ project box - Radio Shack
  • MAX232A RS-232 converter
  • Speaker or piezo
  • Thermister
  • Misc. resisters, diodes, caps, switches & buttons, wires.


This is currently a dumb terminal. All RS-232 communications are routed directly to the LCD except for the byte 0x1B (27 decimal, ESC. I will use 0xHH to specify hexadecimal number HH) and the byte which follows 0x1B. This command specifies that the next byte be sent to the LCD's instruction register. See one of the many LCD FAQs and tutorials for more information on the instructions the LCD can use. If you send 0x1B twice, then the HAT checks the temperature and sends the two-byte count back. To create the display below, the following is sent:

  1. 0x1B 0x01 (clear display, go to line 1 position 1)
  2. "Micro Basics HAT" (sent as ASCII text, quotes not sent)
  3. 0x1B 0xC4 (position cursor second line, 5th character)
  4. "Automation"

Some serial to LCD converter chips dumb down the interface so the user can't access the instruction and data registers. While most of the LCD functions are still available, I feel more comfortable working at the lower levels. I will, however, make one program which does that for those who don't like this kind of interface.

The only information that comes from the HAT now are key presses and the temperature. They are de-bounced, and sent as a byte to the computer, button 1 sending 0x01, button 2 sending 0x02, etc. When a key is pressed, it sends the key once.

books03.gif (331 bytes)See the book Serial Pic'N for info on serial communications on the PIC. Great book!.

[News] [Description] [Operation] [Future] [Pictures] [Code] [Schematic] [I want one!]

Everything on/in this site is copyright Adam Davis, 1999-2000, except where otherwise noted
[an error occurred while processing this directive]