About connecting Arduino Uno board to Wemos d1 r1 board

Hello, I am new here and with arduino, I have a project of Temperature Controlled Fan using Dht11 sensor with Arduino Uno board. How can I connect the arduino board to Wemos D1 R1 so that I can connect my project to wifi also to database. Please help me

This is a question that come up here fairly regularly. The usual thing is to ask, why do you need the Uno. Can't you connect the sensor(s) and fan driver to the D1 board. It is usually a lot less trouble to do it with just one program on the D1 than to connect 2 boards and write 2 programs.

If you really want to use both boards, search for "connect wemos d1 to Uno" to see what others have done.

I cant figure it out. I tried to use my codes of arduino and place it to wemos d1 r1, but it gives lot of errors, I tried to fix it but i dont know how.

How about show the code and ask for help in the migration?

I don't see how adding the complexity of another processor will help.

Post the code that you tried. Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

Post a schematic of the Wemos with the DHT11 and motor driver so that we can see how it should be wired.

I got my last post in after you improperly posted the code. You can go back and fix your post by highlighting the code and clicking the </> in the menu bar.
code tags new

Read my last post. Post the error as requested and a schematic and we can help you.

1 Like

Try this code with your Wemos.

I don't have hardware to test so I'm not sure if it works as expected.

I have compiled using this library: GitHub - markruys/arduino-DHT: Efficient DHT library for Arduino

/* LCD Screen */

#include "DHT.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
int ledred = D5;
int ledblue = D6;
int fan = D7;
LiquidCrystal_I2C lcd(0x27,16,2);
#define DHTPIN D8      // what pin we're connected to

DHT dht;

void setup()
{
  pinMode(fan, OUTPUT);
  pinMode(ledred, OUTPUT);
  pinMode(ledblue, OUTPUT); // initialize the lcd
  lcd.init();               // initialize the lcd
  lcd.init();
// Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(1,0);
  lcd.print(" Temperature");
  lcd.setCursor(1,1);
  lcd.print("Controller Fan");
  delay(2000);
  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print("MADE BY TUJONGS");
  delay(2000);
  lcd.clear();
  Serial.begin(9600);
  dht.setup(DHTPIN);
}

void loop()
{
// Wait a few seconds between measurements.
  delay(2000);

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.getHumidity();
// Read temperature as Celsius
  float t = dht.getTemperature();
// Read temperature as Fahrenheit
  float f = dht.getTemperature();

  f = dht.toFahrenheit(f);

// Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f))
  {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("temperature: ");
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(f);
  Serial.print(" *F\t");

  lcd.setCursor(0,0);

  lcd.print(" TEMP: ");
  lcd.print(t); // Printing terature on LCD
  lcd.print(" C ");
  lcd.setCursor(0,1);
  if(t < 32)
  {
    digitalWrite(fan, LOW);
    lcd.print(" FAN OFF ");
    delay(100);
    digitalWrite(ledred, HIGH);
    digitalWrite(ledblue, LOW);
  }

  else if(t > 32)
  {
    digitalWrite(fan, HIGH);
    lcd.print("    FAN ON        ");
    delay(100);
    digitalWrite(ledred, LOW);
    digitalWrite(ledblue, HIGH);

  }

  delay(3000);
}

WARNING: library LiquidCrystal_I2C claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp8266 architecture(s).

How to solve this?

Please post full details of your project:
Which processor are you using?
Which IDE?
Actual sketch in code tags per forum guidelines

You wrote as titel "warning library"

So I looked up your history on 29.06.2022 18:15 it was

  • 1 day visited * 18m read time * 5 topics viewed * 18 posts read

So as an registrated arduino user you are a newcomer and I assume a newcomer in general.
Then you are asking

So you really seem to be a newcomer. In this case I see your title almost as clickbaiting.
You should change the title to something that expresses better what your question is.
I have coded with ESP8266 and ESP32 quite some projects that use I2C and they worked.

I did a quogling
https://www.google.de/search?as_q=arduino+ESP8266+LiquidCrystal_I2C.h
and found this

So it should really work.

Did you analyse the I2C-adress by running the I2C-scanner-example?

If you want really help you would have top You can post code by using this method that adds the code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

and give a description how you wired your I2C-LCD to your ESP8266

best regards Stefan

It's a warning; sometimes warnings can be ignored, sometimes not. So the question is: "does it work"?

You haven't given us any idea which library you're using; there are a number of LiquidCrystal_I2C libraries.

I have merged your posts as too similar @reybenss1.

Please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple threads on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.

Use the hd44780 library by Bill Perry. it will work with the ESP8266. I know because I have used it with those processors. The big advantages of that library over others is that the hd44780 library automatically detects the I2C address and the pin mapping between the LCD and the I2C backpack. the hd44780 library is available via the IDE library manager and it comes with lots of example code and documentation as well as a diagnostic program to help troubleshoot problems.

You could have a serial link between the two and structure things so that the UNO sends the data to the WeMos when the WeMos asks for it.
Or you can tear it all down, man, and re-build it to fit the ESP-3V scheme of things.

Won't work. You have defined Uno GPIO pins, not D1 pins. The D1 does not have pins for GPIO 11, 10, 8 and 9.

I have fixed the compiling errors but forgot to change the pinout.

I have fixed the pinout on code above.

The library below is supposed to work with ESP.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.