Dibujo animado lluvia sol – Itinerario aprendizaje proyecto 15

Nuestro Itinerario de aprendizaje maker esta desarrollado para aprender todos los fundamentos y un poco más acerca de electrónica y programación.

Si completas el itinerario serás capaz de crear casi cualquier proyecto que imagines. En cada proyecto se introducen nuevos conceptos, de modo que aprenderás haciendo o creando de una manera amena y divertida.

Construye este divertido aparato que te mostrará si el día es lluvioso o no.

Project 15
RAINY OR SUNNY DAY CARTOON WARNING

Build this funny warning using our rain and steam sensor

BEFORE TO START

DIFFICULTY LEVEL: Intermediate
DURATION OF THE ACTIVITY: 40 min.

MATERIALS:
4in1 board
Buzzer
Battery holder & wires
Battery holder & wires

1 - Build&Code 4in1 board
1 - Rain and steam sensor
1 - Servomotor

Battery holder, USB cable and wires.

15 - Rain and steam sensor

The Rain and steam sensoris an analog sensor. When the sensor detects a higher level of humidity, the output voltage increases. The connector is not waterproof, please be careful not to put the connector directly in water.

It has a surface that has different conductivity lines. When more current is able to pass between them, higher value output.

In some way, it can be also used as a touch panel sensor in your maker creations, so your fingers are also conductive.

15 - Circuit

In next examples we used this connection scheme.

Connect wires from 4in1 board to components:
- DIO10 to Rain Sensor
- DIO3 to servomotor

That's the easiest part!!!
Let's code!!
15.1 - Sensor reading program

We can read sensor with a digital input. It wil return 1 when there is conductivity throught it's lines. Can be water, steam, or our finger. Be careful with water, to isolate the wires part from it.

Block Coding

Used live mode to see sensor output through variable value.

Arduino Coding
#define PIN_DIGITAL_RAIN_SENSOR 10  // Entrada digital para la señal del sensor de lluvia

int sensorValue = 0;

void setup(){
   Serial.begin(9600);
   pinMode(PIN_DIGITAL_RAIN_SENSOR, INPUT);
}
void loop(){
   sensorValue = digitalRead(PIN_DIGITAL_RAIN_SENSOR); // Leer datos del puerto digital
   Serial.print("Digital value: "); 
   Serial.println(sensorValue); // Salida del valor digital al monitor del puerto
 
   delay(500); // Retardo entre mediciones
}
15.2 - Automatic closing window

We imagine an application that consists of closing a window automatically when rain is detected to ensure all remains dry inside. We will use the servo as actuator to close the window.

Block Coding
Arduino Coding
#include <Servo.h>
#define WATERSENSOR 10

Servo cierre;

int sensorValue;

void setup(){
   Serial.begin(9600);
   digitalWrite(sensorValue, INPUT);
   cierre.attach(3);
}
void loop(){
  sensorValue = digitalRead(WATERSENSOR); // Leer datos del puerto digital
  
    if (sensorValue == HIGH){
      cierre.write(180);
      Serial.print("Digital value: "); 
      Serial.println(sensorValue);
   }   
   
   if (sensorValue == LOW){
      cierre.write(0);
      Serial.print("Digital value: "); 
      Serial.println(sensorValue); // Salida del valor digital al monitor del puerto
      delay(200);
       // Retardo entre mediciones
   }
}
Final project - Rainy or sunny day cartoon

You wake up in the morning, it's still dark and you're not sure of the outside weather. What clothes to choose? Here the solution! Build this funny cartoon!! Here cardboard template

Block coding
Arduino code
#include <Servo.h>
#define WATERSENSOR 10

Servo cierre;

int sensorValue;

void setup(){
   Serial.begin(9600);
   digitalWrite(sensorValue, INPUT);
   cierre.attach(3);
}
void loop(){
  sensorValue = digitalRead(WATERSENSOR); // Leer datos del puerto digital
  
    if (sensorValue == HIGH){
      cierre.write(180);
      Serial.print("Digital value: "); 
      Serial.println(sensorValue);
   }   
   
   if (sensorValue == LOW){
      cierre.write(0);
      Serial.print("Digital value: "); 
      Serial.println(sensorValue); // Salida del valor digital al monitor del puerto
      delay(200);
       // Retardo entre mediciones
   }
}
SHARE YOUR CARTOON!!
FINISHED!
previous arrow
next arrow
Slider

El Mega Maker Kit te ofrece el todo el material que necesitas para completar el itinerario, pero si dispones de otro kit, también puedes realizar algunos proyectos. Te animamos a que los revises todos, o que compres los componentes que necesites. Puedes verificar que actividades puedes realizar en nuestra página del Itinerario de aprendizaje.

0 0

0