Alternative to Joly logic and Estes altimeters for less than 10 euros

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
btw, I was working through this, and looking at initial altitude which was saying I was at 8000'... er, no, I'm at 787'. Looking through the code and the BME280, etc, etc. I switch the unit from BME280::presUnit_Pa tp BME280::presUnit_hPa which now at least I'm seeing a pressure return that relates closer to the reference pressure, and isn't like 1000 off.
My initial altitude is now 157.83 meters, which still isn't quite correct, but at least its more in the ballpark.
 
btw, I was working through this, and looking at initial altitude which was saying I was at 8000'... er, no, I'm at 787'. Looking through the code and the BME280, etc, etc. I switch the unit from BME280::presUnit_Pa tp BME280::presUnit_hPa which now at least I'm seeing a pressure return that relates closer to the reference pressure, and isn't like 1000 off.
My initial altitude is now 157.83 meters, which still isn't quite correct, but at least its more in the ballpark.
https://forum.arduino.cc/t/bme280-pressure-and-altitude/1199314/4

// Calculates the altitude (in meters) from the specified atmospheric
// pressure (in hPa), and sea-level pressure (in hPa).
altitude = 44330.0 * (1.0 - pow(pressure / slpressure, 0.1903));
 
I do not take into account where I live to measure the altitude. I took the default from the library. However I read the altitude , average it and consider that it is the ground altitude so subtract it on all other altitude measurements
 
I do not take into account where I live to measure the altitude. I took the default from the library. However I read the altitude , average it and consider that it is the ground altitude so subtract it on all other altitude measurements
Cool..

Definitely been interesting. Had to brush off the old c/cpp knowledge.

I'll publish my version one a branch on my fork at some point.
 
I ordered two and they came in today. Real nice devices. Should be interesting converting my ALTDuino code on to them.
 
I ordered two and they came in today. Real nice devices. Should be interesting converting my ALTDuino code on to them.
yes good idea. Do you still flight your AltDuino? If you remember well when I saw it this is what inspired me to do Arduino based altimeters. However if you want to start using the graphics you will need the modified TFT library available on my github
 
yes good idea. Do you still flight your AltDuino? If you remember well when I saw it this is what inspired me to do Arduino based altimeters. However if you want to start using the graphics you will need the modified TFT library available on my github
Oh yes. I am still using my ALTDuino hard-/software.
You are doing an excellent job on your projects!
 
Don't forget to hold your TFT backlight and I2C power pins low during deep sleep with this board. I noticed a small glow from the back light after sleep it turns out the pins float and leak some power if you don't tell them to be held low during sleep.

I fixed it with this.
 

Attachments

  • Untitled-3.jpg
    Untitled-3.jpg
    54.1 KB
Don't forget to hold your TFT backlight and I2C power pins low during deep sleep with this board. I noticed a small glow from the back light after sleep it turns out the pins float and leak some power if you don't tell them to be held low during sleep.

I fixed it with this.
currently playing with it because I noticed that the battery was flat very quick
so far I have done that
tft.drawString("turning off...", 6, 185);
digitalWrite(45, LOW);
digitalWrite(21, LOW);
//digitalWrite(7, LOW);
but it is still glowing a bit
 
currently playing with it because I noticed that the battery was flat very quick
so far I have done that
tft.drawString("turning off...", 6, 185);
digitalWrite(45, LOW);
digitalWrite(21, LOW);
//digitalWrite(7, LOW);
but it is still glowing a bit
Mines still not glowing using the code in my post. Copy pasted here as was a image before.


Code:
#include <esp_sleep.h>

    digitalWrite(TFT_BACKLITE, LOW);
    digitalWrite(TFT_I2C_POWER, LOW);
    delay(100);
    gpio_deep_sleep_hold_en();
    gpio_hold_en((gpio_num_t) TFT_BACKLITE);
    gpio_hold_en((gpio_num_t) TFT_I2C_POWER);
 
digitalWrite(TFT_BACKLITE, LOW); digitalWrite(TFT_I2C_POWER, LOW); delay(100); gpio_deep_sleep_hold_en(); gpio_hold_en((gpio_num_t) TFT_BACKLITE); gpio_hold_en((gpio_num_t) TFT_I2C_POWER);
it does seem to completly turn off the screen however the only way I can tun it back on is by pressing the reset button... so still something not right
 
it does seem to completly turn off the screen however the only way I can tun it back on is by pressing the reset button... so still something not right
I've not had that issue as I'm using the reset button to turn the device on and off. I am recording a toggle integer of 0 or 1 in the flash so every time the board resets it will either enter deep sleep as off, or run as normal as on. That leaves the boot button free to not be a power button.
I suspect you'd have to disable the gpio hold to re-enable the backlight.
Code:
gpio_hold_dis((gpio_num_t) TFT_BACKLITE);
digitalWrite(TFT_BACKLITE, HIGH);
I've not tested the above but I suspect it might be what you need.
 
Your solution is quite interesting
Would you mind providing a full example?
 
Sure.

These are the code snippets that are relevant, although this isn't a clean finished thing more of a messing around situation at the minute!

I'm using Preferences to save variables to the flash using the id "alti".
For first run it will send a 0 default if the record doesn't exist, and 0 = on, 1 = off.


Python:
#include <Preferences.h>
#include <esp_sleep.h>

int onoroff = 2;

void setup(void){
    // turn on backlite
  pinMode(TFT_BACKLITE, OUTPUT);
  digitalWrite(TFT_BACKLITE, HIGH);

  // turn on the TFT / I2C power supply
  pinMode(TFT_I2C_POWER, OUTPUT);
  digitalWrite(TFT_I2C_POWER, HIGH);
  delay(10);

  // initialize TFT
  // Your code

Preferences preferences;
  preferences.begin("alti", false);
  onoroff = preferences.getUInt("onoroff", 0);
  if(onoroff == 0){
    // system should turn on, but save onoroff = 1
    // Take no action
    preferences.putUInt("onoroff", 1);
    preferences.end();
  }
  else{
    // system should go to deep sleep, but save onoroff = 0
    // Turn off all power options and enter deep sleep forever.
    preferences.putUInt("onoroff", 0);
    preferences.end();
    pinMode(TFT_BACKLITE, OUTPUT);
    pinMode(TFT_I2C_POWER, OUTPUT);
    pinMode(4, OUTPUT);
    digitalWrite(TFT_BACKLITE, LOW);
    digitalWrite(TFT_I2C_POWER, LOW);
    digitalWrite(4, LOW);
    delay(100);
    gpio_deep_sleep_hold_en();
    gpio_hold_en((gpio_num_t) TFT_BACKLITE);
    gpio_hold_en((gpio_num_t) TFT_I2C_POWER);
    delay(2000);
    esp_deep_sleep_start();
  }


}
 
Thanks I will study it and try it out.
Unfortunately unlike the TTGO board I could not use any sensor to measure the battery level. The original Adafruit board is supposed to have a LC709203 or MAX17048 sensor to measure the battery level but after running an I2C scan I could not find any on that board
 
Thanks I will study it and try it out.
Unfortunately unlike the TTGO board I could not use any sensor to measure the battery level. The original Adafruit board is supposed to have a LC709203 or MAX17048 sensor to measure the battery level but after running an I2C scan I could not find any on that board
I noticed it didn't seem to have a battery sensor also. It's a shame as I don't want to have to solder anything on so will probably make do without. I'd imagine you could divide the bat voltage pin in half with a couple of resistors into one of the ADC inputs if you still want to read the battery state.
 
I noticed it didn't seem to have a battery sensor also. It's a shame as I don't want to have to solder anything on so will probably make do without. I'd imagine you could divide the bat voltage pin in half with a couple of resistors into one of the ADC inputs if you still want to read the battery state.
I do that on my other altimeters but for this one I want no additionnal components are required so that people can just pick up the board from Aliexpress and use it as it is. Maybe whoever did the clone did that. I will check to see if I can find any schematic. Alternatively I can just scan all ADC pins
 
Sure.

These are the code snippets that are relevant, although this isn't a clean finished thing more of a messing around situation at the minute!

I'm using Preferences to save variables to the flash using the id "alti".
For first run it will send a 0 default if the record doesn't exist, and 0 = on, 1 = off.


Python:
#include <Preferences.h>
#include <esp_sleep.h>

int onoroff = 2;

void setup(void){
    // turn on backlite
  pinMode(TFT_BACKLITE, OUTPUT);
  digitalWrite(TFT_BACKLITE, HIGH);

  // turn on the TFT / I2C power supply
  pinMode(TFT_I2C_POWER, OUTPUT);
  digitalWrite(TFT_I2C_POWER, HIGH);
  delay(10);

  // initialize TFT
  // Your code

Preferences preferences;
  preferences.begin("alti", false);
  onoroff = preferences.getUInt("onoroff", 0);
  if(onoroff == 0){
    // system should turn on, but save onoroff = 1
    // Take no action
    preferences.putUInt("onoroff", 1);
    preferences.end();
  }
  else{
    // system should go to deep sleep, but save onoroff = 0
    // Turn off all power options and enter deep sleep forever.
    preferences.putUInt("onoroff", 0);
    preferences.end();
    pinMode(TFT_BACKLITE, OUTPUT);
    pinMode(TFT_I2C_POWER, OUTPUT);
    pinMode(4, OUTPUT);
    digitalWrite(TFT_BACKLITE, LOW);
    digitalWrite(TFT_I2C_POWER, LOW);
    digitalWrite(4, LOW);
    delay(100);
    gpio_deep_sleep_hold_en();
    gpio_hold_en((gpio_num_t) TFT_BACKLITE);
    gpio_hold_en((gpio_num_t) TFT_I2C_POWER);
    delay(2000);
    esp_deep_sleep_start();
  }


}
I have tried your code. This is a very smart way to do it and it works really well.
I like the idea of freeing up the only button that I can use
Thanks for that I will include it in my code. You will have to send me your details so that I can credit you in the code
 
I think that those sensors are rated for 9 ro 10km.
Note sure how accurate they are above that limit
Did you also looked at the data with your phone?
Glad to see that people are playing with those amazing boards
 
Just tried out the phone interface. Works great! Later today I'll do a test with this board and some other altimeters together in the vacuum chamber and see what happens.
Ken
 
Info, just in case someone else is struggling.

I received my two boards a couple of days ago. Today I was struggling a bit to get the pressure sensor to work as I was using the library for a BME 280 sensor as described in the first post of this thread "However it has a BME 280 sensor as well as a QMI8658 sensor."
Well, it turns out my modules came with an BMP 280 sensor (which is also described as such in the listing).
 
Last edited:
Info, just in case someone else is struggling.

I received my two boards a couple of days ago. Today I was struggling a bit to get the pressure sensor to work as I was using the library for a BME 280 sensor as described in the first post of this thread "However it has a BME 280 sensor as well as a QMI8658 sensor."
Well, it turns out my modules came with an BMP 280 module (which is also described as such in the listing).
That is interesting. This means that the boards are not all the same. I will reorder some to see if I get those as well. I will have to do some sensor detection for my firmware to work
Did you get the board from the link that I provided?
 
Yes, I used the link in your first post, and it actually states: "TS-ESP32-S3 Development Board With 1.14 Inch TFT Display With BMP280 and QMI8658C Sensor Learn to Program ESP32 S3 For Arduino"
It really doesn't matter because humidity is not needed for our usage.
 
Yes, I used the link in your first post, and it actually states: "TS-ESP32-S3 Development Board With 1.14 Inch TFT Display With BMP280 and QMI8658C Sensor Learn to Program ESP32 S3 For Arduino"
It really doesn't matter because humidity is not needed for our usage.
of course humidity is not however the I2C address will be different for the BMP280 and you need to use a different library. So I need to get more boards, I will contact the supplier to make sure that I get the same as your so that I can code a firmware that works for both board.
Did you run an i2C scan on the board?
 
True, I had not thought of that, probably because I'm using my own code.

Scanning...
I2C device found at address 0x6B !
I2C device found at address 0x77 !
I2C device found at address 0x7E !
done
 
Last edited:
Back
Top