Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano Controlled Rocket Thruster with Load Cell Feedback and SD Data Logging

View and Edit Project In Cirkit DesignerImage of Arduino Nano Controlled Rocket Thruster with Load Cell Feedback and SD Data Logging

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a rocket thruster using an Arduino Nano microcontroller. The circuit includes a solenoid for controlling the thruster, a load cell with an HX711 amplifier for measuring force, an SD module for data logging, and a power supply. The Arduino Nano is programmed to activate the solenoid, read the load cell data, and log this data to an SD card.

Component List

Solenoid

12v Power Supply

Arduino Nano

SD Module

SparkFun Load Cell Amplifier - HX711

Load Cell - Red/white/black/green

Mosfet

Diode

Resistor

Pushbutton

Wiring Details

Solenoid

12v Power Supply

Arduino Nano

SD Module

SparkFun Load Cell Amplifier - HX711

Load Cell

Mosfet

Diode

Resistor

Pushbutton

Documented Code

/*
 * This Arduino Nano controls a rocket thruster. 
 */

#include <SD.h>
#include <SPI.h>
#include "HX711.h"

// Pin definitions
const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;
const int SD_CS_PIN = 10;
const int SOLENOID_PIN = 6;
const int EMATCH_PIN = 7;

// HX711 Load Cell Amplifier
HX711 scale;

// SD card file
File dataFile;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);

  // Initialize the load cell
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);

  // Initialize the SD card
  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("SD card initialization failed!");
    return;
  }
  Serial.println("SD card initialized.");

  // Open the file for writing
  dataFile = SD.open("datalog.txt", FILE_WRITE);
  if (!dataFile) {
    Serial.println("Error opening datalog.txt");
    return;
  }

  // Initialize pins
  pinMode(SOLENOID_PIN, OUTPUT);
  pinMode(EMATCH_PIN, OUTPUT);

  // Start 
  digitalWrite(EMATCH_PIN, HIGH);
  delay(100); // delay some arbitrary amount to let the ematch start
  digitalWrite(SOLENOID_PIN, HIGH);

}

void loop() {
  // Read the load cell data
  if (scale.is_ready()) {
    long reading = scale.read();
    Serial.println(reading);

    // Log the data to the SD card
    dataFile.println(reading);
    dataFile.flush();
  } else {
    Serial.println("HX711 not found.");
  }

  delay(100); // Delay for 100ms
}

This code is responsible for initializing the Arduino Nano's peripherals, including the load cell amplifier and the SD card module. It also controls the solenoid and ematch for the rocket thruster. The main loop reads data from the load cell and logs it to the SD card.