mercredi 29 novembre 2017

Oled display and Arduinos

This article is to highlight a few points for anyone wanting to use an Oled display with Arduinos.
I had a few trouble with them, therefore it is also a reminder for me.
These are the cheap Oled displays (0.96 In  or 1.5 In, 128x64  ) connected via I2C, found everywhere on the net.
Power supply ; 3.3 V  or 5V, any voltage is Ok, no difference in brightness.
SCL connected to pin A5
SDA connected to pin A4

Arduino uno and Oled display;

For some unknown reason, the Arduino UNO could not raise correct signals. The thing worked when the two signals SCL and SDA were connected through 10K resistors to Gnd.

The U8Glib library worked fine. I have used as header :

#include "U8glib.h"
#include <Wire.h>
and as descriptor
U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_FAST); 

Arduino 101 and Oled display;

Although the 101 could seem compatible to the UNO, it is not exactly.
Differences are
-the core is a 32 bits core
- voltage is 3.3 V
Because of that, the U8g2lib will not work.

Why using the 101 ? Because it has accelerometers, gyros, more memory and will use a real time operating system (multitasking)

In that case, Oled displays do not need any resistor.
Supply is 3.3V, of course.

As a header I have used succesfully
#include <U8g2lib.h>
#include <Wire.h>
descriptor :
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0,SCL,SDA,U8X8_PIN_NONE);

and some links :
https://create.arduino.cc/projecthub/alexis-santiago-allende/oled-display-with-arduino-101-a96935
https://github.com/olikraus/u8g2/wiki/





mardi 6 juin 2017

Jauge simple processing



Bonjour
Aujourd’hui ça chauffe !


Affichage d une jauge simple avec processing.

Un petit programme avec processing, tout simple, qui permet d afficher une valeur sur un écran.
J ai eu des contacts de personnes intéressées pour afficher ainsi des jauges sur un écran. L idée est de faire un morceau de code en processing, qui affiche une variable, et surtout qui est facile a adapter pour tout ce que l'on voudra. On pense a des paramètres moteurs (ULM) , mais ça peut servir a bien d'autres choses.

Ce qu il faut :
- Une valeur a afficher. En général, elle va provenir d'un capteur; une carte Arduino fera l affaire, ou un contrôleur de moteur, ou tout autre chose. En principe cela arrive par le port série, mais on peut penser a la modifier d une autre façon, capteur directement sur la carte, potard, bouton, etc... Mais ici, je ne décris pas cette partie la, j'aurai un autre sujet la dessus prochainement. Dans ce morceau de code, la valeur se pilote en montant et descendant la souris. Bref, elle est déjà la.

- Un afficheur : La aussi, débrouillez vous, il y a des solutions. Utiliser une carte Raspeberry Pi, ou un PC, ou tout ce qui peut faire tourner processing.

- Le code, entre les deux.

Tel quel, ce code affiche une valeur sur une zone de 200x200 pixels. Mais évidemment on peut penser a mettre plusieurs jauges cote a cote, changer les tailles des affichages, les couleurs, etc..
J ai bien documente le code, en principe tout est dedans pour l adapter.
Pour changer la taille de 200x200,  a autre chose, revoir quelques valeurs.
Les couleurs de fond et des zones sont également faciles a trouver et modifier.
L aiguille, soit une simple barre, soit un symbole plus evolue.
Dans cet exemple, c est une température qui va jusqu a 150 degrés sur 3/4 de tours. Bien évidemment, on peut changer tout cela a son gout.

En tout cas, c'est une bonne introduction a processing. Si vous ne connaissez pas, il y a d'excellents tutos en ligne et des exemples a foison. C est le moment.
Si vous venez du monde Arduino, tentez le coup! Installez la derniere version de processing.
Passez quelques dizaines de minutes sur les tuto. (Oui, c est de l anglais, bon, mais vous etes modernes...) C est de l open source, bien sur.
Ce n est pas si difficile que ca a maitriser. Les references et les exemples sont la pour vous aider.

La référence des affichages est a l origine en haut a gauche. Le truc est qu on modifie les origines de l affichage par des matrices (pushMatrix ..... code.....popMatrix) et tout ce qui est au milieu se trouve déplacé ou pivoté.

https://github.com/francfly12/Processing-jauge-en-francais

jeudi 13 avril 2017

EFIS for ultralight

Bonjour !

Today, I will turn to english, as a different audience can be interested. I am actually in the process of designing an EFIS display for Ultra light Aircrafts. I see many of those little planes with all kind of instruments and I think it is time to try to put in them some pieces of new tech.
As pictures are worth a thousand words, it looks as something like this:




This is a light version of an Electric Flight Instrument System (EFIS)
Purpose : Display aircraft flight parameters on a single Display.
The project is actually partially finished, as it still needs to get working sensors to feed the display part.
The actual program is developped using processing https://processing.org/
It is intended to be run on a raspberry Pi. The display will be a 7" Lcd display, as bright as possible.
The program is designed around an 800x480 pixels resolution which is the one of the official raspberry display.
The symbology is taken from the one used by a famous aircraft manufacturer, but adapted for the limits and parameters used on a light Airplane. (called ULM, down here)
All symbols are fully functional. Parameters are input to the program using the mouse for testing, but it will use a serial bus transmission in real life.

It is divided in 6 sections

Attitude display: provides pitch and roll attitude sphere. The roll index also provides sideslip indication. There are white indexes and green limits on the roll sphere.
The pitch part also provides limitations and red V bars.

 

Speed scale is here in kilometers per hour, but could easily be adapted to knots. It also shows speed trend (10 seconds target) and speed limits, stall speed, flap speeds, VMO, etc...
(Dont worry about actual values, these are just simulated data.)

Heading scale

Altitude , with a rolling drum on the center.
(By the way, I still forgot QNH!)


Vertical Speed, using a bar and analog values above 200 ft/min.

A Data section, could be used for any information like Flaps position, Engine parameters, text or config warnings. It is actually displaying some data for debugging.

Is it Smooth ? Well, it's running pretty good, I am quite happy with the quality. It flickers just a little bit in some conditions. It could also be significantly improved, this is something I can do someday. And I am just a hobbyst.

 

It is developped with processing which is an open source software.

Important notice; Take your responsibility. I warn anyone who would like to use it about the fact that this is nothing like a real aeronautic software. We are here in"bricolage" section, it's more for the fun, even if I think to use it someday. Could be use in a home simulator as well. Nothing to do with a real software, because it is not really built, debugged, and tested as it could be. It lacks ruggedness.
Also the hardware is totally different from a real aircraft. A raspeberry Pi runs on an operating system which is not the way an aircraft computer works. But, well, here, I need the Pi, There is no Arduino solution yet for such a display. No watchdog either, no monitoring.  No redundancy...

But It Works

Anyone interested by this, please leave a message and I would be happy to share.

To do list: 
- Now build the equivalent of the ADIRU for a light airplane. An acquisition/computation card. Use Arduino 101 as a base because it has internal sensors. 
- connect to pressure sensors for speed/altitude.
- Make a second set of input circuits for redundacy.
- Connect a GPS; Use it for time / terrain height.
  
But this would not replace a second display. I would still use an Ipad, or the like, for navigation.