Hello!
I was wondering what was is the best way to test for voltage going through my circuit, my circuit has a little display screen and I was hoping that if I was able to turn it on that it would mean there is constant electricity. I have tried using a multi meter but I have been getting inconsistent readings. I am using an Arduino nano, Va and Vb have 24 V, Vc and ground have 12 V. The bunched up wire at the top go to a sensors and an ignition system, The display screen should say the word ARMED. One suggestion I was told was to put LED lights through the circuit but I have no idea where I put them or what the right place is to put them to test for power through the circuit.
Here is the code for the ignition, When I just run the Arduino by itself connected to the computer I an output that says:
Sketch uses 16267 bytes (33%) of program storage space. Maximum is 49152 bytes.
Global variables use 417 bytes (6%) of dynamic memory, leaving 5727 bytes for local variables. Maximum is 6144 bytes.
// Arduino Nano control system for Detonation-Based Combustion testing.
// The Arduino system will wait for a button input. When the button is pressed, the air knife is
// activated. After a delay, the valves are opened. After a delay for the powder to be released,
// the valves are closed, the air knife is turned off, and there is a spark for the explosion.
// The system will then not respond to inputs until it is reset. Press the white button on the
// Arduino Nano labeled "RST" to reset the program.
// Set Board Manager to = Arduino Nano Every
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);
int spark = 4; // 24V Trigger for combustion spark
int air_knife = 5; // 24V Air knife to break up powder(THIS NEEDS TO BE RENAMED)
int bGate = 7; // used to be 6 12V Pneumatic cylinder to control blast gate valve
//int gate = 7; // 12V Pneumatic cylinder to control valve that controls gate
int powder = 8; // 12V Pneumatic cylinder to control valve tht pushes out powder
int button = 9; // Button to start control process
int camera_trigger = 10; // 5.5V Pin to trigger the camera - needs low to high to trigger
int TMX_trigger = 11; //5V Signal to 3.3V input to trigger TMX - needs high to low to trigger
void setup() {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64)
pinMode(powder, OUTPUT);
// pinMode(gate, OUTPUT); (PINS NEED TO BE RENAMED)
pinMode(air_knife, OUTPUT);
pinMode(spark, OUTPUT);
pinMode(camera_trigger, OUTPUT);
pinMode(button, INPUT_PULLUP);
pinMode(bGate, OUTPUT);
pinMode(TMX_trigger, OUTPUT);
}
void loop() {
// SEE HELP MANUAL FOR POWDER TIMINGS
// edit the following timing based on powder size and amount:
int air_knife_delay = 600; // Delay between starting air knife and opening valves, 1 seconds, turns on air knife for this amount of time?
// no edit:
int open_gate_delay = 1000; // Does not seem to be used... Delay between opening the gate and closing, this is the powder dispersion time
int sparktime = 100; // Delay between starting and stopping spark,
int spark_delay = 200; // Delay between starting and stopping spark, half a second--CJ:What?
drawScreen(0, air_knife_delay, open_gate_delay, sparktime, spark_delay);
while (digitalRead(button) == HIGH) {} // Wait for button press
drawScreen(1, air_knife_delay, open_gate_delay, spark, spark_delay);
digitalWrite(bGate, HIGH); // Open blast gate first
// Note that as soon as the air knife turns on the powder will be ejected
digitalWrite(air_knife, HIGH); // Turn on air knife
digitalWrite(TMX_trigger, LOW); // Start TMX High signal
delay(air_knife_delay); // Wait after turning on air knife, turns on air knife?
digitalWrite(air_knife, LOW); // Turn off air knife
digitalWrite(bGate, LOW); // Close blast gate
delay(sparktime); // Delay Spark
digitalWrite(spark, HIGH); // Trigger spark
digitalWrite(camera_trigger, HIGH); // Trigger the camera - low to high
digitalWrite(TMX_trigger, HIGH); // Trigger TMX Capture
delay(spark_delay); // Leave spark on briefly to ensure that the signal is delivered
digitalWrite(spark, LOW); // Turn off spark
digitalWrite(camera_trigger, LOW); // Turn off camera trigger
digitalWrite(TMX_trigger, LOW); // Turn off TMX trigger
while (1) { drawScreen(2, air_knife_delay, open_gate_delay, sparktime, spark_delay); } // Stop
}
void drawScreen(int status, int air_knife_delay, int open_gate_delay, int sparktime, int spark_delay)
{
// Clear the buffer.
display.clearDisplay();
display.setCursor(0, 0);
display.setTextColor(WHITE, BLACK);
display.setTextSize(2);
// Program status
switch (status) {
case 0:
display.write("Armed");
break;
case 1:
display.write("Triggered");
break;
case 2:
display.write("Safe");
break;
}
//
// // Air Knife Status
// display.setTextColor(WHITE, BLACK);
// display.setTextSize(1);
// //drawPercentbar( 0, 0, 50, 10,p1);
// display.setCursor(0, 25);
// display.print("OX:");
//
// display.setCursor(27, 25);
// if (air_knife_timer == 0) {
// display.print("-.-");
// } else if (air_knife_timer > air_knife_delay) {
// display.print(air_knife_delay / 1000, 1);
// }
// else {
// display.print(air_knife_timer / 1000, 1);
// }
// display.print(" / ");
// display.print(air_knife_delay / 1000, 1);
// display.print(" s.");
//
// display.setCursor(108, 25);
// if (air_knife_ON == true) {
// display.print("ON\n");
// }
// else {
// display.print("OFF");
// }
//
//
// // Aluminum Dispersion Status
// display.setTextColor(WHITE, BLACK);
// display.setTextSize(1);
// //drawPercentbar( 0, 0, 50, 10,p1);
// display.setCursor(0, 40);
// display.print("AL:");
//
// display.setCursor(27, 40);
// if (open_valve_timer == 0) {
// display.print("-.-");
// } else if (open_valve_timer >= open_valve_delay) {
// display.print(open_valve_delay / 1000, 2);
// }
// else {
// display.print(open_valve_timer / 1000, 2);
// }
// display.print(" / ");
// display.print(open_valve_delay / 1000, 2);
// display.print(" s.");
//
// display.setCursor(108, 40);
// if (open_valve_ON == true) {
// display.print("ON\n");
// }
// else {
// display.print("OFF");
// }
//
//
// // Detonator Status
// display.setTextColor(WHITE, BLACK);
// display.setTextSize(1);
// //drawPercentbar( 0, 0, 50, 10,p1);
// display.setCursor(0, 55);
// display.print("DT:");
//
// display.setCursor(27, 55);
// if (spark_timer == 0) {
// display.print("-.-");
// } else if (spark_timer >= spark_delay) {
// display.print(spark_delay / 1000, 1);
// }
// else {
// display.print(spark_timer / 1000, 1);
// }
// display.print(" / ");
// display.print(spark_delay / 1000, 1);
// display.print(" s.");
//
// display.setCursor(108, 55);
// if (spark_ON == true) {
// display.print("ON\n");
// }
// else {
// display.print("OFF");
// }
// drawPercentbar( 0, 40, 100, 15, p3, 0, 0);
display.display();
}
Any feedback is greatly appreciated