Skip to main content

Projet MEBARKIA AMMACHE EL HELOU LUSINIER GAL

Allumage du LED :


#define LED 6

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(2000);                      // wait for a second
  digitalWrite(LED, LOW);   // turn the LED off by making the voltage LOW
  delay(2000);                      // wait for a second
}

BOUTON PRESSE :
#define BOUTON 2

void setup() {
  // put your setup code here, to run once:
  pinMode(BOUTON, INPUT);
  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
  int etat_bouton = digitalRead(BOUTON);


  if(etat_bouton == 1){
    Serial.println("Bouton pressé");
      }
  delay(100);

}
Application du code :

image.png


POTENTIOMETRE :
#define POT A0

void setup() {
  pinMode(POT, INPUT);
  Serial.begin(9600);
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  int valeur = analogRead(POT);
  Serial.print("Valeur du potentiometre :");
  Serial.println(valeur);

  delay(200);
}

Vérification du code:

XXX.png


Screenshot 2025-03-03 at 11.08.11 AM.png


TEMPERATURE :
#include "Seeed_SHT35.h"


/*SAMD core*/
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
  #define SDAPIN  20
  #define SCLPIN  21
  #define RSTPIN  7
  #define SERIAL SerialUSB
#else
  #define SDAPIN  A4
  #define SCLPIN  A5
  #define RSTPIN  2
  #define SERIAL Serial
#endif

SHT35 sensor(SCLPIN);


void setup()
{
    SERIAL.begin(115200);
    delay(10);
    SERIAL.println("serial start!!");
    if(sensor.init())
    {
      SERIAL.println("sensor init failed!!!");
    }
    delay(1000);
}


void loop()
{
     u16 value=0;
    u8 data[6]={0};
    float temp,hum;
    if(NO_ERROR!=sensor.read_meas_data_single_shot(HIGH_REP_WITH_STRCH,&temp,&hum))
    {
      SERIAL.println("read temp failed!!");
      SERIAL.println("   ");
      SERIAL.println("   ");
      SERIAL.println("   ");
    }
    else
    {
      SERIAL.println("read data :");
      SERIAL.print("temperature = ");
      SERIAL.print(temp);
    SERIAL.println(" ℃ ");

      SERIAL.print("humidity = ");
      SERIAL.print(hum);
    SERIAL.println(" % ");

      SERIAL.println("   ");
      SERIAL.println("   ");
      SERIAL.println("   ");
    }
    delay(1000);
}




APPLICATION DU CODE :

image.pngLED S'ALLUME EN FONCTION DE LA TEMPERATURE :

Screenshot 2025-03-03 at 11.09.43 AM.png
Image 2: Led s'allume avec la temperature

#include "Seeed_SHT35.h"
#define LED 6

/*SAMD core*/
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
  #define SDAPIN  20
  #define SCLPIN  21
  #define RSTPIN  7
  #define SERIAL SerialUSB
#else
  #define SDAPIN  A4
  #define SCLPIN  A5
  #define RSTPIN  2
  #define SERIAL Serial
#endif

SHT35 sensor(SCLPIN);


void setup()
{
    SERIAL.begin(115200);
    delay(10);
    SERIAL.println("serial start!!");
    if(sensor.init())
    {
      SERIAL.println("sensor init failed!!!");
    }
    delay(1000);
    pinMode(LED, OUTPUT);
}


void loop()
{
     u16 value=0;
    u8 data[6]={0};
    float temp,hum;
    if(NO_ERROR!=sensor.read_meas_data_single_shot(HIGH_REP_WITH_STRCH,&temp,&hum))
    {
      SERIAL.println("read temp failed!!");
      SERIAL.println("   ");
      SERIAL.println("   ");
      SERIAL.println("   ");
    }
    else
    {
      SERIAL.println("read data :");
      SERIAL.print("temperature = ");
      SERIAL.print(temp);
      if (temp >25){
        digitalWrite(LED, HIGH);  // turn the LED on (HIGH is the voltage level)
        delay(2000);      
      }
    SERIAL.println(" ℃ ");

      SERIAL.print("humidity = ");
      SERIAL.print(hum);
    SERIAL.println(" % ");

      SERIAL.println("   ");
      SERIAL.println("   ");
      SERIAL.println("   ");
    }
    delay(1000);
}


Screenshot 2025-03-03 at 11.13.17 AM.png
Image 3: Motor

Impression 3D: 

Le design était effectué sur TINKERCAD

ETAPE 1

Screenshot 2025-03-05 at 2.17.58 PM.png

ETAPE 2

Screenshot 2025-03-05 at 2.32.56 PM.jpeg

ETAPE 3

Screenshot 2025-03-05 at 2.34.06 PM.jpeg

ETAPE 4

Screenshot 2025-03-05 at 2.36.45 PM.jpeg

ETAPE 5

Height: 40

Diameter: 51 

Screenshot 2025-03-05 at 2.42.12 PM.pngScreenshot 2025-03-05 at 2.42.07 PM.png

ETAPE 6:

Screenshot 2025-03-05 at 2.43.03 PM.png

ETAPE 7

Screenshot 2025-03-05 at 2.58.04 PM.jpeg

ETAPE 8

Screenshot 2025-03-05 at 2.59.50 PM.jpeg

ETAPE 9

Screenshot 2025-03-05 at 3.02.56 PM.jpeg

ETAPE 10

Screenshot 2025-03-05 at 3.10.02 PM.jpeg

ETAPE 11

Screenshot 2025-03-05 at 3.12.51 PM.png     

ETAPE 12

Screenshot 2025-03-05 at 3.18.34 PM.png

ETAPE 13

Screenshot 2025-03-05 at 3.21.15 PM.jpeg

ETAPE 14

Screenshot 2025-03-05 at 3.22.07 PM.png

ETAPE 15

Screenshot 2025-03-05 at 3.27.50 PM.png

ETAPE 16

Screenshot 2025-03-05 at 3.34.53 PM.png

ETAPE 17

Screenshot 2025-03-05 at 3.37.52 PM.png

ETAPE 18

Screenshot 2025-03-05 at 3.42.10 PM.png

 

ETAPE 19

Screenshot 2025-03-05 at 3.52.23 PM.png

ETAPE 20

Screenshot 2025-03-05 at 3.56.08 PM.png

FINAL TINKERCAD VERSION: 

Screenshot 2025-03-05 at 3.56.50 PM.png

 

EXPORT TO STL FORMAT:

Screenshot 2025-03-05 at 3.58.39 PM.png

FINAL 3D PRODUCT:

Screenshot 2025-03-06 at 11.32.36 AM.png

Screenshot 2025-03-06 at 11.32.44 AM.pngScreenshot 2025-03-06 at 11.32.53 AM.pngScreenshot 2025-03-06 at 11.33.03 AM.pngScreenshot 2025-03-06 at 11.33.11 AM.png

Projet Finale:

  • Concevoir un système d’alerte de température qui détecte une chaleur excessive avec thermomètre , déclenche une alerte visuelle avec une LED et active un ventilateur pour refroidir l’environnement.
  • Ce système peut être utilisé pour protéger des équipements électroniques, surveiller une pièce, ou éviter la surchauffe d’un boîtier.