In this previous post I demonstrated the a new API which makes it very easy to control your ioBridge. In this post I’m building upon that API to show how you can control a Serial LCD from sparkfun.com. You can buy a nice serial LCD directly from the ioBridge store at almost the same price but the display is only available in 1 color (white) whereas sparkfun has more choice (red/yellow/black/white). The displays are almost identical as they both use the worlds most popular LCD, the HD44780. The LCD from ioBridge has some nice off the shelf build in that the sparkfun LCD’s don’t have like the option to draw a gauge. But you should be able to mimic all those functions with some creative programming (as I’ve already done in the examples that follow below).
To make life easier I’ve build a small JavaScript library that provides simple functions to control your LCD and also a library that provides some very basic animation functions which you see in the video below.
Some things you should know before you get started
- You can control the LCD using the I/O Serial Out widget, in this case you can use wire the LCD up to a Terminal Board and plug it directly into an free channel on your ioBridge module.
- You can also control the LCD using the Serial Smart Board (as shown in this example). In this case you need to create a Send Serial Message (variable message) widget. I’ve hooked a terminal board up to my serial smart board but in this case the wiring is different! The input pins on the terminal board don’t match the output pins on the serial smart board. The 3 things you need to know are [AI -> +5v] / [DO -> RX] / [+5v -> GND].
Don’t forget to set the channel mode to “serial” in your ioBridge dashboard.

- Have your signal mode set to true. If it’s set to inverted you’ll get gibberish on your display.
How to use
Once you’ve setup the ioBridge proxy it’s a breeze to get the LCD demo working.
1. Make sure you have the iobridge-proxy up and running (see this article)
2. Download iobridge.js, serial-lcd.js, serial-lcd-anim.js and lcd.html
3. Open iobridge.js and set the baseUrl to you iobridge-proxy url.
4. Open serial-lcd.js and set the widgetID to your widget that controls the LCD.

5. Upload all the files to your webserver
6. Fire up a browser and go to http://yourserver.com/lcd.html and see if your LCD is working
What’s next
* The animations are really basic, please help to extend this. If you’ve created some animation share them in the comments below.
Bugs
* Because there is a rather big delay between requests send to the ioBridge module >0.5s it somewhat limits how smooth some animations work. It would be nice if we could send a “sleep” command to the ioBridge along with the string for the LCD. In that way you’d send 1 long command that includes sleeps instead of making separate calls to the ioBridge.
* Somehow programming the CGRAM with custom characters doesn’t work. If you have any clues why please leave a comment here. This issue is fixed with the help of the ioBridge team! See the example in the video below
Download files
* iobridge-serial-lcd-1.0.zip (all files)








