Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2023:apredescu:dumitru [2023/05/07 19:16]
andreea.dumitru0110
pm:prj2023:apredescu:dumitru [2023/05/28 23:35] (current)
andreea.dumitru0110
Line 17: Line 17:
 -~~~~~~~~~~~~~~~~~- -~~~~~~~~~~~~~~~~~-
  
-<note tip> 
-O schemă bloc cu toate modulele proiectului vostru, atât software cât şi hardware însoţită de o descriere a acestora precum şi a modului în care interacţionează. 
  
-Exemplu de schemă blochttp://www.robs-projects.com/​mp3proj/​newplayer.html +  * Pavlov'​s Catthe whole device that dispenses a specified quantity of candies every time a certain melody is playing and when the sensor detects the presence of a hand. 
-</​note>​+  * Arduino MKR1000: the wi-fi board 
 +  * Buzzer: it is a signaling device that will play a melody 
 +  * Servo motor: this small motor will move the "​door"​ allowing the candies to be dispensed 
 +  * Phototransistor: ​ this will detect the presence of the hand  
  
 ===== Hardware Design ===== ===== Hardware Design =====
  
-<note tip> 
-Aici puneţi tot ce ţine de hardware design: 
-  * listă de piese 
-  * scheme electrice (se pot lua şi de pe Internet şi din datasheet-uri,​ e.g. http://​www.captain.at/​electronic-atmega16-mmc-schematic.png) 
-  * diagrame de semnal ​ 
-  * rezultatele simulării 
-</​note>​ 
  
-===== Software Design =====+{{:​pm:​prj2023:​apredescu:​arduino_diagram.png?​200|}}
  
 +  * Servo motor: A servo motor is a BLDC motor with a sensor for positional feedback. This allows the output shaft to be moved to a particular angle, position, and velocity that a regular motor cannot do.
 +  * Buzzer: A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical,​ or piezoelectric (piezo for short). Typical uses of buzzers and beepers include alarm devices, timers, train and confirmation of user input such as a mouse click or keystroke.
 +  * Phototransistor:​ A semiconductor device like a phototransistor is used to detect the light levels and changes the flow of current among emitter & collector terminals based on the light level it gets.
 +  * Arduino MKR1000: The Arduino MKR 1000 WiFi is the easiest point of entry to basic IoT and pico-network application design.
 + This is the block schema of the project
 +{{ :​pm:​prj2023:​apredescu:​block_schema.png?​500 |}}
 + This is the scheme with all the components connected.
 +{{ :​pm:​prj2023:​apredescu:​schema_electrica_pavlov.jpg?​100 |}}
 +   
  
 +===== Software Design =====
 +   Code description
 +First of all, we include all the libraries needed for Arduino, but also for the wi-fi and telegram part. We set the portion to the default value of 1, we declare the servo object, we declare the buzzerPin (i used pin 6 on the Arduino board), we set the initial value of startDetecting as being false, the timer will be 0, also the oldchatid will be null.
 +In the method setup() we are starting the connection at wi-fi, we declare the token of the telegram bot, we declare the emoji used at the telegram keyboard, initialize the rows of the keyboard, and also we make the buzzerPin an output.
 +In the loop  we check if there are any updates in the chat and if there is an update, we will print the message (the codes used for the keyboard emoji). If the text is indicating melody and food, then we play a certain melody, we display a message, the detection begins, we display a message that the servo is moving and we also calculate the time that is required until the hand reaches the range of the phototransistor. If the message is melody and no food, another melody will be played, we send a message that indicates that nothing will be done. Here are 2 cases. First, the hand is detected and it will display that the hand is detected, but nothing will happen and the second case, no hand is detected in the past minute and there will be a message saying that no hand was detected in the past minute. We also can set the amount of candies that will be dispensed. To be able to detect the hand, we need to know the threshold of the phototransistor and we adapt it in order to be able to differentiate when a hand is in range and when it is just ambiental light.
 +We also have a function for moving the servo. In the for loop we open the "​door"​ by moving the servo from 0 to 90 degrees, we delay the closing by multiplying the portionAmount with 300 and after that we close the "​door"​ by moving the servo from 90 to 0 degrees.
 +The last function in the loop is playMelody which will play the melody chosen before. ​
 +        Library used:
 +          * ArduinoJson.h
 +          * WiFi101.h
 +          * SPI.h
 +          * TelegramBot.h
 +          * Servo.h
 +          * pitches.h
 +===== Final results =====
 <note tip> <note tip>
-Descrierea codului aplicaţiei (firmware):​ + After finishing the project these are the final results 
-  * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) +https://​youtu.be/​Hcyqg9mMQoI
-  * librării şi surse 3rd-party (e.g. Procyon AVRlib) +
-  * algoritmi şi structuri pe care plănuiţi să le implementaţi +
-  * (etapa 3) surse şi funcţii implementate+
 </​note>​ </​note>​
  
-===== Rezultate Obţinute ​===== +===== Conclusions ​===== 
- + The project was a bit harder than I thought when i chose it. It required more knowledge on the software part, but in the end i managed to get it done. I used some of the knowledge from the labs, but i still had some problems with the bot part, because it was not recognized. ​ 
-<note tip> + I forced myself to make it on my own, without any help so i can learn more things about microprocessors and the connection that we can make between them and an app. 
-Care au fost rezultatele obţinute în urma realizării proiectului vostru+ The project is working as expected, i managed to solve the problem with the servo motor which was moving right after i was uploading the code on the board.  
-</​note>​ + From my point of view, this is a success project given the fact that it is working as i was expecting.
- +
-===== Concluzii =====+
  
 ===== Download ===== ===== Download =====
- 
 <note warning> <note warning>
-O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului:​ surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-)+Here is the archive of the project
- +It contains: 
-Fişierele se încarcă pe wiki folosind facilitatea ​**Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:pm:prj20??:c?** sau **:pm:​prj20??:​c?:​nume_student** (dacă este cazul). **Exemplu:​** Dumitru Alin, 331CC -> **:​pm:​prj2009:​cc:​dumitru_alin**.+  block schema 
 +  ​the code file 
 +  ​the pitches file 
 +  ​the video 
 +{{:pm:prj2023:apredescu:dumitru_andreea-raluca_fils_1221a_materials.zip|}}
 </​note>​ </​note>​
  
-===== Jurnal ​=====+===== Journal ​=====
  
-<note tip> +  * 22.04.2023 - Choosing the project theme 
-Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului+  * 07.05.2023 - Published the description of the project 
-</​note>​+  * 20.05.2023 - Added the hardware design  
 +  * 28.05.2023 - Added the software design part + the results part + the bibliography part
  
-===== Bibliografie/​Resurse ​=====+===== Resources ​===== 
 +  - https://​docs.arduino.cc/​hardware/​mkr-1000-wifi 
 +  - https://​projecthub.arduino.cc/​Arduino_Genuino/​pavlovs-cat-296cc2
  
-<​note>​ 
-Listă cu documente, datasheet-uri,​ resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. 
-</​note>​ 
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
  
pm/prj2023/apredescu/dumitru.1683476199.txt.gz · Last modified: 2023/05/07 19:16 by andreea.dumitru0110
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0