Homemade Panelolu 2 I2C 20x4 LCD with sound for less then 12 euro (incl. simple shematic + sound modefication) ! by ooxtcoo 3d model
3dmdb logo
Thingiverse
Homemade Panelolu 2 I2C 20x4 LCD with sound for less then 12 euro (incl. simple shematic + sound modefication) ! by ooxtcoo

Homemade Panelolu 2 I2C 20x4 LCD with sound for less then 12 euro (incl. simple shematic + sound modefication) ! by ooxtcoo

by Thingiverse
Last crawled date: 3 years, 1 month ago
here i whant to show you how to make a panelolu 2 (like) LCD for your printer easy and very cheap by your self!

i payed for everything less then 12€ !!!

http://youtu.be/fPHAXKJ23Ak

and i show you, how to modeficate your marlin firmware to play a sound...
1.) when printer starts, a short beep
2.) after its init again beep beep (now you know, printer is ready!)
3.) you can add "M9999 S3" when printer finished printing, then it plays a nice sound and you hear your printer finished its work.

you can play also some melodys with M codes..
Like "M9999 S1"

S1 = song 1 / TETRIS
S2 = song 2 / CREAZY FROG
S3 = success sound, when printer is finished with printing
S4 = bad sound, when something failed


first about the lcd:
its very easy to make the i2c lcd supported...

get the cheapst i2c lcd from ebay...
i buyed mine from china for 8€

i buyed exaktly this one from him:

20x4 I2C LCD

http://www.ebay.de/itm/Neu-Arduino-Blau-Display-Bildschirm-IIC-I2C-Serie-2004-20x4-Character-LCD-Modul-/370953200452?pt=Bauteile&hash=item565e88a344

7,68 euro


Lochrasterplatine:
http://www.ebay.de/itm/Lochraster-RM-2-54-mm-Platine-Kupfer-Grose-125x57-mm-Experimentierplatine-LEI1-/251438598192?pt=Elektromechanische_Bauelemente&hash=item3a8ae88830

1 euro



Alps Drehgeber Encoder, mechanisch 24 Impulse/U ohne Index Flachschaft, Durchsteckmontage
https://at.rs-online.com/web/p/mechanische-drehgeber/6234237/?searchTerm=EC12E2424407&relevancy-data=636F3D3226696E3D4931384E4B6E6F776E41734D504E266C753D6465266D6D3D6D61746368616C6C7061727469616C26706D3D5E5B5C707B4C7D5C707B4E647D2D2C2F255C2E5D2B2426706F3D313326736E3D592673743D4D414E5F504152545F4E554D4245522677633D424F5448267573743D45433132453234323434303726

1,98 euro



1 LED
1 Resistor for the LED
1 Piezzo / or some old mini speaker from some old motherboard / computer case...
you can also use the leds used it some old computer case..

solder it, like shown in the shematic.png picture!
its realy easy, just folow the traces i made.
i have extra painted it fast with win paintshop, its more easy to understand for non electronic peoples then real shematics (i hope so)

in my example, i connected it to the melzi board, thanks to i2c there are still pins free, so i already thinking what iam doing with this free pins.. (maybe bed auto level and learning my printer to speech instead of beeping)




NOW THE PART TO MAKE THE LCD WORK IN THE MARLIN FIRMWARE:

______________________________________________________________
in "configuration.h" file, you need to change:

//LCD and SD support
//
#define ULTRA_LCD //general LCD support, also 16x2
//#define DOGLCD // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
//
#define SDSUPPORT // Enable SD Card Support in Hardware Console
//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
//#define ULTIPANEL //the UltiPanel as on Thingiverse
//
#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
//
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click

______________________________________________________________


so this means you need to enable this lines:
#define ULTRA_LCD //general LCD support, also 16x2
#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click

first one, for the general LCD support and the 2 others for the speaker (sound)


______________________________________________________________


to get this lcd working with the i2c chip used in this lcd, we must modeficate the panelolu 2 code part, for your i2c chip:


// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
//
#define LCD_I2C_PANELOLU2
#ifdef LCD_I2C_PANELOLU2
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
// (v1.2.3 no longer requires you to define PANELOLU in the LiquidTWI2.h library header file)
// Note: The PANELOLU2 encoder click input can either be directly connected to a pin
// (if BTN_ENC defined to != -1) or read through I2C (when BTN_ENC == -1).

//#define LCD_I2C_TYPE_MCP23017
//#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
//#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD

#define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expande

#define NEWPANEL
#define ULTIPANEL

#ifndef ENCODER_PULSES_PER_STEP
#define ENCODER_PULSES_PER_STEP 4
#endif

#ifndef ENCODER_STEPS_PER_MENU_ITEM
#define ENCODER_STEPS_PER_MENU_ITEM 1
#endif


#ifdef LCD_USE_I2C_BUZZER
#define LCD_FEEDBACK_FREQUENCY_HZ 1000
#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100
#endif

#endif


______________________________________________________________

so instead of:
the MCP23017 i2c chip we use this one: PCF8575
dont care about the different number, this i2c type is compatible with our chip which we whant to use...


______________________________________________________________


the last thing now is to tell marlin what pins we are using for our rotary click encode and beeper:

for the LCD you simply connect SDA to SDA, SCL to SCL, VCC to VCC (+5V) and Ground to Ground on the melzi board!
you find all connections on the same socket!
i didnt found how to control the backlight, just jumper it to always on on the lcd directly..

#ifdef ULTRA_LCD
#ifdef NEWPANEL
//we have no buzzer installed
//#define BEEPER -1
#define BEEPER 28 //we have a buzzer and its connected to pin 28 like show in the shematic.png
//LCD Pins
#ifdef DOGLCD
// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 30
#define DOGLCD_CS 29
// GLCD features
#define LCD_CONTRAST 1
// Uncomment screen orientation
// #define LCD_SCREEN_ROT_0
// #define LCD_SCREEN_ROT_90
#define LCD_SCREEN_ROT_180
// #define LCD_SCREEN_ROT_270
#else // standard Hitachi LCD controller
//
#define LCD_PINS_RS 4
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 30
#define LCD_PINS_D5 29
#define LCD_PINS_D6 28
#define LCD_PINS_D7 27
#endif
//The encoder and click button
#define BTN_EN1 11 // we connect it to D11 on melzi
#define BTN_EN2 10 // we connect it to D10 on melzi
#ifdef LCD_I2C_PANELOLU2
#ifdef MELZI
#define BTN_ENC 29 //the click switch
#define SDSS 30 //to use the SD card reader on the Panelolu2 rather than the melzi board (we use the reader on the melzi board, we dont need a 2nd reader)
#else
#define BTN_ENC 30 //the click switch
#endif
#else
#define BTN_ENC 16 //the click switch
#endif //Panelolu2
//not connected to a pin
#define SDCARDDETECT -1

#endif //Newpane

#endif //Ultipanel

______________________________________________________________


thats all for the LCD!

if you whant, you can upload the firmware to your board and test it..
it should now display already everything and the rotary click encoder should work too!
you also should alread hear some beep sounds, but no melodys...


______________________________________________________________

NEXT STEP:
making your printer playing some sounds / melodys:


______________________________________________________________

insert this code into "Marlin_main.cpp"


...
case 350: // M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
{
#if defined(X_MS1_PIN) && X_MS1_PIN > -1
if(code_seen('S')) for(int i=0;i<=4;i++) microstep_mode(i,code_value());
for(int i=0;i if(code_seen('B')) microstep_mode(4,code_value());
microstep_readings();
#endif
}

//////////////////////////////////////////////////////////////////////////////////
case 9999: // M9999: tone fun part!
{
#if defined ULTIPANEL
LCD_MESSAGEPGM("playing sound!"); //remove this!
lcd_update();

//TETRIS
if(code_seen('S')) switch((int)code_value())
{
case 1: //TETRIS
sound(1320,500);
sound(990,250);
sound(1056,250);
sound(1188,250);
sound(1320,125);
sound(1188,125);
sound(1056,250);
sound(990,250);
sound(880,500);
sound(880,250);
sound(1056,250);
sound(1320,500);
sound(1188,250);
sound(1056,250);
sound(990,750);
sound(1056,250);
sound(1188,500);
sound(1320,500);
sound(1056,500);
sound(880,500);
sound(880,500);
delay(250);
sound(1188,500);
sound(1408,250);
sound(1760,500);
sound(1584,250);
sound(1408,250);
sound(1320,750);
sound(1056,250);
sound(1320,500);
sound(1188,250);
sound(1056,250);
sound(990,500);
sound(990,250);
sound(1056,250);
sound(1188,500);
sound(1320,500);
sound(1056,500);
sound(880,500);
sound(880,500);
delay(500);
sound(1320,500);
sound(990,250);
sound(1056,250);
sound(1188,250);
sound(1320,125);
sound(1188,125);
sound(1056,250);
sound(990,250);
sound(880,500);
sound(880,250);
sound(1056,250);
sound(1320,500);
sound(1188,250);
sound(1056,250);
sound(990,750);
sound(1056,250);
sound(1188,500);
sound(1320,500);
sound(1056,500);
sound(880,500);
sound(880,500);
delay(250);
sound(1188,500);
sound(1408,250);
sound(1760,500);
sound(1584,250);
sound(1408,250);
sound(1320,750);
sound(1056,250);
sound(1320,500);
sound(1188,250);
sound(1056,250);
sound(990,500);
sound(990,250);
sound(1056,250);
sound(1188,500);
sound(1320,500);
sound(1056,500);
sound(880,500);
sound(880,500);
delay(500);
sound(660,1000);
sound(528,1000);
sound(594,1000);
sound(495,1000);
sound(528,1000);
sound(440,1000);
sound(419,1000);
sound(495,1000);
sound(660,1000);
sound(528,1000);
sound(594,1000);
sound(495,1000);
sound(528,500);
sound(660,500);
sound(880,1000);
sound(838,2000);
sound(660,1000);
sound(528,1000);
sound(594,1000);
sound(495,1000);
sound(528,1000);
sound(440,1000);
sound(419,1000);
sound(495,1000);
sound(660,1000);
sound(528,1000);
sound(594,1000);
sound(495,1000);
sound(528,500);
sound(660,500);
sound(880,1000);
sound(838,2000);
break;
case 2: //CREAZY FROG
sound(676,460);
sound(804,340);
sound(676,230);
sound(676,110);
sound(902,230);
sound(676,230);
sound(602,230);
sound(676,460);
sound(1012,340);
sound(676,230);
sound(676,110);
sound(1071,230);
sound(1012,230);
sound(804,230);
sound(676,230);
sound(1012,230);
sound(1351,230);
sound(676,110);
sound(602,230);
sound(602,110);
sound(506,230);
sound(758,230);
sound(676,760);
break;
case 3: //SUCCSSES
sound(1000,180);
delay(5);
sound(1500,180);
delay(5);
sound(1600,180);
delay(50);
sound(1500,100);
delay(50);
sound(1800,80);
delay(50);
sound(1500,100);
delay(50);
sound(1800,350);
break;
case 4: //FAIL
sound(400,180);
delay(5);
sound(300,180);
delay(5);
sound(100,1000);
break;
}
#endif
}
///////////////////////////////////////////////////////////////////////////////////

break;
case 351: // M351 Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low.
{
...

______________________________________________________________





to play beep sound at start and after finished init, add this (anywhere in the Routines part of "Marlin_main.cpp":


//===========================================================================
//=============================Routines======================================
//===========================================================================



//make beep sound for buzzer (ooxtcoo)
void sound(int S, int P, int D = 0)
{
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
int beepS = S;
int beepP = P;
if (beepS > 0)
{
#if BEEPER > 0
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);
#elif defined(ULTRALCD)
lcd_buzz(beepS, beepP);
#elif defined(LCD_USE_I2C_BUZZER)
lcd_buzz(beepP, beepS);
#endif
}
else
{
delay(beepP);
}
delay(D);
#endif
}


______________________________________________________________



and here at:

void setup()
{
sound(1000,50); //<- add this code, to make first short beep after power on!
setup_killpin();
setup_powerhold();
MYSERIAL.begin(BAUDRATE);
SERIAL_PROTOCOLLNPGM("start");
SERIAL_ECHO_START;


______________________________________________________________


and at the end of the setup routine add this:



#ifdef DIGIPOT_I2C
digipot_i2c_init();
#endif

sound(1000,50); //<-- this code
delay(100); //<-- this code
sound(1100,80); //<- and this code
}


______________________________________________________________


then your hear the beep sound at startup like shown in the video!


______________________________________________________________

so if you whant to have a melody when the printer is finished with its printing, add

M9999 S3

to the gcode editor..
in cura you can easy edit it by clicking to "Start/End-GCode"

and add like this:

;End GCode
M104 S0 ;extruder heater off
M140 S0 ;heated bed heater off (if you have it)
G91 ;relative positioning
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
M84 ;steppers off
G90 ;absolute positioning
;Play Success Sound!
M9999 S3
;Put Finished message on LCD screen
M117 Finished!


______________________________________________________________

so i just added 2 lines:
M9999 S3 <- for the melody song 3 which is the success tone
M117 Finished! <- which prints "Finsihed!" to the lcd screen... cause it always stayed "Printing..." also when it was already finished, i dont liked that...

now it plays a nice sound and display "finished"


______________________________________________________________


about the LCD case for the Prusa...

i designed it to be as small als possible, i dont made holes for the reset, led and rotary click encoder, cause this way you can put it anywhere
you whant into the case by just drilling holes into the case where you whant it.


______________________________________________________________


the switch is the kill switch... if you press it, the printer will instant stop and after 10 seconds it will restart..
i had first connected it to the killswitch pin, but this pin just stops the printer and it freezes... so its just a waste of a free pin...
instead we use the reset pin, which will also restart the printer and you dont loose an extra pin for that.


______________________________________________________________


if you are interessted how to install a bluetooth modul, let me know, maybe thats my next tutorial if someone needs it.

maybe i add wlan to it too... i need to check and see if it is useful...

may next plans to add is for shure the auto bed leveling and maybe instead of beep sounds i make the printer speeching.
but that need some extra microcontroller and will be a bit more work then this... but is also possible to make it very cheap for just some euros...


______________________________________________________________

Tags