This shows you the differences between two versions of the page.
pm:prj2022:agmocanu:liedetector [2022/05/11 23:16] teodora.nedelcu [Lie Detector] |
pm:prj2022:agmocanu:liedetector [2022/06/02 10:51] (current) teodora.nedelcu [Software Design] |
||
---|---|---|---|
Line 8: | Line 8: | ||
===== Descriere generală ===== | ===== Descriere generală ===== | ||
- | {{:pm:prj2022:agmocanu:block_diagram.png?400|}} | + | {{:pm:prj2022:agmocanu:blovk_diagram.jpeg?400|}} |
- | We use the button to start the measuring of the pulse and if its elevated the person lied. A message will appear on the display with the result. | + | We start the measuring of the pulse and if its elevated the person lied. A message will appear on the display with the result. |
+ | {{:pm:prj2022:agmocanu:nedelcu.jpeg?800|}} | ||
===== Hardware Design ===== | ===== Hardware Design ===== | ||
Line 19: | Line 19: | ||
* Arduino Uno | * Arduino Uno | ||
* Pulse Sensor | * Pulse Sensor | ||
- | * Button | ||
* Display LCD 1602 | * Display LCD 1602 | ||
* Cables | * Cables | ||
+ | {{:pm:prj2022:agmocanu:lala.jpeg?600|}} | ||
===== Software Design ===== | ===== Software Design ===== | ||
+ | The code displays on LCD the amount of beats per minute calculated by the pulse sensor. | ||
+ | I used the following libraries: | ||
+ | 1. For the LCD display | ||
+ | LiquidCrystal_I2C.h | ||
+ | Wire.h | ||
+ | |||
+ | 2. For the pulse sensor | ||
+ | PulseSensorPlayground.h | ||
+ | |||
+ | |||
+ | | ||
+ | Code: | ||
+ | #define USE_ARDUINO_INTERRUPTS true | ||
+ | #include <PulseSensorPlayground.h> | ||
+ | #include <LiquidCrystal_I2C.h> | ||
+ | #include <Wire.h> | ||
- | ===== Rezultate Obţinute ===== | + | const int PulseWire = 0; |
+ | int Threshold = 550; | ||
+ | |||
+ | LiquidCrystal_I2C lcd(0x27,16,2); | ||
+ | |||
+ | PulseSensorPlayground pulseSensor; | ||
+ | void setup() { | ||
+ | lcd.init(); | ||
+ | Serial.begin(9600); | ||
+ | pulseSensor.analogInput(PulseWire); | ||
+ | pulseSensor.setThreshold(Threshold); | ||
+ | if (pulseSensor.begin()) { | ||
+ | Serial.println("We created a pulseSensor Object !"); | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | int myBPM = pulseSensor.getBeatsPerMinute(); | ||
+ | if (pulseSensor.sawStartOfBeat()) { | ||
+ | Serial.println("♥ A HeartBeat Happened ! "); | ||
+ | lcd.backlight(); | ||
+ | lcd.setCursor(0, 0); | ||
+ | lcd.print("BPM"); | ||
+ | lcd.setCursor(0, 1); | ||
+ | if (myBPM < 100){ | ||
+ | lcd.print(" "); | ||
+ | lcd.print(myBPM); | ||
+ | lcd.setCursor(4,1); | ||
+ | lcd.print(" "); | ||
+ | }else{ | ||
+ | lcd.print(myBPM); | ||
+ | lcd.setCursor(4,1); | ||
+ | lcd.print("Lie"); | ||
+ | | ||
+ | } | ||
+ | Serial.println(myBPM); | ||
+ | } | ||
+ | delay(20); | ||
+ | |||
+ | } | ||
+ | | ||
+ | |||
+ | |||
+ | ===== Rezultate Obţinute ===== | ||
+ | {{:pm:prj2022:agmocanu:LIEDETECT.jpeg?400|}} {{:pm:prj2022:agmocanu:LIEDETECT2.jpeg?500|}} | ||
===== Concluzii ===== | ===== Concluzii ===== | ||
+ | This project taught me how to use Arduino, LCD display and a pulse sensor. I think it would be fun to try and build different useful things this way. | ||
- | ===== Download ===== | ||
- | ===== Jurnal ===== | ||
Line 44: | Line 103: | ||
===== Bibliografie/Resurse ===== | ===== Bibliografie/Resurse ===== | ||
+ | https://how2electronics.com/ | ||
+ | |||
+ | https://arduino.cc/ | ||
+ | http://robojax.com/node/921 | ||
<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> |