A barograph for Arbutus
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 :
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.
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 :
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 :
tres tres bien
une bonne démarche pour les petits marins que nous sommes
mais commence procurer ce petit bijou
merci de votre reponse
Il faut le construire soi-même. Vous ne pouvez pas vous le procurer tout fait …
Pour le construire, vous devez-vous procurer au moins les principaux composants qui sont le capteur de pression, la carte Arduino Uno et l’écran. Je vous conseille aussi de prendre la plaque de prototypage afin d’y souder l’écran et le capteur dessus.
Jetez un coup d’oeil dans les liens suivants et en cherchant un peu, vous trouverez les revendeurs :
http://arduino.cc/en/Main/ArduinoBoardUno
http://arduino.cc/en/Main/GTFT
https://www.adafruit.com/products/391
http://arduino.cc/en/Main/ArduinoProtoShield
Il vous faudra trouver un bouton poussoir, un buzzer et 2 résistances …
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!
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.
Bonjour,
Excellent article!…j’aime beaucoup l’introduction qui explique l’usage du BMP et barographe….je ne fais pas de navigation… donc cela ne coule pas de source pour moi ;- ).
Je fais suivre l’info sur Arduino Notepad ( blog.mchobby.be ).
Dominique
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 !
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.
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
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
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
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
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
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)’
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 ?
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.
Those are the drivers i’m using:
sensor: https://github.com/adafruit/Adafruit_BMP085_Unified
LCD: https://code.google.com/p/ucglib/
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 …
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
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
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
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
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!
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!
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.
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
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 !
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 !