Picture of Arduino Excuse Generator
Need an excuse in a hurry?

Look no further than the Excuse Generator.

Step 1: What You Need / Wire it Up

Picture of What You Need / Wire it Up
We are using:

        Arduino Uno
        LCD Module (HD44780 compatible)
        Tilt Switch
        220 Ohm Resistor (Red-Red-Black-Black)  / (Red-Red-Brown) or 470 Ohm or 560 Ohm is fine too

Wire up the LCD module to the Arduino as listed below and illustrated in the Diagrams.
Don't forget to wire in the Pot and the Tilt Switch too as shown.

Wire up the LCD Module as follows:

    LCD pin (1)   / Vss      -> Gnd
    LCD pin (2)   / Vdd    -> 5V
    LCD pin (4)   / RS      -> 12
    LCD pin (5)   /  R/W  -> Gnd
    LCD pin (6)   / E         -> 11
    LCD pin (11)  / D4      -> 5
    LCD pin (12)  / D5      -> 4
    LCD pin (13)  / D6      -> 3
    LCD pin (14)  / D7      -> 2

In addition you need to wire 5V/Gnd to the A/K of the backlight LED (pins 15/16); and wire in a potentiometer to adjust the contrast (pin 3).

Without the contrast adjustment and the backlight the LCD will not Display anything visible.

us2410982 years ago
hi buddy nice instructable!!!! i just tried it . using your idea i want to print maths formulaes on the lcd . and also i dont want to make it that random formulaes are printed when button is pressed. i am a newbie plzz help me

akellyirl (author)  us2410982 years ago
1. You need to put your formulae into an Array, replacing the existing definitions.
2. change the array index when printing from 'reply' which is a random number to 'i' that counts from 0 to 3 (actually length-1).

Give this a try:

// Define your Formulae and the number of them in the array
char *start []= {"area = pi*r^2 ","y=mx+c ", "area=wh/2 ","r^2=x^2+y^2 "};

int length = 4;
switch(i) {
case 0:lcd.print(start[reply]); break;
case 1:lcd.print(middle[reply]); break;
case 2:lcd.print(ends[reply]); break;


much funnier with lambdas, when start[] is an array of pointers to functions :-)

us2410982 years ago
IT WORKED !!!!!!!! Thanks sir you are awesome. Sir could you give me one more favour. i want different formula to print when 2 different switches are pressed . for e.g if switch 1 is pressed then pi r^2 is printed when switch 2 is pressed then vol. of cube.