Hi, I have a working setup with an I2C backpack to a 20x4 LCD with a rotary encoder and automatic reset every 2 minutes (and Bluetooth, thanks day_trippr!). Link for download :
http://s000.tinyupload.com/index.php?file_id=15700787823698715094 , it is for an
Arduino UNO, I2C backpack with adress 0x27, rotary encoder.
-While that is fine, there is room for improvement and I think that it would be possible to have software switch off the backlight (or the whole LCD)? It is certainly under software control using a I2C backpack, though dimming does not work (without more hardware like a LDR or PWM) , its either full on or off AFAIK.
The reset of the LCD is done through the little snippet in Brewpi.cpp at line 100:
if( (ticks.millis() - lastLcdUpdate) >= 120000) { //reset lcd every 120 seconds
lastLcdUpdate = ticks.millis();
display.init();
display.printStationaryText();
display.printState();
That takes care of scrambling issues, but its not ideal. It would be far better to do that after pushing the rotary encoder and the main loop could switch off the backlight or the whole LCD after a set period of time. One could even use another sensor as input to switch it on again (like a proximity sensor or whatever).
The I2C (software)implementation is herrfrosts on github that maintain the pin configuration of the RevC board it can be found here:
https://github.com/herrfrost/firmware, I just downloaded that, installed Atmega studio and compiled the hex after adding the above code.
The advantages of using a I2C backpack is that everything on the AVR is modular, there is no need of a proto board and very little soldering (I just made a connection block for GND and 5V). - I made my "minions" connected to a multi chamber set up this way, and they are rock solid (but LCD where sometimes scrambled, likely from using sainsmart relays in combination with 230V mains).
- Anyone have an idea on how to implement a method for SW on/off backlight (or LCD)? I have yet to prod into how the code for the project is set-up, I just included the reset hack. After a SW backlight off/on is implemented this solution is ideal in my opinion. Possibly one could use a ESP8266 instead of an Arduino UNO, but that is another project altogether.
Regards and cheers! /A