Sunday, September 6, 2020

Ballistics Calculators

I've been working on a system to take with me shooting. It's essentially an external ballistics application for my Android phone that gives me bullet path calculations. It's not meant to be a whiz bang super ballistics calculator that will tell you everything for every bullet and condition. It's set up to calculate the functions I want for a limited number of cartridges, loading conditions and projectiles.

The first thing I did was develop the means to make any corrections needed for the flight path due to temperature, humidity or altitude. These can be all lumped together by calculating the air density. This is the circuit for the Assistant set-up. It's a little module (Bosch BME280) that reads temperature, atmospheric pressure, and relative humidity. I use those inputs to calculate the air density. It also accounts for any altitude corrections that might need to have been made through the direct reading of the atmospheric pressure. In fact the manufacturer likes to claim you can get an altitude within a meter or so from it. The values are read in and sent via Bluetooth to my Android app.


Assistant Circuit


This is the code for the Arduino Nano board that I use to control the communications and get the data from the BME280 module. A schematic (atm-assistant.png) and the Arduino file (picker.ino) for the Nano board are as usual in the downloads area. The code is below.

#include <SoftwareSerial.h>

SoftwareSerial Bluetooth(3, 2); // RX, TX

#include <Adafruit_BME280.h>

Adafruit_BME280 bme;

int dataToFetch; // the case number

double floatValue, btValue;

int temperature; float pressure; int humidity;

void setup() {

Bluetooth.begin(9600);

Serial.begin(9600);

Serial.println("It's me");

if (!bme.begin(0x76))

{

Serial.println("Could not find a valid BME280 sensor, check wiring!");

while (1);

}

}

void loop() {

//responds to the app and sends the data

if (Bluetooth.available()) { //wait for data received

dataToFetch = Bluetooth.read();

switch (dataToFetch) {

case 1:

Serial.print("Temperature=");

Serial.println(bme.readTemperature());

Bluetooth.print(bme.readTemperature());

break;

case 2:

pressure = bme.readPressure() / 5;

Serial.print("Pressure = hPA/5");

Serial.println(pressure);

Bluetooth.print(pressure);

break;

case 3:

Serial.print("Humidity=");

Serial.println(bme.readHumidity());

Bluetooth.print(bme.readHumidity());

break;

default:

Serial.println("Something's wrong");

break;

}

}

}


Also, the App Inventor file can be found here, and I've also compiled it into an .apk file. To check for the appropriate sensors you might already have on your phone you can download the Sensor Check Application

No comments:

Post a Comment