2015-07-14 21.17.14

Hi, I am Liudr, a Tesla member at the arduino forum at http://arduino.cc/forum/ Most of the forum members are newbies, non-engineer or non-scientist type everyday fellows that are hooked on the simplicity and fun of making cool and functional projects with arduino. There is no shame in asking any basic questions. We answer them repeatedly 🙂 I have started tinkering with arduino since the early part of 2009 and have been an active member of the forum since 2010. This blog is an extension of my activities on arduino forum and my raspberry pi activities. I have contributed to the arduino software with several open source libraries, including phi_prompt, the very first user interface library, and several other ones, Morse code, big fonts on LCD, buttons, etc. I am also a hardware designer. I designed the popular phi-1 shield and phi-2 shield, SDI-12 data logging shield etc. I have also designed and programmed a number of data loggers as consultant.

Arduino is an open-source microcontroller software and hardware system based on ATMEL’s ATMEGA microcontroller family and Processing IDE. Arduino is a perfect system for physical computing and is very friendly to newbies.

In my blog, I mostly log my projects with arduino, raspberry pi, physics with arduino, making printed circuit boards (PCB), my designs, and other electronics-related contents. I am also a computer CPU collector. If you have old CPU’s, like Pentium or older, I’d like to trade with you with my designs!

48 Responses to About

  1. Sean says:

    Hey, I am working on a project that involves and alarm clock and I am using arduino duemilanove to program it on. I came across your website and realized your phi-1 shield was exactly what I needed. However the problem is that when I mount the shield onto the arduino it takes up all of the pins and the alarm clock is not 100% of my project ( I wanted to add a sensor as well). Is there any way to free up some of the pins that are not necessary for the alarm clock ( I would need just 3 digital i/o pins) and if so which ones?

    • liudr says:

      Sean, sure you can free up several pins.
      With all the shield functions in use, you still can use pins 12, and 13 since they’re not used by the shield. Just add jumper wires on the female headers to access those pins like you would do on the arduino without the shield. If you need more pins, yes you can. Say go without the left and right buttons, you can simply ignore the two buttons. They don’t do anything to their respective pins unless they’re pressed. So pin 3 and 11 are free. You will need to remove these codes so these pins won’t be sensed as buttons in my sample code anymore:
      From the main code before setup():
      buttons btn_3(btn_l, LOW);
      buttons btn_4(btn_r, LOW);

      From inside the setup():

      Replace these codes inside the hmi file:

      With these:

      You can also spare the LED, which is digital pin 17 (aka analog pin 3). To do this, go to the alarm_clock file and find void alarm_clock::alarm() function.
      Then within that function, delete all five lines that start with digitalWrite(led,…

      After this, you will have digital pins 3, 11, 12, 13, and 17 free. Arduino has 20 digital pins. The serial commuication/program download takes pins 0 and 1, no buts on these 2 pins. In order to do an alarm clock with LCD and buttons, you will have to use 6 pins on LCD, 4 on buttons, 2 on the RTC chip that keeps the time, and 1 on the buzzer to weak the sleepy head. The rest can be used for other purposes. Let me know if you have more questions.

  2. Madhu Nuggehalli says:

    Hi Dr. Liu,

    I have a question; do you encourage people modifying your library? If yes, what is the best way to get in touch with you?

    Madhu Nuggehalli.

    • liudr says:


      I do encourage other people to modify my library as long as they keep the original credit with the library and don’t use it for commercial purpose. On the other hand, I also take suggestions. For example, I have implemented a memory select_list function as a response to a request. Once I release the new version, it will be able to render a list from memory so you can dynamically construct a list and show it to a user. If you have some suggestions, I’m willing to listen 🙂

      • Madhu Nuggehalli says:

        Hi Dr. Liu,

        Thanks a million for replying… The one ‘big’ modification I had in mind was to add support for the i2c LCD library (Links: http://github.com/ardugo/Ardugo and http://ardugonic.blogspot.com/2010/07/controlling-lcd-display-via-i2c-bus.html) so we can have spare pins to say, add a SD card reader.

        I have an extremely rough prototype that I have ‘designed’; can I e-mail the same to you?

        Madhu Nuggehalli.

      • Madhu Nuggehalli says:

        Dr. Liu,

        After posting this comment, I finished tinkering with your library and successfully managed to have big font work qith the PCFCrystal library.

        However, I cannot seem to understand how you have created the fonts; would you be so kind as to show how you did it?


      • liudr says:


        I have an array of dot matrix describing 3*5 dot matrix font that is quite common. What I did was just making one character space into three “dots” so three character spaces horizontal correspond with three dots, while two character spaces vertical correspond to 6 dots. So every 3 character by 2 character space can display one 3*5 dot matrix character.

  3. Sathishkumar D says:

    Hi Dr. Liu,

    I have been considering the menu library for one of my commercial mini-project based on ardunio. Can you please authorize me for that. Is that have any term and conditions.

    Sathishkumar D.

    • liudr says:

      Thanks for your interest in my libraries. I created them and released them free of charge for non-commercial purposes. If you want to use the menu library for commercial projects, it would make sense to pay a nominal fee so while you are making money, I get some compensation for my work and work on updating my libraries. I would say since most arduino hardware are around $30, I would charge $30 for a license for your unlimited use in commercial products and entitles you to future updates to this library. Please let me know if you agree to these terms. Help me put more efforts towards libraries and benefit more people.

  4. Hi Dr. Liu,

    i’m making some project and i like to use your phi_prompt, but my keypad (4×4), and i can´t use-it with your library, to get one key i just have to call the key like “kpd.getkey();” and the i2c library give-me the key, i try to adapt but i can’t, can you help-me or find a way to cooperate.


    • liudr says:


      I’ve thought about incorporating keypads in phi_prompt and this is the newest development:


      It is a serial LCD backpack that you can simply plug in a 4*4 membrane matrix keypad and type away, with multi-tap input options. Making menus and interactions is also pretty easy. In making this gadget, I’ve written my own version of the keypad library to incorporate two types of keypads, 4*4 matrix keypad (needs 8 I/O pins) and Liudr keypad (needs only 5 I/O pins and operates LED indicators at the same time). My time line to incorporate all these updates to the phi_prompt library is probably Jan 2012. Once updated, the phi_prompt library will be able to accept a number of LCD types (parallel, serial) and a number of keypads or single keys or rotary encoders. I’ll see if I can pull out a preview version for what you may need to merge phi_prompt with a keypad library. I’ll let you know if I can do it soon.

      • Tank you so much for your fast reply and availability, this type of library will be fantastic to have such connectivity, is there any place where I can donate money to help in development?

        Congratulations for the excellent work

      • liudr says:


        Thank you for considering donating to this open source project! As parallel projects, I design hardware that utilize some of my open source libraries so if you want to contribute to my open source software effort, please consider making purchase here for some cool hardware for your project:


        My most recent addition is a serial LCD backpack that directly connects to a membrane keypad so all the sensing and LCD displaying is handled by the back pack and your arduino only needs 2 pins for the full keypad and LCD. Maybe something you can use for your projects.

  5. Hi, Dr. Liu,

    I buy the backpack, but a change de firmware to v1.2 because i don’t find the 1.5 to LCD 20×4,

    where can i found the V1.5 to 20×4 and documentation about the backpack?


    Fábio Costa

  6. Chris says:

    I recently got the PH-2 board for an alarm clock project and am having a few troubles, that I”m sure are newby issues. when I try to compile the test code to write it to the Arduino, I get the message that “boolean has not been declared” coming from the ds1307 library. What I think I”ve figured out is I need to use a previous Arduino version. Am I on the right track her, and if so, what version should I be using? Right now I’m a bit that I put the board together wrong.
    Thank you for any assistance!

    • liudr says:


      Can you read the first portion of the main code and post them here? I want to know which version code you are using. The newest version supports arduino 1.X

      • Chris says:

        ooh, that was part of the problem, I was using the V2, I have now downloaded the V3 but still have issues, not it looks to me like it’s an issue with the buttons library the last error I get is this:
        C:\Users\Johnny\Desktop\arduino\arduino-1.0\libraries\Phi_2_testing_v3/phi_buttons_323.cpp:25: multiple definition of `phi_buttons::phi_buttons(unsigned char, unsigned char)’
        phi_buttons_323.cpp.o:C:\Users\Johnny\AppData\Local\Temp\build8086048639399490355.tmp/phi_buttons_323.cpp:25: first defined here

        I’m terribly sorry if this is just newb stuff, I’m stuck though, my end goal is to make an alarm clock that functions like one of those Philips wakeup lights.
        Thank you!

      • liudr says:

        Alarm clock current version is V6 for arduino 1.x


        Where did you get V2 and V3? I’d like to remove those links. My blog is too big and I may have left a few old links so thanks for finding them, do get back to me where you found them.

  7. Chris says:

    oh shoot, I referenced the wrong version two different programs, I was using the test V3 (When I first asked, I was using an older version of the test) and Alarmclock V6, so I did grab the current software, and no gaps in the blog!

  8. Martin says:

    Hi Liudr,

    I’m new to arduino and to programming. My project is to use the arduino to control a radio scanner with my PC.
    I found the following scheme to hookup the key matrix, (http://benjamintomlinson.com/electronics/arduino_schematic_a3.png) but it had no code with it as example.

    Is it possible to use your library for a project like this?

    Thank you in advance,


    • liudr says:


      That diagram only shows which pins are used on arduino (but for what?). I’m sure if you have a key matrix, you can use phi_interface library to directly sense it or use the phi_prompt library to drive LCD+keypad interaction. What keypad do you have?

      • Martin says:


        The key matrix is inside an old radio scanner. I’ve sorted out which combination of a row and column corresponds to the specific buttons. The Matrix has 4 rows and 5 columns. My meaning is to make a GUI which represents the buttons on the keypad. The Arduino should then be used to simulate the keypress on the keypad. The 4051 multiplexers are used to connect a row and column in order to simulate the keypress. From what I understand, I should write Pin 9 to HIGH continuously, then write it LOW when I write to Pins 2,3,4,5,6,7 in the example scheme.
        As I said, I am new to the arduino and programming, sorry.
        Any help is much appreciated.


      • liudr says:

        I don’t really understand the situation here. Are you simulating key presses so you can use arduino to operate the device that uses the keypad? How are you connecting the keypad/device to arduino? Are you using one of my libraries? Thanks.

      • Martin says:

        Sorry for the poor explanation. The arduino is indeed used to operate the scanner i.e. change frequency’s. So instead of physically pushing a button on the scanner, I hope to do this from a distance via the arduino. The rows and columns of the device are wired via the 4051 multiplexers to the arduino (as in the schematic http://benjamintomlinson.com/electronics/arduino_schematic_a3.png). I don’t have it working yet, the programming of it all is a bit puzzling to me. I’m wondering if it is possible to use one of your libraries, since the keypad basically is used in the opposite way.
        I hope it becomes a bit more clear now ;-).



      • liudr says:

        So my guess was right. Here is what I think:
        You are trying to use Arduino to actuate the buttons but my libraries only sense button states so they won’t help you, unless you also want arduino to sense that keypad.
        Actuating buttons might be easier than sensing buttons, if you don’t mind a little waiting for arduino to actuate the buttons. You don’t need a state machine if you are ok with a bit waiting.

    • Martin says:

      Thanks for your help. So I can only use your libraries for sensing the keypad. I’ll try and figure out a way to get the actuation of The buttons working and save the sensing for later on. I’m sure I will be using one or more of your libraries in my project at some point.

      Thanks again,

  9. Dice says:

    Hi Liudr,
    Is phi-panel Backpack version still available for purchase?

    I’d like to buy few pieces, assembled or just kits, but InMojo charges unreasonably lot for shipment (and ++for every piece!!), at ruggedcircuits it is out of stock.. What would you recommend?

  10. justin tran says:

    Hi Liudr,

    I have a http://www.adafruit.com/products/1268 . How would i get it to display the time using the existing Alarm_Clock_v6 code??

    I’m new to arduino and this is my first ‘big’ project.

    Thanks in advance,

  11. Brendan says:

    Hello Liudr, I’ve been working on a font plugin and font creator application for LCD Smartie for the past few months.
    It’s a free and partially open source effort for the LCD Smartie community, designed to make it easy for people to create and contribute their own custom fonts to display on character LCD’s.

    I stumbled upon your font design Phi_big_font while researching on Arduino and really like it and also appreciate how difficult it is to create a nice looking font using only 8 custom characters having made a few myself.

    I am writing to ask if you would mind me including your font as the first user font contribution with credit to you of course and (if the mods allow) perhaps a link back to your blog.

    I’m hoping to have an alpha release ready in the next few days.

    Regards, Brendan.

    • liudr says:


      Sounds fine. Please post a link after you publish your work with my library. Besides big fonts, I also have a super fonts library that only works on 4 line displays, less characters but a lot better looking. I specialize in user interface.

      • Brendan says:

        Oh, I just checked out out your super font, looks good.
        It appears to only use 3 custom characters in total and the block char is on most cgrom tables anyway so could be a full alpha numeric font with only 2 custom chars used.
        I’m sure LCD Smartie user’s would like that.
        Do you have a set of pictures for the full character set?


  12. Leandro says:


    I´m new on arduino, and I´m working on a project on university using it, I´m trying to use the phi_prompt, but as far a can see, it is a litte bit old. Are you planning in update it? Like errors whilke compiling, and the update function that you mention it on manual (to do something while waiting, like update a variable in real time)

    Thanks in advance!

  13. Floyd says:

    I noticed on your LCD + keypad panels you have used button extenders when you mounted the panel. Where did you get the button extenders?

  14. Charles says:

    Just found Phi Prompt / Phi Interface – as a newbie this could be the ultimate solution!
    One question – can I use a 20 x 4 LCD which has I2C – if so how?

    Best Regards


    • liudr says:

      If you want to use I2C LCD, go inside phi_prompt.h and change definitions where you see LiquidCrystals into your I2C LCD. Do the same in phi_prompt.cpp
      All the high-level functions simply work by calling functions like print, setCursor etc that should be available in any character LCD library. People have done this before but I’m afraid the change was too old to be useful for you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: