Go Down

Topic: My first arduino HMI (human machine interface) LCD keypad panel (Read 4464 times) previous topic - next topic

liudr

Aug 11, 2011, 11:50 pm Last Edit: Aug 12, 2011, 08:45 pm by liudr Reason: 1
Short intro:
HMI is a human machine interface, usually in the shape of a panel with display and keypad for a human operator to interface with a machine, such as changing program parameters. A simple example a lot of us have done is an LCD and a few keys for a simple menu.

I have been on menus, LCDs, keypads, buttons, phi_prompt library etc. for ever (AKA just lately) and an idea hit me: My codes are still too difficult for newbies to use, which require some background in programming. What if I made interaction with LCD and keypad dead easy?!

So someone has to program all the software and connect all the hardware for others (any arduino project developer) to not be bothered with these details, and the same someone loads the program in an ATMEGA328 chip on a panel with hardware so there is no need for an arduino project developer to compile these long codes with libraries etc. The interface has to be intuitive and easy but expandable for veteran programmers.

So, tada! CLICK the picture for you tube videos:



This panel is powered by an ATMEGA328 running arduino bootloader for future firmware upgrade. The panel is connected to an arduino or other MCUs or a computer via serial. The firmware on the on board ATMEGA328 controls the LCD, keypad, buzzer, 4 LEDs, and an optional EEPROM. The arduino can simply dump info via serial to this panel for display purposes and the panel takes care of wrapping long lines into multiple rows, auto scroll like old dos window, and interprets return, back space, space, tab etc. for formatting on the LCD so that the arduino project doesn't have to think about all these details at all. There are also functions to control cursor position, clear screen, turning on and off the display or changing back light commands all in the form of standard ANSI escape sequence, instead of some manufacturer-special code for these controls.

Sensing the keypad is dead easy. On the arduino side, you just wait until a character pops up on the serial and that is a key press, translated into '0' to '9' and such. You can also do multi-tap input on the keypad. The arduino again waits for characters to pop up on serial as the panel does all the footwork of the multi-tap logic. You can make up a simple menu on this panel within one minute of your time:

On arduino, do a few Serial.println() to output a menu on the display. Since when does lcd.println() work? Well, mine does.
Then on arduino, you do a wait till a character gets back to you via serial, then decide which function to run:

Sample arduino code to get a menu up and running:

Code: [Select]

Serial.println("Menu:");
Serial.println("1.Display GPS info");
Serial.println("2.Record GPS info");

while(1) {
 if (Serial.available()) { // Make sure there is a key press
   char response=Serial.read(); // Read key press from phi-panel
   if (response=='1') display_GPS();
   if (response=='2') record_GPS();
   break;
 }
}




I have been on this project for a couple of months now. The hardware was not the most difficult project I did but firmware is a lot to do. I implemented most of the ASCII control codes and ANSI escape sequences plus my 'private' ANSI escape sequence to invoke phi_prompt for interactive lists and else. Here is the webpage:

http://liudr.wordpress.com/gadget/phi-panel/

I have a long manual which I am uploading to this page so you can see what you could do with this panel.

Link to a youtube playlist of all my examples:

http://www.youtube.com/playlist?list=PL17A2C9B777ACFCB0

liudr


liudr

Anyone interested in this panel at all?

You can use your hardware serial port to connect to this panel. Just unplug the panel when you load sketch to your arduino.

You literally user zero arduino pins and gain complete control of an awesome 20X4 display, 16-key keypad with multi-tap, buzzer, and a bunch of LED indicators.

Getting started is dead easy. The following two lines will get a user entry from the panel, just that easy. The user can use back space to erase mistakes too.

Code: [Select]

Serial.println("Delay between recordings (5-3600):"); // Print the question
response=get_int(); // Calls the get_int function to get an integer number from phi-panel


Anyone want to try? I have not formally offered this on any website for sale yet. I have a few PCBs and parts so it is $49.95 assembled and shipped anywhere in the world. Available starting early next week. I can't believe no one has responded to this yet.  :|

Certainly the get_int() but that is quite easy:
Code: [Select]

long get_int() // Understands backspace and enter
{
  char in_char[16]; // Char buffer to store incoming characters
  int i=0;
  int response; // Numerical value of the user response
  while(1) {
    if (Serial.available()) {
      in_char[i]=Serial.read(); // Read in one character
      Serial.write(in_char[i]); // Echo key press back to the panel for the user to see
      if ((in_char[i]=='\b')&&(i>0)) i-=2; // Handles back space.
      if (in_char[i]=='\n') { // The \n represents enter key.
        in_char[i]=0; // Terminate the string with 0.
        sscanf(in_char, "%d", &response); // Get the number from the string
        break; // This breaks out of the while(1) loop.
      }
      i++;
      if (i<0) i=0;
    }
  }
  return response;
}

robtillaart

@ liudr,
Quote
I can't believe no one has responded to this yet.

Its vacation time in the northern hemisphere, and your thread is just one day old. ;)

If you want more customers, you must seduce them: change the title to "Who wants to test a new LCD screen" or "Wanted beta testers for LCD screen"

imho I think this "terminal" is very usefull but also too complete for many applications I see on the forum. It is fixed, in layout/ #buttons etc. Think the power of Arduino is in its flexibility. The question is good "how to make IO easier for newbies" and your screen is a step in the right direction, it has nice features, but have you questioned users newbies etc about what they wanted, and what they need (often 2 different things).

my 2 cents,
Rob




Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

liudr

That's right. I should have asked newbies but newbies don't always know what they want or need. Just read their questions here and there ;)

This panel would also be a nice debug panel for arduino projects or simply used on a PC without any arduino. You can display and scroll through tweets on it as long as you're able to program a PC. Maybe I should appeal to software engineers that don't have much hardware experience. They can write elaborate codes on a PC but aren't trained to connect a simple circuit.

I admit I have not thought about the keyboard being too rigid and offers no flexibility. On the other hand, if I allow flexibility, I don't think I can handle keypads of all kinds. I only had 5 IO left and I used them for the 16 keys and 4 LEDs, plus 4 GP outputs. Most keypads use 7-8 pins.

Maybe I can make a 16X2 version with less keys so it is small enough to integrate into most projects.

liudr

A quick conversion to 16X2 LCD and about half the size:



4"(10cm) by 2"(5cm)

This sure looks more compact. It's just that the display is smaller and won't be as fantastic as the 20X4 displays.


liudr

PCB design for the 16x2 display version is sent out. Will report back about the smaller design as soon as I get the board. This should be sweet! 2 IO pins to control an LCD, buzzer, 4 LEDs, and sense 16 keys at the same time. The smaller display also brings the kit price down to around $30. The bigger display version will be around $40 with option to add EEPROM and Dc regulator.

roypogi

Looks interesting. I have my fair share of menus with LCDs and this could make things a lot easier.
Panucatt Devices

liudr


Looks interesting. I have my fair share of menus with LCDs and this could make things a lot easier.


Yes, indeed. I will be offering some un-assembled and assembled kits on www.inmojo.com in a week, when I get all parts. The smaller version will probably take 3 weeks.

Meanwhile, I also want to trade with other people's old computer processors. I collect them. This is a recent blog post about trading old computer cpus for my hardware of similar value. You can get rid off stuff you don't need so in the future I can open a computer history museum :)

http://liudr.wordpress.com/2011/04/09/exchange/

I have received a lot of these old stuff thru trading with forum friends :)

liudr

I have added one more option:

The keys now can repeat when held. You may adjust this rate in the on board menu.

Now it is available for sale at inmojo.com

http://www.inmojo.com/store/liudr-arduino-and-physics-gadgets/item/serial-20x4-lcd-keypad-panel---phi-panel/

I will add the 16X2 version once I get the PCBs and possibly add a few video tutorials :)

liudr

New development:

Here is the 16x2 variant:



I just finished designing a back pack version of this panel. I've removed the buttons and LED indicators and only have a connector on the back pack to keys and LED indicators.



Options for keys and LED indicators:
1) Up to 8 (push buttons+LEDs),
    Eg. 6 push buttons, 2 LED indicators, or maybe 4 push buttons and 4 LED indicators
2) up to 4*4 matrix keypad (will be modifying my own keypad lib to do this, with multi-tap input and button repeat!!)
3) up to 16 keys in a customized matrix (will publish how to construct) plus 16 LED indicators so essentially a "4*4 LED lit button pad"

Also there is a buzzer pin.

For serial connection, I will add I2C as a future option with a new version of firmware

Hope to keep the cost down to compete with the big dogs. As of now, with the original firmware, it's 22.5K of compiled code, with added features I expect maybe 27K big. I don't know how big sparkfun serLCD firmware is but it can't be over a few K with most of it overhead. LOL

Go Up