Examining Calculator with two rotary encoders

The Calculator have default game function (1.jpg) where are left/right numbers (0..100) selected by rotary encoders. It show two lines with adding and multiplying.

There are four Examining functions which are selected by right black pushbutton.

  1. just adding
  2. just multiplying
  3. just subtracting (as complement to adding)
  4. just dividing (as complement to multiplying)
  5. back to default game function (with short beep)

Left black pushbutton button is HELP function which show both rows of the results (adding, multiplying). HELP function will do a long BEEP.

If battery is low, then it write message CHARGE ME and beep. Power consumption is less than 15mA (with Arduino Pro Mini 3.3V/16MHz, does not have 8MHz version now).

Wirings:

  • LCD VCC and Arduino RAW to switch, other wire from switch to B+
  • B+/B- to charger board
  • Vcc from arduino is directly via pin header connected to LCD A (LED backlight)
  • Encoder Left: D7,D8,D9
  • Encoder Right: D10,D11,D12
  • Note that middle pins are connected for data pins too (not needed, but I was do it for less wire mesh)
  • LCD pins RS E D4 D5 D6 D7
  • To Arduino Pins: A4, A5, A0, A1, A2, A3
  • Other LCD pins:
  • 5k..20K potentiometer - ends to +5V and ground, wiper to LCD VO pin (pin 3)
  • LCD R/W pin to ground
  • LCD Vss to GND
  • LCD Vdd to Arduino RAW

Pushbutton 1 to 4 and other end to GND
Pushbutton 2 to 6 and other end to GND

Beeper to pin 5 and GND (resistor is better but not explicitly needed due short PWM pulses). But better is connect other pole to Vcc and modify PWM values accordingly (2=>253, 3=>252). But I have more GND points than Vcc.

Components:
1x Arduino Pro Mini
1x LCD 1602
1x On-Off switch 7x7mm
2x pushbutton 6x6x8mm
2x rotary encoders
1x Li-Ion MINI USB charger
1x old Li-Ion battery from mobile phone
Dupont jumper wires, wires
female pin header 5 pins (1602: D4..D7, K)
male pin headers
switch box on top of wall

Libraries:
LiquidCrystal (from Arduino IDE)
Quadrature (modified - you need to change Wconstatns.h to Arduino.h elsewhere)

The unmodified Quadrature Arduino library is here:
http://www.neufeld.newton.ks.us/electronics/?page_id=249

Quadrature_OK.zip (9.1 KB)

Kalkulator_LCD_2xRotaryEncoder_rc02.txt (6.34 KB)