What's new
Van's Air Force

Don't miss anything! Register now for full access to the definitive RV support community.

DIY Smart Smoke

Av8rRob

Well Known Member
Hey guys, I thought I would share my latest project in case anyone wants to make their smoke systems bit more functional as I did. I was inspired by Mike Bullock's design for his RV-7 smoke system so I went about making this simple system with the plan of having it utilize a microswitch on my stick and provide audio feedback into my headset (having a led light is also easy to add too). This project will set you back about $70.

It starts with a basic microprocessor called an Adrino Uno ($23) . This little bad boy is the brains of the operation. To load the program that I wrote with huge help from fellow RV'er Ernie Brock you connect it to your computer via usb cable. The Arduino program is free to download and the code is attached below. Because the wire attach points are very tiny and not aviation robust I attached a Screw Terminal Block ($21)
to the top of the Arduino. Now you can attach wires with descent security.
Then you need a 10 amp Relay ($6) that this can control to power the smoke motor. You will also need to power the Arduino which runs off 5v. You can power it 3 ways, via USB, via 5v input on the screw terminals but I chose to use its built in 9v adapter (has its own voltage regulator/ reducer) but now you need to drop your 12v power to 9v so I bought one of these bad boys ($10).

Now once the program is loaded you attach the Arduino/screw block with some standoffs to a piece of aluminum with your relay and voltage converter next to it. I chose to mount this under the passenger seat pan. I should also mention that I have a switch on the panel that "arms" the system by powering the Arduino via the voltage reducer.

Now run a wire from pin 2 on the screw terminal block to your stick microswitch. Pin 8 goes to your audio panel (I have a GMA245 and I inserted this output into pin 44 of plug 1 ((this is an audio alert input)) the G3X config pages under audio panel allows you to adjust the volume of this input). Pin 10 of the Audrino goes to the right input of the relay. The relays middle input goes to ground and the left input goes to a 5v output on the screw block. On the other side of the terminal, attach your switched (from the panel arm switch) 12v input to the COM (middle) terminal and the NO connects to the smoke positive wire. If you want a led light to illuminate with pump operation then run another wire from pin 10 through a 330 ohm resistor to your favorite color led light connected to ground on the short leg of the led wire.

Now, here's how it works. When power is applied to the Arduino via the panel "arm" switch, it beeps three times quickly. Now your stick switch is ready for usage and when it is pressed A) smoke pump activates B) a tone beeps every second reminding you that you are smokin' C) optional LED light illuminates. Now when you press the stick again A) smoke pump stops B) a tone beeps twice quickly telling you its off. C) optional LED goes out. Pretty simple.. The thing I love about it is when flying formation I can hear without moving my head if I'm smoking our not also I don't need to reach for a panel switch as the microswitch on the stick activates it.

I hope this helps someone out in the future. PM me if you have any questions
Below is the code (I suggest you don't mess with it unless you know how to program)



/*
This program monitors a micro switch on the control stick for turning on/off the smoke pump.

When the program starts up it plays three tones to indicate the program started.

It then waits for the micro switch to be pushed. Each time the micro switch is pushed it changes the running state of the smoke pump.
One push to turn it on, one push to turn it off.

When the smoke pump is running a beeping sound is emitted and the status LED is blinked.

When the micro switch is pushed to turn off the smoke pump, a double beep is emitted and the LED is turned off.

Final Version
*/

// Pin assignments

const int pbuttonPin = 2;// connect stick push button
const int buzzPin = 8; // sound output pin
const int relayPin = 10;// Connected to pump relay
const int LEDpin = 13; // note: this is an LED on the arduino board, change to another pin if you have an external LED

// time duration and tones for beeping and blinking

const unsigned long onDuration = 25;// OFF time for LED
const unsigned long offDuration = 1200;// ON time for LED
const unsigned int offTone = 440; // beep tone when smoke is turned off
const unsigned int onTone = 880; // beep tone while smoke is on
const unsigned int sTone = 1700; // beep tone on power up

// set these constants to match how your circuit is wired
const int buttonPush = LOW; // value when button is PUSHED
const int relayOn = LOW; // value that turns ON smoke pump

// loop variables

int val = !buttonPush; // micro switch value
int prevVal = !buttonPush; // previous micro switch value
bool smokeOn = false; // true when smoke is on, false otherwise
unsigned long nextBlinkTime; // next time to change the LED light on/off
int LEDState = LOW; // LED status light state on/off

void setup() {

Serial.begin(9600);

pinMode(pbuttonPin, INPUT_PULLUP);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, relayOn);// keep the load OFF at the begining. If you wanted to be ON, change the HIGH to LOW
pinMode(LEDpin, OUTPUT); // define LEDpin as output
digitalWrite(LEDpin, LEDState);// turn the LED off

// output startup sound
delay (500);
tone(buzzPin, sTone, 120);
delay(160);
tone(buzzPin, sTone, 120);
delay(160);
tone(buzzPin, sTone, 120);
delay(160);



Serial.println("Initialized");
}

void loop() {

// read the push button and see if it's state changed
val = digitalRead(pbuttonPin);
if (val != prevVal) {
// button state changed - wait 50 ms and see if it is still changed to make
// sure we don't respond to spurious transients
delay(50);
val = digitalRead(pbuttonPin);
if (val != prevVal) {
// button state is changed
if (val == buttonPush) {
// the micro switch is pushed - toggle smoke on/off
if (smokeOn) {
smokeOn = false;
Serial.println("Smoke off");
digitalWrite(relayPin, relayOn);

// beep twice when smoke turned off
tone(buzzPin, offTone, 80);
delay(160);
tone(buzzPin, offTone, 80);
delay(160);
}
else {
smokeOn = true;
Serial.println("Smoke on");
digitalWrite(relayPin, !relayOn);
}
// turn off LED and reset nextBlinkTime
LEDState = LOW;
digitalWrite(LEDpin, LEDState);
nextBlinkTime = millis();
}
prevVal = val; // update prevVal to the new value
}
}

if (smokeOn) {
// blink the led light and beep while the smoke is on
if (millis() > nextBlinkTime) {
if (LEDState == LOW) {
LEDState = HIGH;
nextBlinkTime = millis() + onDuration;
tone(buzzPin, onTone, onDuration);
}
else {
LEDState = LOW;
nextBlinkTime = millis() + offDuration;
}
digitalWrite(LEDpin, LEDState);
}
}

}// loop ends
 

Attachments

  • smokeinverted.jpg
    smokeinverted.jpg
    1.1 MB · Views: 255
Very cool

Thanks for this info and code. Very cool. I'm not there yet w/ my build but will play around w/ this in my spare time.
Any thoughts of using the ESP32 for this as well as other functions? Just a thought as I use them all over the home and they have great scale and dependability.
Blue skies...
 
Thanks for this info and code. Very cool. I'm not there yet w/ my build but will play around w/ this in my spare time.
Any thoughts of using the ESP32 for this as well as other functions? Just a thought as I use them all over the home and they have great scale and dependability.
Blue skies...


I dont know about the ESP32, not in my bag of tricks. Feel free to try the code if you want.
 
Back
Top