E-Paper (or Electronic paper) is a display technology that mimics the appearance of ordinary ink on paper. E-paper displays do not emit light, rather they reflect light, thus making them much more comfortable to read and provide a wider viewing angle than most light emitting displays (source: Wikipedia).
I printed something to an E-paper display, unplugged it, and could still read the message clearly months later. These E-paper displays are great for showing information that is static for long periods. You only need to provide power when the data or information needs updating.
Barcodes are used everywhere, and one of the simplest Barcodes to generate is the Code 39 format (also known as Code 3 of 9). I used an E-paper shield and E-paper module to display a number in this barcode format. I then tested it with a Barcode reader and it worked perfectly.
This tutorial will show you how to send a number to the Arduino from the Serial Monitor, and display the Barcode on the E-paper module.
The video will show you how to assemble the shield and the module onto the Arduino, and also how to install the SDHC card.
To use the e-paper shield, you will need to download the Small e-paper Shield library.
This library will allow you to use the following functions on the e-paper shield:
- begin : to set up the size of the e-paper panel
- setDirection : to set up the display direction
- drawChar : to display a Character at a specified position
- drawString : to display a String of characters at a specified position
- drawNumber and drawFloat : to display a number
- drawLine : to draw a line
- drawHorizontalLine : to draw a horizontal line
- drawVerticalLine : to draw a vertical line
- drawCircle : to draw a circle
- fillCircle : to draw and fill a circle
- drawRectangle : to draw a rectangle
- fillRectangle : to draw and fill a rectangle
- drawTriangle : to draw a triangle
For more information on how to use these functions, please visit the seeedstudio wiki. If you are unfamiliar with installing libraries - then have a look at the following sites:
- Arduino Library Installation
- Adafruit Library Installation guide
- Sparkfun Library Installation guide
Barcode 39 Info
Barcode 39 (or Code 3 of 9) is a barcode that consists of black and white vertical lines. These lines can be thick or thin. Each character can be coded using 9 alternating black and white bars. The barcode always starts with a black bar, and ends with a black bar.
If you code using thin lines only, then each character can be coded using a total of 12 bars. A wide black line is essentially two thin black lines next to each other. Same goes for a wide white line. Because there are now only 2 options (black or white), you can create a binary code. I used a 1 for black bars, and 0 for white bars. If there was a thick black bar, then this would be represented with a 11. A thick white bar would be 00.
Each barcode sequence starts and ends with a hidden * character. Therefore if you were to display just the number 1, you would have to provide the code for *1*.
- * = 100101101101
- 1 = 110100101011
- * = 100101101101
Something also to take note of: is that each character is separated by a thin white line (and not represented in the binary code).
All of these 0's and 1's can get a bit confusing, so I decided to represent these binary numbers as decimals. For example, the picture below shows how a 0 and an 8 would be coded (without the *):
The table below provides the binary and decimal codes for each number used in this tutorial. I have also included for your own reference, each letter of the alphabet, however I did not use these in this tutorial.
The binary representation of each character in this table was obtained from this site.
www.barcodeisland.com is a great resource of information about barcodes.
There is something weird about the E-paper shield library which tends to display the word "temperature:" in the Serial monitor when opened, and with each serial transmission. Don't worry about this. Just ignore it.'
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
Have a look at my videos on my YouTube channel.
However, if you do not have a google profile...
Feel free to share this page with your friends in any way you see fit.