Pametna garaža
OŠ Mate Lovraka, PetrinjaVideo snimka
Izrada projekta
Mobilna aplikacija
Shema projekta
Na 1. Arduino MK spojene su diode: crvene (izlaz 0), žute (izlaz 1), zelene (izlaz 6)
Na 2. Arduino MK spojen je step motor – podizanje vrata – žuta žica (pin9), plava (pin8), ljubičasta (pin10), siva (pin11), smeđa (GND), crvena (5V) – spuštanje vrata – žuta žica (pin8), plava (pin9), ljubičasta (pin10), siva (pin11), smeđa (GND), crvena (5V).
Arduino program
/* Comment this out to disable prints and save space */ #define BLYNK_PRINT SerialUSB #include #include #include // You should get Auth Token in the Blynk App.b // Go to the Project Settings (nut icon). char auth[] = "9f7fc8a940614d9e8f168bcd4550c0a4"; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "OSMateLovraka"; char pass[] = "B8Rnw9HX"; void setup() { // Debug console SerialUSB.begin(9600); Blynk.begin(auth, ssid, pass); // You can also specify server: //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442); //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442); } void loop() { Blynk.run(); // You can inject your own code or combine it with other sketches. // Check other examples on how to communicate with Blynk. Remember // to avoid delay() function! }
Arduino program ovoga projekta možete preuzeti ovdje.
#include const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor // Abaliziraj broj pin-ova od 8 do 11: Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11); int stepCount = 300; // Broj koraka void setup() { } void loop() { // Procitaj senzorovu valutu: int sensorReading = analogRead(A0); // map it to a range from 0 to 100: int motorSpeed = map(sensorReading, 99, 1023, 0, 100); // Odredi brzinu motora: if (motorSpeed > 10) { myStepper.setSpeed(motorSpeed); // Broj koraka 1/100: myStepper.step(stepsPerRevolution / 100); } }
Arduino program ovoga projekta možete preuzeti ovdje.
Autori
Projekt su izradili Roko Ećimović i Matej Vidović uz mentorstvo Andree Galian – Pucović iz OŠ Mate Lovraka, Petrinja.
Projekt je prijavljen na temu: Internet of Things: Pametna rasvjeta.