Configurare program

Arduino Soil Moisture Sensor

 How the Soil Moisture Sensor Works

Resistive Sensor

Uses two metal probes to measure electrical resistance. Wet soil has lower resistance, while dry soil has higher resistance.

Capacitive Sensor

Measures changes in soil capacitance and has no exposed metal parts. It provides more stable and long-lasting performance.

Both sensors provide an analog output that Arduino reads.

Wiring the Soil Moisture Sensor

Soil Sensor → Arduino
VCC         → 5V
GND         → GND
AO          → A0

The digital output (DO) pin is optional and can be used with a preset threshold.

Arduino Code (Basic Reading)


int soilPin = A0;
int soilValue = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  soilValue = analogRead(soilPin);

  Serial.print("Soil Moisture Value: ");
  Serial.println(soilValue);

  delay(1000);
}

Understanding Soil Moisture Values

Sensor Value Soil Condition
0 – 300 Very Wet
300 – 600 Moist
600 – 900 Dry
900 – 1023 Very Dry

Values may vary depending on soil type. Always calibrate with dry and wet soil.

Improved Code with Moisture Status


int soilPin = A0;
int soilValue = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  soilValue = analogRead(soilPin);

  Serial.print("Soil Moisture: ");
  Serial.print(soilValue);

  if (soilValue < 300) {
    Serial.println(" - WET");
  }
  else if (soilValue < 600) {
    Serial.println(" - MOIST");
  }
  else {
    Serial.println(" - DRY");
  }

  delay(1000);
}

Testing the Sensor

  1. Upload the code to Arduino
  2. Open the Serial Monitor
  3. Set baud rate to 9600
  4. Insert the sensor into soil
  5. Add water and observe changes

Wet soil produces lower values, while dry soil produces higher values.

Troubleshooting

  • Always reads 1023: Sensor not properly inserted
  • No value change: Loose wiring or faulty sensor
  • Unstable readings: Electrical noise or dry air
  • Corrosion: Use capacitive sensor instead of resistive

Optional Upgrades

  • Add relay and water pump for automatic irrigation
  • Add LCD or OLED display
  • Use ESP8266/ESP32 for IoT monitoring
  • Log data to SD card for analysis.
[mai mult...]

Cum găsești și elimini fișiere duplicate în OneDrive

Fișierele duplicate pot apărea în OneDrive atunci când sincronizarea se întrerupe, încarci același fișier de mai multe ori sau există conflicte între dispozitive. Iată metodele eficiente pentru a le identifica și șterge.

1. Verifică manual în OneDrive (Web sau PC)

Pe OneDrive Web

  1. Accesează: https://onedrive.live.com

  2. Folosește bara de căutare și caută după:

    • nume de fișier

    • extensii (ex. .jpg, .docx)

  3. Sortează fișierele după:

    • Nume (pentru a găsi duplicate cu nume similare)

    • Dimensiune

    • Data modificării

  4. Selectează fișierele duplicate → Delete.

Pe PC (Folderul OneDrive)

  1. Deschide File Explorer → folderul OneDrive.

  2. Sortează după:

    • Nume

    • Dimensiune

    • Data modificării

  3. Compară și șterge manual duplicatele.

2. Folosește OneDrive „Manage Storage” (pe web)

  1. Accesează OneDrive Web → clic pe Settings (setări).

  2. Intră la Storage / Stocare.

  3. OneDrive afișează fișiere mari și conținut repetitiv sau similar (mai ales poze).

  4. Revizuiește → șterge duplicatele.

OneDrive nu are un detector automat complet de duplicate, dar ajută la identificarea fișierelor mari sau similare.

3. Elimină duplicatele create de conflictele de sincronizare

Uneori OneDrive creează fișiere de tipul:

  • filename (1).docx

  • filename - ComputerName.docx

  • filename-conflicted copy.docx

Cum să le găsești rapid:

  1. Deschide OneDrive în File Explorer.

  2. În căsuța de căutare introduce:

    * (1).*
    *copy*
    *conflicted*
  3. Verifică → compară → șterge duplicatele.

5. Curățare automată cu PowerShell (util pentru multe fișiere)

(Opțional, doar pentru utilizatori avansați)

Poți rula scripturi PowerShell care caută fișiere duplicate în folderul OneDrive pe baza hash-urilor, asigurând eliminarea exactă a duplicatelor.

[mai mult...]

Cum editezi meniul de pagini (Pages/Menu) în WordPress folosind Avada

Editarea meniului principal de navigare (Header Menu)

1. Deschide editorul de meniuri din WordPress

1. Autentifică-te în panoul de administrare **WordPress**
2. Mergi la:
* Aspect → Meniuri (Appearance → Menus)**

2. Selectează meniul corect

* Din partea de sus, alege meniul asociat cu:

* **Main Menu**
* **Primary Menu**
* sau **Header Menu**
* Apasă **Selectează**

 3. Adaugă pagini în meniu

În partea stângă:

1. Apasă pe **Pagini (Pages)**
2. Bifează paginile dorite
3. Apasă **Adaugă în meniu (Add to Menu)**

 4. Reordonează meniul

* Trage și plasează elementele pentru a schimba ordinea
* Trage ușor spre dreapta pentru a crea:

* **Submeniuri (dropdown-uri)**

 5. Șterge o pagină din meniu

* Apasă săgeata de lângă elementul din meniu
* Apasă **Elimină (Remove)**

6. Salvează modificările

Apasă **Salvează meniul (Save Menu)**

Meniul este acum actualizat pe site.

Editează conținutul unei pagini deja din meniu

Dacă vrei să modifici **conținutul** unei pagini:

1. Mergi la **Pagini → Toate paginile (Pages → All Pages)**
2. Apasă pe numele paginii
3. Editează folosind:

* **Avada Live Builder**
* sau editorul clasic WordPress
4. Apasă **Actualizare (Update)**

⚠️ Acest lucru **nu modifică structura meniului**, doar conținutul paginii.

Setări speciale pentru meniu în Avada (Important)

Dacă meniul nu apare corect sau nu funcționează cum trebuie:

1. Mergi la:
**Avada → Options → Menu**
2. Verifică setări precum:

* Meniu fix (Sticky Menu)
* Meniu mobil (Mobile Menu)
* Mega Menu

(Acestea sunt controale specifice temei **Avada**)

Editarea meniului din subsol (Footer Menu), dacă există

1. Mergi la **Aspect → Meniuri (Appearance → Menus)**
2. Selectează meniul asociat cu:

* **Footer Menu**
3. Editează în același mod
4. Apasă **Salvează**

Probleme frecvente și soluții

| Problemă | Soluție |
| ———————— | —————————————– |
| Modificările nu apar | Șterge cache-ul / reîmprospătează pagina |
| Editezi meniul greșit | Verifică locația meniului (jos în pagină) |
| Meniul mobil este greșit | Avada → Options → Mobile Menu |

[mai mult...]

Arduino Weather Station guide

The DHT11 and DHT22 measure temperature and humidity. DHT22 offers higher accuracy and a wider range.

Pin Description
VCC +5V
DATA Data output (connect to D2)
NC Not connected
GND Ground

BMP180 / BME280

Measures pressure and temperature using the I2C interface.

Pin Description
VIN +3.3V or +5V
GND Ground
SCL I2C Clock (A5)
SDA I2C Data (A4)

LCD (16×2 I2C)

Displays data using the I2C interface — only two wires are required (SDA, SCL).
The most common I2C addresses are 0x27 or 0x3F.

Wiring Diagram

Component Arduino Pin Notes
DHT11 Data D2 Use 10kΩ pull-up resistor (optional)
BMP180 SDA A4 I2C Data
BMP180 SCL A5 I2C Clock
LCD SDA A4 Shared with BMP180
LCD SCL A5 Shared with BMP180
Power (+) 5V Common power line
Ground (–) GND Common ground

On Arduino Mega, use SDA = 20 and SCL = 21 instead.

Arduino Code Example


#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085.h>
#include <DHT.h>
#include <LiquidCrystal_I2C.h>

// Define sensors
#define DHTPIN 2
#define DHTTYPE DHT11   // or DHT22

DHT dht(DHTPIN, DHTTYPE);
Adafruit_BMP085 bmp;
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change address if needed (0x3F or 0x27)

void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.backlight();
  dht.begin();

  if (!bmp.begin()) {
    Serial.println("BMP180 not found!");
    lcd.print("BMP Error!");
    while (1);
  }

  lcd.clear();
  lcd.print("Weather Station");
  delay(2000);
}

void loop() {
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float p = bmp.readPressure() / 100.0; // hPa

  if (isnan(h) || isnan(t)) {
    Serial.println("DHT read error!");
    return;
  }

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("T:");
  lcd.print(t);
  lcd.print((char)223);
  lcd.print("C H:");
  lcd.print(h);
  lcd.print("%");

  lcd.setCursor(0, 1);
  lcd.print("P:");
  lcd.print(p);
  lcd.print(" hPa");

  Serial.print("Temp: "); Serial.print(t);
  Serial.print(" °C  Hum: "); Serial.print(h);
  Serial.print("%  Pressure: "); Serial.print(p);
  Serial.println(" hPa");

  delay(2000);
}

Explanation: This program reads data from the DHT and BMP sensors, then prints it to both the Serial Monitor and the LCD screen.

How It Works

  1. The sensors measure temperature, humidity, and pressure.
  2. Arduino reads and formats this data.
  3. The LCD displays readings in real time.
  4. Every few seconds, the data updates automatically.

Troubleshooting

Problem Possible Cause Solution
LCD shows random text Wrong I2C address Try 0x3F instead of 0x27
“BMP180 not found!” Wiring issue Check SDA/SCL and power
DHT readings show NaN Missing library or bad sensor Install DHT library, recheck wiring
LCD blank Contrast too low or backlight off Adjust contrast screw or enable backlight

Install these from Arduino IDE → Sketch → Include Library → Manage Libraries:

  • DHT sensor library by Adafruit
  • Adafruit Unified Sensor
  • Adafruit BMP085 Library or Adafruit BME280
  • LiquidCrystal_I2C

Optional: IoT Integration

Add an ESP8266 or ESP32 to send data to cloud platforms such as:

  • ThingSpeak
  • Blynk
  • Adafruit IO

Use libraries like ESP8266WiFi.h and HTTPClient.h to upload readings as HTTP requests.

Expansion Ideas

  • Add a rain sensor or anemometer (wind speed)
  • Store data on an SD card
  • Add a real-time clock (RTC) for timestamped data
  • Display graphs on a web dashboard.
[mai mult...]

Arduino Distance Sensor with OLED Display

This project uses an HC-SR04 Ultrasonic Distance Sensor and a 0.96” I2C OLED display to measure and display the distance to an object in real-time.
It’s an excellent beginner-to-intermediate Arduino project that teaches sensor interfacing, I2C communication, and real-time data display.

In this guide, you’ll learn how to:

  • Connect and use the HC-SR04 Ultrasonic Sensor
  • Display the measured distance on an OLED screen
  • Format readings for easy readability

Components Required

Component Quantity Description
Arduino Uno / Nano / Mega 1 Main controller
HC-SR04 Ultrasonic Sensor 1 Measures distance via sound waves
0.96” OLED Display (SSD1306) 1 I2C display for output
Breadboard 1 For wiring
Jumper wires 6–8 Male-to-male connections
USB cable 1 For programming and power

The HC-SR04 measures distance by sending out an ultrasonic pulse and timing how long it takes to bounce back.
The Arduino calculates the distance based on the time delay and the known speed of sound.

Distance Formula:

Distance (cm) = (Time in microseconds × 0.034) / 2

The division by 2 accounts for the round trip of the sound wave (out and back).

Pin Connections

Component Arduino Pin Notes
HC-SR04 VCC 5V Power supply
HC-SR04 GND GND Common ground
HC-SR04 TRIG D9 Trigger pin
HC-SR04 ECHO D10 Echo pin
OLED VCC 5V Power
OLED GND GND Ground
OLED SDA A4 I2C Data
OLED SCL A5 I2C Clock

Note: On Arduino Mega, use SDA = 20 and SCL = 21 instead.

Arduino Code Example


#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define TRIG_PIN 9
#define ECHO_PIN 10
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup() {
Serial.begin(9600);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);

// Initialize OLED
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("OLED not found!");
while (true);
}

display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Distance Sensor");
display.display();
delay(1500);
}

void loop() {
long duration;
float distance;

// Send trigger pulse
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);

// Measure echo time
duration = pulseIn(ECHO_PIN, HIGH);
distance = (duration * 0.034) / 2;

// Print to Serial Monitor
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");

// Display on OLED
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println("Distance Sensor");

display.setTextSize(2);
display.setCursor(0, 30);
display.print(distance, 1);
display.println(" cm");
display.display();

delay(500);
}

Explanation: The Arduino sends a pulse from the HC-SR04 and measures the time it takes to return.
It then converts this time into distance and displays it on the OLED screen.

Code Breakdown

  • pulseIn() measures the length of time the echo pin is HIGH.
  • Distance is calculated using the speed of sound (0.034 cm/μs).
  • Adafruit_SSD1306 and Adafruit_GFX libraries drive the OLED.
  • Display refreshes every 0.5 seconds for updated readings.

Install these via Arduino IDE → Sketch → Include Library → Manage Libraries:

  • Adafruit SSD1306
  • Adafruit GFX

Search for “Adafruit SSD1306” and “Adafruit GFX” and click Install.

Troubleshooting

Issue Cause Solution
OLED blank Wrong I2C address Try changing 0x3C to 0x3D
Distance always 0 Echo pin not connected Check TRIG and ECHO wiring
Unstable readings Object too close or far HC-SR04 range: 2–400 cm
Serial Monitor empty Wrong baud rate Ensure 9600 baud in Serial Monitor

Optional Upgrades

  • Add a buzzer that activates when an object is too close.
  • Display a bar graph or animation on the OLED.
  • Send readings to the cloud using ESP8266 / ESP32.
  • Log readings to an SD card.

Applications

  • Parking assist system
  • Object detection robot
  • Smart trash bin (auto open lid)
  • Liquid level detector.
[mai mult...]