In cel mai rau caz, voi renunta la temperatura din interior...
Schema gandita de mine deriva din cea a termometrului dublu la care am adaugat un divizor rezistiv cu raport de 1:4 (tensiune maxima de intrare de 20V), cum am facut la indicarul starii bateriei masinii cu led multicolor.
Trebuie sa schimb pictogramele, iar afisarea sa fie ceva de genul:
Pictogramele vor fi de genul:
- baterie:
- temperatura interior (masina):
- temperatura exterior (un copac):
Sketch-ul pe care l-am gandit si de care am fost multumit:
/*
this sketch is adapted by niq_ro from
http://www.tehnic.go.ro
http://www.niqro.3x.ro
http://nicuflorica.blogspot.ro/
http://arduinotehniq.blogspot.com/
for made a dual thermometer & battery status for car with ATtiny85 as Arduino..
* 3-pin Arduino interface for HD44780 LCDs via 74HC595 Shift Register
* by Rowan Simms code@rowansimms.com
* License: Creative Commons - Attribution.
* Full Documentation and Description: http://rowansimms.com/article.php/lcd-hookup-in-seconds
*
* This sketch allows Arduinos to use a shift register to control an LCD, allowing
* a reduction in pins it requires from 6 to 3 while still retaining full control
* including backlight on/off.
* This requires the use of the LiquidCrystal595 library
* available at: http://code.google.com/p/arduino-lcd-3pin/
*/
#include <LiquidCrystal595.h> // include the library
LiquidCrystal595 lcd(0,1,2); // datapin, latchpin, clockpin
byte baterie1[8] = {
B00000,
B01100,
B11111,
B10000,
B10000,
B10000,
B10000,
B11111,
};
byte baterie2[8] = {
B00000,
B00110,
B11111,
B00001,
B00001,
B00001,
B00001,
B11111,
};
byte masina1[8] = {
B00111,
B01000,
B01111,
B10110,
B10000,
B11111,
B01100,
B01100
};
byte masina2[8] = {
B11100,
B00010,
B11110,
B01101,
B00001,
B11111,
B00110,
B00110
};
byte grad[8] = {
B01110,
B10001,
B10001,
B01110,
B00000,
B00000,
B00000,
};
byte pom1[8] = {
B00111,
B01000,
B10101,
B10010,
B10000,
B01111,
B00001,
B00001
};
byte pom2[8] = {
B11000,
B00110,
B10101,
B01001,
B00010,
B11100,
B10000,
B10000
};
// variables
// variabile
int t1, t2;
float t10, t20;
float t11, t21;
float t12, t22;
int temperaturePin1 = A0; // output from first LM335 is put at analog input no.0
int temperaturePin2 = A3; // output from second LM335 is put at analog input no.1
// cei 2 senzori de temperaturia LM335 sunt legati la pinii A0 si A1
int divbaterie = A2; //the input pin for voltage divider
int u = 0; // variable to store the value coming from the sensor
float k=4.90/5; // corection voltage (real voltage after 7805 output)
float k1 = k; // real divider correction
float u1 = 0; // voltage on battery
float divizor = 0.25; // divider raport
void setup() {
lcd.begin(16,2); // 16 characters, 2 rows
lcd.createChar(0, grad);
lcd.createChar(1, baterie1);
lcd.createChar(2, baterie2);
lcd.createChar(3, masina1);
lcd.createChar(4, masina2);
lcd.createChar(5, pom1);
lcd.createChar(6, pom2);
lcd.clear(); // clear the screen
lcd.setCursor(2, 0); // put cursor at colon 2 and row 0 = left/up
lcd.print("ATtiny85 dual"); // print a text
lcd.setCursor(2, 1); // put cursor at colon 0 and row 0 = left/down
lcd.print("thermometer +"); // print a text
delay (3000);
lcd.clear(); // clear the screen
lcd.setCursor(0, 0); // put cursor at colon 2 and row 0 = left/up
lcd.print("+ battery status"); // print a text
lcd.setCursor(4, 1); // put cursor at colon 0 and row 0 = left/down
lcd.print("by niq_ro"); // print a text
delay (3000);
lcd.clear(); // clear the screen
}
void loop() {
// Read and store Sensor Data
t11=0;
t21=0;
//lcd.clear(); // clear the screen
for (int x=1; x <= 5; x++)
{
// calculate the value
t1 = analogRead(temperaturePin1); // read value from temperature from first sensor (LM335);
t10 = 100.0*(k*5.0*t1/1023-2.980)+25.0;
t11 = t10 + t11;
t2 = analogRead(temperaturePin2); // read value from temperature from second sensor (LM335);
t20 = 100.0*(k*5.0*t2/1023-2.980)+25.0;
t21 = t20 + t21;
delay (500);
}
t12 = t11/5.0 -1.5 ; // average and corrected temperature
t22 = t21/5.0 -1.0; // average and corrected temperature
lcd.setCursor(0, 0);
lcd.write(byte(3));
lcd.write(byte(4));
lcd.print(":");
// lcd.print("t1=");
if (t12<10) lcd.print(" ");
if (t12>0.0) lcd.print("+");
lcd.print(t12,1);
// lcd.write(0b11011111);
lcd.write(byte(0));
lcd.print("C ");
lcd.setCursor(0, 1);
// lcd.print("ext:");
// lcd.print("t2=");
lcd.write(byte(5));
lcd.write(byte(6));
lcd.print(":");
if (t22<10) lcd.print(" ");
if (t22>0.0) lcd.print("+");
lcd.print(t22,1);
// lcd.write(0b11011111);
lcd.write(byte(0));
lcd.print("C ");
// read the value from the sensor:
u = analogRead(divbaterie);
u1 = k1*5.0*u/1023.0; // conver ADC in voltage value
u1 = u1/divizor+0.05;
lcd.setCursor(14, 0);
lcd.write(byte(1));
lcd.write(byte(2));
lcd.setCursor(11, 1);
if (u1<10) lcd.print(" ");
lcd.print(u1,1);
lcd.print("V");
}
Ca marime, el nu este foarte mare fata de cel care avea doar termometru dublu:
Am realizat montajul si am comparat cu un multimetru:
Ca de obicei, am facut un filmulet.. numit termometru dublu cu indicare stare acumulator masina cu ATtiny85
Salut,
RăspundețiȘtergereSe pot pune 2 senzori DS18b20 si un display 0.96" I2C Serial 128X64 OLED ?
Multumesc.
sunt sanse sa se poata prin folosirea librariei SSD1306XLED ( http://tinusaur.org/projects/ssd1306xled/ )
ȘtergereLa un cronotermostat v-ati gandit? Sau aveti cumva realizat asa ceva?
RăspundețiȘtergeretermostat pentru centrala?
Ștergeresalut frumos
RăspundețiȘtergereVă urmăresc munca cu attiny85
dar nu am găsit
Am nevoie de un termostat cu attiny85 dacă poate fi cu un afișaj oled și poate fi fără
ar regla temperatura din schiță
ai asa ceva ce ai facut
Văd un termometru
dar nu știu cum să refac o schiță
salutări din Serbia