====== Capteur de pulsations ====== ====== Arduino : ====== * Porteur(s) du projet : Océane Gardet-Pizzo * Date : 10/04/2019 * Licence : libre ! * Contexte : [[http://www.tonerkebab.fr/wiki/doku.php/wiki:projets:arduino-2019:accueil|Projet arduino]] ==== Description / Intention ==== Afin d'amorcer mon travail de seconde année qui portera sur la représentation du corps dans la maladie, notamment à travers l'illustration et la vulgarisation médicale, je vais pour ce projet utiliser un capteur de pulsation grâce auquel l'animation interactive que je créerai se modifiera en fonction du rythme cardiaque. Ce dispositif permettra de rendre visibles les battements de cœur et la circulation sanguine « en temps réel », comme un moniteur cardiaque mais de manière plus illustrée, didactique et/ou poétique. N'ayant pas reçu le capteur à temps, j'ai dû changer de principe pour utiliser un autre capteur - ici le potentiomètre. Toujours dans cette idée de représentation du rythme cardiaque, j'ai voulu reprendre les codes graphiques des moniteurs et j'ai pour cela utilisé un programme qui dessine une ligne horizontale continue qui varie verticalement selon le sens dans lequel on fait tourner le potentiomètre. ==== Matériel ==== * Carte seeduino lotus * [[http://www.tonerkebab.fr/wiki/doku.php/wiki:projets:arduino-2019:accueil|Potentiomètre]] ==== Schéma==== {{ :wiki:projets:arduino-oceane-gardetpizzo:schema.jpg?nolink |}} ==== Programme processing ==== // librairie permettant de communiquer avec arduino import processing.serial.*; //Variables int lastxPos = 1; int lastheight = 0; float dmax = 1000; Serial myPort; // communication avec arduino int xPos = 1; // Position horizontale de la ligne float inByte ; void setup () { //paramètres d'affichage size(600, 400); // Port série printArray(Serial.list()); myPort = new Serial(this, Serial.list()[0], 9600); // // A serialEvent() is generated when a newline character is received : myPort.bufferUntil('\n'); background(0); } void draw () { //Tracé de la ligne stroke(255, 0, 0); //couleur ligne strokeWeight(2); //épaisseur ligne float d = dist(lastxPos, lastheight, xPos, height - inByte); println("d = "+d); if (d= width) { xPos = 0; lastxPos= 0; background(0); } else { //avancement de la ligne xPos++; } } void serialEvent (Serial myPort) { // get the ASCII string String inString = myPort.readStringUntil('\n'); if (inString != null) { inString = trim(inString); // trim off whitespaces inByte = float(inString); // convert to a number inByte = map(inByte, 0, 1023, 0, height); //map to the screen height } } ==== Programme arduino ==== void setup() { // communication avec processing Serial.begin(9600); } void loop() { // send the value of analog input 0: Serial.println(analogRead(A0)); // wait a bit for the analog-to-digital converter to stabilize after the last // reading: delay(2); } {{ :wiki:projets:arduino-oceane-gardetpizzo:sans_titre-1.jpg?nolink |}} {{ :wiki:projets:arduino-oceane-gardetpizzo:sans_titre-2.jpg?nolink |}} ==== Références==== * http://wiki.seeedstudio.com/Grove-Finger-clip_Heart_Rate_Sensor_with_shell/ * http://www.makery.info/2014/11/11/bricole-it-yourself-capter-son-pouls-du-bout-du-doigt/ * http://electroniqueamateur.blogspot.com/2015/01/mesurez-votre-rythme-cardiaque-avec.html * https://www.youtube.com/watch?v=k_OZnCYrpoE * https://www.youtube.com/watch?v=iH1bPQOCAH4