Package: pibooth-lcd-i2c
pibooth-lcd-i2cis a plugin for thepiboothapplication.Add any 16x2 or 20x4 LCD-screen with aHitachi HD44780 controllerusing a port expander connected Through I2c.It can show numbers ofPhotos Taken,Printed Photos,Forgotten Photos,Remaining Duplicates.It also have 4 xFree-Textwhere you can write your own text, and showDate/Time.Examples:Show pibooth counters like “Taken Photos 197” or “Today Photos 197”Show some free text in the line “Hello from pibooth!”Show the Date/Time Clock**NoteMaximum text size depends on the LCD type and on the presence of a counter after.Supported port expanders are the (PCF8574- Default), theMCP23008and theMCP23017.I2c port address (Default 0x27on I2c PCF8574T ), (Default 0x3Fon I2c PCF8574AT)All changes can be made in the pibooth.cfgContentsRequirementsInstallConfigurationTurn I2C on - Raspberry PiHow to find the name of your port expander on the I2cHow to find your I2c addresssHow to change address on the I2cHow to setup the LCD in the config.cfg fileOptions are available by editing the configuration fileHow to setup LCD_I2C in config.cfgSelect what to display on line 1,2,3,4Write the text showing before the counterHow to change the Date-Time formatWrite your own text on the displayStates descriptionCircuit diagramWiringI2C-safe Bi-directional Logic Level ConverterHow to connect aLevel Converterto yourPort Expanderand the Raspberry PiRequirementsHardware1 Raspberry Pi 3 Model B (or higher)1 LCD-screenHitachi HD44780 controllerwith I2c (PCF8574, or MCP23008 or MCP23017)1 I2c safe Bi-directional Logic Level ConverterInstall$ pip3 install pibooth-lcd-i2cConfigurationTurn I2C on - Raspberry PiThe I2C peripheral is not turned on by default.There are two methods to adjust the settings. To enable it, do the following.Raspberry Pi Configuration via Desktop GUIYou can use the Desktop GUI by heading to the Pi Start Menu > Preferences > Raspberry Pi Configuration.A window will pop up with different tabs to adjust settings. What we are interested is the Interfaces tab.Click on the tab and select Enable for I2C. Click on the OK button to save.We recommend restarting your Pi to ensure that the changes to take effect.Click on the Pi Start Menu > Preferences > Shutdown. Since we just need to restart, click on the Restart button.raspi-config Tool via TerminalI2C is not turned on by default. Again, we can use raspi-config to enable it.Run sudo raspi-config.Use the down arrow to select 5 Interfacing OptionsArrow down to P5 I2C.Select yes when it asks you to enable I2CAlso select yes if it asks about automatically loading the kernel module.Use the right arrow to select the <Finish> button.Select yes when it asks to reboot.The system will reboot. when it comes back up, log in and enter the following command>ls/dev/*i2c*The Pi should respond with/dev/i2c-1Which represents the user-mode I2C interface.How to find the name of your port expander on the I2cYou need to provide the name of the I²C port expander that your board uses.It should be written on the microchip that’s soldered on to your I2c board.Supported port expanders are thePCF8574, theMCP23008and theMCP23017.The board on this photo has aPCF8574port expander chip on it.How to find your I2c addresssYou need to know the address of your I2c. You can find it on the command line using the“sudo i2cdetect -y 1”command.In this case the address of the display is0x3F.How to change address on the I2cYou can change the address by making a bridge.Soldering 1 or more wire on the back of the I2c (short circuit)A0,A1,A2How to setup the LCD in the config.cfg fileOptions are available by editing the configuration fileusing the command - (Some options can also be changed in the pibooth menu under “Lcd_i2c”)$ pibooth --configHow to setup LCD_I2C in config.cfg[LCD_I2C]# Choose LCD chip - PCF8574(Default) or MCP23008 or MCP23017lcd_chip =PCF8574# Change the I2C port number 1 or 2 - (Default = 1)lcd_port =1# Change the I2C charmap A00 or A02 or ST0B - (Default = A02)lcd_charmap =A02# This can also be changed in the pibooth menu under “Lcd_i2c”# Change Port Address 0x3F(Default)lcd_port_address =0x3F# Number of columns per row 16 or 20 (16 = Default on a 16x2 LCD)lcd_cols =16# Number of display rows 1 or 2 or 4 - (2 = Default on a 16x2 LCD)lcd_rows =2Select what to display on line 1,2,3,4# This can also be changed in the pibooth menu under “Lcd_i2c”#Taken_PhotoPrintedForgottenRemaining_DuplicatesDate_TimeText# Choose what to display on line 1,2,3,4lcd_line_1_typelcd_line_2_typelcd_line_3_typelcd_line_4_type= etc.Taken_PhotoWrite the text showing before the counter# Text before etc.Taken Photo Counteris displayed - This can also be changed in the pibooth menu under “Lcd_i2c”Max-12 characters on a 16x2 display - Max 16 characters on a 20x4 displaylcd_line_1_textlcd_line_2_textlcd_line_3_textlcd_line_4_text= etc.Taken Photo,Printed,Forgotten,DuplicatesHow to change the Date-Time formatSee the Date-Time format codes in the followingpage# You can change the way Date-Time is displayed - This can also be changed in the pibooth menu under “Lcd_i2c”Max-16 character on a 16x2 display - Max 20 character on a 20x4 display# Default =%d/%m - %H:%M:%SChoose Date_Time and use etc.%d/%m - %H:%M:%Sto display the date and timeWrite your own text on the display# This can also be changed in the pibooth menu under “Lcd_i2c”# Text - Max-16 characters on a 16x2 display - Max 20 characters on a 20x4 displayChoose Text =Write your own textStates descriptionCircuit diagramHere is the diagram for hardware connections.WiringI2C-safe Bi-directional Logic Level ConverterWhen using a port expander on your LCD, you will have to use 5v.Since the Raspberry Pi GPIO only handle 3.3v, it will therefore be a good idea to use aI2C-safe Bi-directional Logic Level Converterso you don’t fryed your pi.How to connect aLevel Converterto yourPort Expanderand the Raspberry PiConnect the I2c Port Expander toHV(High Level) on the Level Converter.GND: Pin GND (GND)VCC: Pin HV  (HV)(5v) - Also connect5vfrom the raspberry Pi Pin 2, toHVon the Level ConverterSDA: Pin HV2 (HV2)SCL: Pin HV1 (HV1)Connect the Raspberry Pi (BOARD numbering scheme) toLV(Low Level) on the Level Converter.GND:  Pin 6 (GND)3.3v: Pin 1 (LV)SDA:  Pin 3 (LV2)SCL:  Pin 5 (LV1)