Aller au contenu

A barograph for Arbutus

27 January 2014

  During some winter days, I played with my Arduino board because I had the project to design my own barograph. It would replace the barometer we have onboard. This barometer we always forget to check ... That's a mistake, with the analyse of the atmospheric pressure, we understand better what's going on outside. For example, 2 days ago, we were in a high pressure system, sunny, blue sky and almost no wind. But suddently, our new barograph rings because the pressure was falling. 3 hours latter, big clouds, the wind started to blow and now we have bad weather ... This was the arrival of a low pressure system ... Now we are just impatient that the pressure gets higher ! With a barometer, you can also sail on the ledge of a high pressure system if you found the narrow band where there is wind. When you have found this narrow band (I mean the wind), write down the pressure and try to sail within the constant pressure band ... you are supposed to keep the wind by this way. I have never tried but I read it happens like that if you want to sail arround a high pressure system ... Whatever, I decided a long time ago to make a barograph for Arbutus when I learned Arduino. What is Arduino ? The better is to have a look on their website here. With Arduino, it's easy to plug some sensors, to read a NMEA flow, to plug a smal screen, to put some buttons, to measure a voltage, a current, a resistance, etc. ... Behind Arduino, there is a real community so it's easy to find some examplew, some forums, some Arduino friends. A requirement to play with Arduino is to program a little bit with C language. No pointer or tricky concept to know, but simply how to create a function, some loops, etc. ... For the barograph, I used an arduino Uno, a TFT screen, an accurate pressure sensor BMP085, a push button, a buzzer, and an proto shield. Arduino Uno : 19.50 Euros TFT Screen : 22.70 Euros BMP085 : 9.20 Euros Proto Shield Arduino Mega Rev 3 : 6.3 Euros It is necessary to install a voltage regulator to transform the battery tension to 7V in order to supply energy for the barograph. Total : arround 60 euros without the shipment fee If you can get all of these equipements, you should have the same configuration than me. So I drawn a schema that connects the different modules all together : PTDC0258 For the resistance, feel free to suggest others values ... How to power the barograph ? I used a voltage regulator that drop down the 12V onboard to 7V. Also, it is important to say that when the barograph is on, there is not interference with my others electronics (SSB radio, hifi, etc. ...) installed on board of Arbutus. So now, how to ask Arduino to say mumy and daddy ? With the C code ! Our barograph is able to display with a graph the pressure history on different time scale : for 3, 6, 12, 24, 48, 72, 96 and 120 hours. And it displaies the realtime trends on 1 hour and 3 hours, the realtime pressure, and the temperature. capture It rings when the pressure is falling quicker than 140 Pa/h. To avoid the barograph rings too often, after the sailor aknowledged the alarm, the barograph won't ring for the next 3 hours. My buzzer has its resonnace frequency at 2500Hz so it's configured to ring at this frequency. It makes the buzzer louder. For those who wants to modify the C code, they would be pleased to share their modifications that would improve the code. Especially, the improvements that would save some program memory because right now, the program uses almost all the memory of Arduino. It's really difficult to add others code lines. The code has to be optimized if you want to add some new code lines ... To be able to use the screen, I had to update with the beta release 1.5.5 the arduino editor otherwise I couldn't use the screen ... You can get  the last release of the C code of this barograph on GitHub. In the program, I don't use a static array of pressure to save memory. When I read a new pressure, I append it in a file that contains the history of pressure. When I need to draw the history for the different time scale, I each time read the history file. Even to update the trend I read in this file. This file is physically in a sd card you have to insert on the back of the screen. I use for mine a 2Gbyte memory card. Take the cheapest one, it will be fine. Here are the first pictures I took this evening :

_DSC3229

_DSC3232

_DSC3233

Don't under estimate the difficulties to make a nice wood box for your barograph. It takes a lot of time and cautious ... Enjoy your DIY barograph ! And here is some pictures of other's realisations : IMG_1070 IMG_1072 IMG_20140609_161415 (1) IMG_20140609_161836 IMG_20140615_162254 IMG_20140615_162735 (2)Congrats at those who realized it !
Paul wrote about these same days, in French, from his side of the boat. Read his account →

Your messages

Original comments, kept as they were.

alain2014-01-27
tres tres bien une bonne démarche pour les petits marins que nous sommes mais commence procurer ce petit bijou merci de votre reponse
Anton2014-04-12
WOW! Mate you are really good programmer! I'm amazed by your skills! I have been looking for ages trying to find nice graphing code and this went over my expectations! Awesome work! I noticed that i get some weir readings on the top of the screen, they are "-31633Pa/h-31630Pa/". I think this is because of the code formatting on the web page, but I cannot pinpoint the problem. Do you have any idea what is wrong? Big thanks!
in reply to Anton
Paul2014-04-13
Yes, it looks like the code formatting of the web page doesn't work very well. I will email you the arduino sketch by email.
Eric Bergelin2014-05-05
Bonjour, J'ai bien réalisé le montage, après avoir contourné les embûches (librairie TFT, librairie 085/180), buzzer trop faible, ... Il fonctionne. Pourriez-vous publier la dernière version du code C , (celle proposée ne correspond pas aux HD d'écran avec la température). Je vous fournis des photos de l'instrument à bord dès que possible. Bravo et merci !
in reply to Eric Bergelin
Paul2014-05-05
Bonjour, Bravo pour la réalisation, je suis heureux de voir que ce barographe servira à d'autres navigateurs ! La dernière version du code ne contient pas l'affichage de la température car, les températures observées n'était pas vraiment très précise (supérieure à la réalité), et comme j'avais besoin de mémoire programme pour gérer l'appuie du bouton par interruption, j'ai supprimé cette partie du code. De ce fait, les captures d'écran publiées dans cette article ne correspondent plus à la dernière version du code.
daniel coppens2014-08-28
Bonjour, félicitations avec ce projet. J' ai décidé de construire votre barographe en remplacement de mon Bohlken Westerland défectueux. Pourriez-vous m'envoyer la denrnière version du code C par mail. Merci d'avance et encore bravo; Daniel
in reply to daniel coppens
Paul2014-08-29
Bonjour, la dernière version du code est telechargeable sur la page concernant le barographe. Je reste à votre disposition si vous avez des questions ou des remarques. Bonne réalisation, Paul
thierry M de Butry2014-11-19
Bonjour. Tout d'abord bravo pour cet article et ce montage qui correspond bien à mon besoin. Une peite question : Avec quelle version de l'IDE Arduino peut on compiler votre code ? ESt il facilement adaptable pour un acran TFT de 1/8" (je ne suis pas un super pro du codage...). Merci encore et je garde votre site dans mes favoris :-) Thierry
in reply to thierry M de Butry
Paul2014-11-19
Bonjour, Comme indiqué dans l'article, il faut utiliser la version 1.5.x beta car sinon il y a des problemes d'affichage. Pour adapter le code a un autre ecran, il faut modifier le code. Bien que cela ne soit pas compliqué, une simple modification peut impliquer des difficultés insoupconnées car ds ce programme pour arduino, on manque terriblement de memoire programme ... Bon courage, Paul
thierry M de Butry2014-11-20
Ooops !! En effet je suis passé un peu trop vite sur le texte de l'article ;-). Merci Paul pour la réponse rapide en tout cas. Je vais passer à la réalisation et ferais part du résultat ! Bonne journée, Thierry
Carlos2014-11-22
Thank you very much for sharing your great job. I'm trying to do the work becouse i find it very useful for my boat. I am now sailing in Argentina and here is hard to find hardware. I am trying to adapt the code to other periphericals. By now I arrived at the end of compilation without syntax errors but there are some "compilinng errors" it seems all about the SD card, any suggestions? In file included from C:\Users\Carlos\Documents\Arduino\libraries\SD/SD.h:20, from Arbutus.ino:4: C:\Users\Carlos\Documents\Arduino\libraries\SD/utility/SdFat.h:286: error: conflicting return type specified for 'virtual void SdFile::write(uint8_t)' C:\Program Files\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)' In file included from Arbutus.ino:4: C:\Users\Carlos\Documents\Arduino\libraries\SD/SD.h:28: error: conflicting return type specified for 'virtual void File::write(uint8_t)' C:\Program Files\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)' C:\Users\Carlos\Documents\Arduino\libraries\SD/SD.h:30: error: conflicting return type specified for 'virtual void File::write(const uint8_t*, size_t)' C:\Program Files\Arduino\hardware\arduino\cores\arduino/Print.h:53: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
in reply to Carlos
Paul2014-11-22
It looks like it's coming from the SD library ... Why is your SD Library located in your "Documents" ? Are you using a specific SD library ? Which SD card are you using ? I used the SD library provided by the IDE "C:\Program Files\Arduino\libraries\SD\src" ... Did you try to use your SD card alone ?
Carlos2014-11-22
The sd is placed on the screen shield, i had some troubles finding a good library for it is this one: http://www.elecfreaks.com/store/tft22sp-shield-p-687.html?zenid=e88dd20048d5ab497705faeb2242c506 and i'm trying to use the SD library that it comes with.
Paul2014-11-22
I used the sensor's library and it works well for me. I never used your screen but I advice you to use each components independantly before integrated all together ... Like that, you have a proof that the component and its library work well. This is what I have done when I realized this barograph at the beginning. I never used ucglib either, but as we run out of memory space in the arduino for this program, it would be wise to modify the library to save some memory space (remove all the font defined you don't need for example ...) Also, because your screen doesn't have the same resolution of the screen proposed in this article, think about modifying the code ... I had a look on the code, it shouldn't be complicated ...
Daniel2014-12-12
Bonjour Paul Fin août je vous ai annoncé que je voulais entamer le projet du barographe. Je me suis inspiré de votre projet que j' ai adapté un peu aux composants utilisés et simplifié car je n' ai pas d' échelle variable. J'ai bien progressé et les différents modules fonctionnent . Comme écran TFT j' ai utilisé le 2,2 de adafruit avec carte SD et j' utilise un pro mini arduino. À ce jour j' ai un problème que je ne parviens pas a résoudre. Je peux lire les données du capteur BMP180 et dans un autre sketch je peux écrire des données sur la carte SD. Si j' essaye dans le même sketch de lire des données du capteur et sauvegarder sur la carte SD cela ne fonctionne pas. Je ne parviens pas a comprendre pourquoi et ou est l' erreur. Si vous voulez jeter un coup d' œil sur ce probleme je peux vous envoyer le sketch par mail ainsi que une photo de l' état de l' écran en simulation. Merci d' avance Daniel
Eric2015-02-16
Bonjour, Voici un projet que je viens d'achever : un barographe et altimètre avec un écran tactile. Il est basé sur Arduino Uno et Gameduino 2. http://entropie.org/barographe.htm
Vincent2016-01-10
Bonjour, Est que votre arduino marche toujours? L'alimentez vous sur le 12V du bord? Il parait qu'il n'aime pas trop les surtensions. Merci
in reply to Vincent
Paul2016-01-11
Bonjour, Oui, le barographe fonctionne toujours et est redevenu utile depuis que nous avons quitté les tropiques. Je ne branche pas l'arduino directement sur le 12V du bord, j'utilise une régulateur de tension pour l'alimenter en 7V. Cordialement, Paul
jacques guinet2018-11-22
Bonjour Paul Je suis en train de fabriquer le barographe auquel je vais ajouter une alimentation de 9 v rechargée par capteur solaire. Je me suis inscris sur GitHub et je me suis inscris sur Arduino mais Je me heurte au problème du logiciel de code: j'ai bien recopié le GitHub mais comme j'ai un capteur BMP 180 au lieu du BMP 085 aprés vérification ,j'ai le message d'erreur : 'Adafruit_BMP085' does not name a type donc j'essaie de changer le nom en BMP180,puis je réessaie,mais le même message s'affiche.Cà vient de quoi? Je traduis peu têtre mal!
in reply to jacques guinet
Paul2019-02-22
Essayez de faire fonctionner votre capteur dans un programme minimaliste d'abord. Cela vous permet de verifier que la librairie de votre capteur est bien installee. Une fois que votre petit programme fonctionne avec le capteur, vous saurez comment modifier le code du barographe pour votre capteur. Bon courage!
Jean-Marie DUCOURTIEUX2019-07-12
Bonjour Paul, J'envisage de me lancer dans la réalisation du barographe mais comme j'ai une vue peu performante, je souhaiterais un écran plus grand de l'ordre de 5 à 8", que je puisse le voir d'assez loin même avec ou sans mes lunettes. Est-ce que l'arduino serait en mesure de le supporter et cela change-t-il beaucoup de chose dans le sketch, svp? Au plaisir de vous lire. Cordialement, Jean-Marie.
in reply to Jean-Marie DUCOURTIEUX
Paul2019-07-14
Bonjour, Une des difficultes sera de trouver l'ecran qui vous convient, de savoir le brancher sur l'Arduino, trouver le firmware qui va pouvoir controler ce nouvelle ecran et ensuite, en fonction de la resolution de votre ecran, il faudra modifier le sketch. Bon courage, Paul
Phil1712020-02-16
Bonjour Paulo, Comme Jean-Marie DUCOURTIEUX, j'aimerais utiliser un écran plus grand, voire utiliser un eInk ou écran ePaper, mais si vous dites qu'il va falloir trouver le firmware et modifier le sketch, je sens que ça va partir en live ! Auriez-vous quelques indications ou liens utiles à ce sujet? Merci d'avance, Philippe. P.S: On vous regrette sur Hisse et Oh !
in reply to Phil171
Paul2020-02-21
Bonjour, Je suis actuellement sur d'autres projets qui me prennent beaucoup de temps et je n'ai pas prevu de travailler sur une mise a jour du barographe pour 2020. Certainement 2021, mais ce sera une version plus pro : -avec un ecran plus grand, -de la sram au lieu d'ecrire sur un sd card, -une sortie nmea isolee, -un panneau de config pour choisir les unites et desactive/configurer l'alarme -une entree nmea gps isolee pour pouvoir appliquer la correction de la maree barometrique -Et surtout, le plus important est de gerer le code dans git avec versioning et ecrire un ensemble tres complet de tests unitaire !
PatD302020-08-01
Bonjour Paul, Un grand bravo pour ce projet. Très intéressé par votre montage, je me suis donc procuré le matériel nécessaire à sa réalisation soit: Arduino Uno BMP180 (idem 085) Pour l'écran, impossible de trouver le même que celui utilisé. je me suis donc tourné vers un autre (2.2 inch ILI9225 SPI TFT LCD 220x178) pensant pouvoir utilisé la même librarie (TFT.h). Et bien non !!! il faut utilisé Câblage de l'écran sur le Uno effectué. test (Basic_Demo) Ok Passons à la modification de votre sketch. #include "TFT_22_ILI9225.h" define TFT_RST 8 #define TFT_RS 9 #define TFT_CS 10 #define TFT_SDI 11 #define TFT_CLK 13 #define TFT_LED 3 #define W_SCR 220 #define H_SCR 176 TFT_22_ILI9225 TFTscreen = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_LED); Je pensais (bêtement) que ces simples modifications suffiraient. Et bien que nenni ! ! ! ;o) Vérifier/Compiler => 'class TFT_22_ILI9225' has no member named 'stroke' Je ne suis assez féru en soft pour aller plus loin ...:o( D'où ma question: Auriez vous déjà effectué ce type de modification sur votre sketch (avec ce type d'écran)? Dans la négative, pouvez vous me dire quel écran pourrait venir en remplacement? Amicalement Patrick
PatD302020-08-02
Bonjour Paul, En regardant dans TFT.h, j'ai trouvé réponse à mon interrogation: The Arduino LCD is a ST7735-based device Reste plus qu'a commander . Amicalement Patrick..
Jean-Louis Porot2021-03-09
Bonjour Paulo, je rêvais d'un barographe enregistreur, mais les prix rendaient les "réveils" un peu durs. Et puis je tombe sur votre contribution sur github, qui me permet d'admirer Arbutus et votre périple, je vous félicite humblement. Je voulais surtout vous remercier pour le partage de votre barographe, il m'a mis le pied à l'étrier (ou les mains au clavier). Après deux moocs sur le langage C et un student kit d'Arduino, j'ai commandé un Uno, un capteur hp206c et un écran epd 400*300. Le confinement aidant, j'y suis arrivé, du moins je suis arrivé à me faire plaisir, et ça marche! Oui..., je sais... je n'ai pas encore la boite, et ce sera long aussi, mais je carène la semaine prochaine, alors ça attendra, comme le fer à souder, mais ça viendra, j'espère. Merci encore d'avoir raccourci mon confinement et bonne route.