Hello,
Im having the Task to code an Arduino to read the Temperature and show it in an LCD Screen and have some Rules so if its over 30 it should send an email to me but the problem is im trying since a week to do it but i cant i have already tried lots of examples but its nothing. I already configured an IP on my Arduino and now i would need help and a guide on how to do it so that it sends an email to me.
This is what i have coded until now and it works.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2); //The LCD address and size. You can change according to your setup
#define ONE_WIRE_BUS 2 //pin for sensor
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
/*
The setup function. We only start the sensors here
*/
void setup(void)
{
// Start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// Initialize LCD
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("PEGASUS");
lcd.setCursor(0, 1);
lcd.print("Measure it");
delay(2000);
lcd.clear();
}
/*
Main function, get and show the temperature
*/
void loop(void)
{
delay(3000);
// Request temperature readings
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
// Read temperature from the sensor
float tempC = sensors.getTempCByIndex(0);
delay(1000);
// Check if reading was successful
if (tempC != DEVICE_DISCONNECTED_C)
{
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(tempC);
// Display temperature on LCD
lcd.setCursor(0, 0);
lcd.print("Temperature:");
lcd.setCursor(0, 1);
lcd.print(tempC);
lcd.print((char)223);
lcd.print("C");
lcd.print(" | ");
lcd.print(DallasTemperature::toFahrenheit(tempC));
lcd.print(" F");
// Check if temperature exceeds 29°C
if (tempC >= 29.00) {
delay(3000);
lcd.clear();
lcd.print("Oida 's is warm");
delay(3000);
}
// Check if temperature falls below 15°C
else if (tempC <= 15.00) {
delay(3000);
lcd.clear();
lcd.print("Oida is des koid ");
delay(3000);
}
else {
lcd.setCursor(0, 2);
lcd.print(" "); // Clear the line
}
delay(3000);
}
else
{
Serial.println("Error: Could not read temperature data");
}
}
It’s possible that firewall block some port and It doesn’t work, however, it’s important to note that the Arduino Uno does not support SSL, which is required for secure email transmission.
Therefore, you would need to use a specific email provider that allows non-SSL communication or explore alternative email sending methods, such as using a third-party service or API designed to work with IoT devices like the Arduino.
-And im using the EMailSender library and Ethernet library but my Bytes are full and i cant execute the Code. Is there any minimised version for w5100.
– im trying the method with sendgrid where i put API, Email, etc. But my Bytes are full and i wanted to ask do you have any idea or maybe another library i could use so that my code would be optimized to work when i add more stuff ?
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.