This morning I went out to check on my greenhouse project and the Argon is not functioning anymore. It was warm to the touch and had obliterated the QR code because of the heat. It was emitting a solid red light on the main LED and the charge LED was on solid yellow.
Removing it from the greenhouse and plugging it into USB causes it to heat up so it is warm to the touch and the lights remain the same. Holding the buttons down to try to enter DFU mode or safe mode produces no response.
The greenhouse was reporting data for a few hours before this happened. Prior to the failure I placed the solar panel, which may have blocked the signal. Could it be that the Argon destroyed itself just because it could not connect to the internet and, while trying, overheated? That would be very disappointing but the important thing is to figure out what’s going on I guess.
This is the firmware that was on it. It as working for a few days indoors before the greenhouse was deployed outdoors,
// This #include statement was automatically added by the Particle IDE.
#include <SparkFun_SCD30_Arduino_Library.h>
// This #include statement was automatically added by the Particle IDE.
#include <DHT22Gen3_RK.h>
// This #include statement was automatically added by the Particle IDE.
#include <MCP23017-RK.h>
SCD30 airSensor;
MCP23017 gpio(Wire, 0);
float seconds;
int digitalwritepin;
int pulse_valve_length;
float co2;
float hum_in;
float hum_ext;
float temp_in;
float temp_ext;
int irrigation_pulse_len = 15; // by default pulse the valve for 15ms to open or close.
unsigned long old_time = millis();
// How often to check the co2 in milliseconds
const unsigned long CHECK_INTERVAL = 300000;
unsigned long lastCheck = 0;
// The two parameters are any available GPIO pins. They will be used as output but the signals aren't
// particularly important for DHT11 and DHT22 sensors. They do need to be valid pins, however.
DHT22Gen3 dht(D7, D8);
void sampleCallback(DHTSample sample);
void setup() {
//Functions for manual control of the outputs
Particle.function("Open_seconds", open_seconds);
Particle.function("Close_seconds", close_seconds);
Particle.function("pulse_pin", pulse_pin);
Particle.function("fans_seconds", fans_seconds);
Particle.function("blower_seconds", blower_seconds);
Particle.function("sprinkler_seconds", sprinkler_seconds);
Particle.function("irrigate_seconds", irrigate_seconds);
Particle.function("irrigation_pulse_length", irrigation_pulse_length); //set the length of a pulse used to open or close the valve
Serial.begin(9600);// for the mcp23017
delay(5000);
gpio.begin();//gpio expander instance (mcp23017)
Wire.begin();
if (airSensor.begin() == false)
{
Serial.println("Air sensor not detected. Please check wiring. Freezing...");
Particle.publish("frozen because co2 sensor is not connected");
while (1)
;
}
dht.setup();
}
void loop() {
dht.loop();
if (millis() - lastCheck >= CHECK_INTERVAL) {
lastCheck = millis();
co2 = airSensor.getCO2();
delay(1000);
dht.getSample(A3, [](DHTSample sample1) {
dht.getSample(A4, [sample1](DHTSample sample2) {
if (sample1.isSuccess() && sample2.isSuccess()) {
hum_in = sample1.getHumidity();
temp_in = sample1.getTempC();
hum_ext = sample2.getHumidity();
temp_ext = sample2.getTempC();
}
else {
Log.info("sample is not valid");
}
});
});
send_data();
}
}
int send_data(){
if (Particle.connected()) {
Particle.publish("co2", String(co2));
delay(1000);
Particle.publish("climate_reading_in", String(temp_in) + "," + String(hum_in), PRIVATE);
delay(1000);
Particle.publish("climate_reading_ext", String(temp_ext) + "," + String(hum_ext), PRIVATE);
char buf[256];
snprintf(buf, sizeof(buf), "{\"temp_in\":%.1f,\"hum_in\":%1.f,\"temp_ext\":%.1f,\"hum_ext\":%1.f,\"co2\":%1.f}", temp_in, hum_in, temp_ext, hum_ext, co2);
Particle.publish("send_data", buf, PRIVATE);
}
else {
//log an error if you want.
}
}
int blower_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(2, OUTPUT);
gpio.digitalWrite(2, HIGH);
delay(seconds);
gpio.digitalWrite(2, LOW);
}
int sprinkler_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(4, OUTPUT);
gpio.digitalWrite(4, HIGH);//pulse opens the valve (1-a wire pulsed high for 15ms)
delay(15);
gpio.digitalWrite(4, LOW);
delay(seconds);//technically this is ms now.
gpio.pinMode(5, OUTPUT);
gpio.digitalWrite(5, HIGH);//pulse closes the valve (1-b wire pulsed high for 15ms)
delay(15);
gpio.digitalWrite(5, LOW);
}
int fans_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(0, OUTPUT);
gpio.pinMode(1, OUTPUT);
gpio.digitalWrite(0, HIGH);
gpio.digitalWrite(1, HIGH);
delay(seconds);
gpio.digitalWrite(0, LOW);
gpio.digitalWrite(1, LOW);
}
int pulse_pin(String command)
{
digitalwritepin = atoi(command);
gpio.pinMode(digitalwritepin, OUTPUT);
gpio.digitalWrite(digitalwritepin, HIGH);
delay(1000);
gpio.digitalWrite(digitalwritepin, LOW);
}
int open_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(9, OUTPUT);
gpio.digitalWrite(9, HIGH);
delay(seconds);
gpio.digitalWrite(9, LOW);
}
int close_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(8, OUTPUT);
gpio.digitalWrite(8, HIGH);
delay(seconds);
gpio.digitalWrite(8, LOW);
}
int irrigate_seconds(String command)
{
seconds = atof(command)*1000;
gpio.pinMode(6, OUTPUT);
gpio.digitalWrite(6, HIGH);//pulse opens the valve (2-a wire pulsed high for 15ms)
delay(irrigation_pulse_len);
gpio.digitalWrite(6, LOW);
delay(seconds);//technically this is ms now.
gpio.pinMode(7, OUTPUT);
gpio.digitalWrite(7, HIGH);//pulse closes the valve (2-b wire pulsed high for 15ms)
delay(irrigation_pulse_len);
gpio.digitalWrite(7, LOW);
}
int irrigation_pulse_length(String command)
{
irrigation_pulse_len = atoi(command);
}