This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A simple test to exercise PWM, Tone and Servo functions, all controlled from the terminal. | |
// All PWM sources and WiFi are initially disabled, individually enabled from the terminal. | |
// If you have an RC filter on one of the PWM pins, you can read it at the A0 analog input. | |
// A 200-3K res & 10uf cap R-C work @ 500-40KHz PWM. Make sure your board supports 3.3V Ain! | |
// | |
// This code is released to the public domain with no guarantees whatsoever | |
// "If it breaks in half, you get to keep both halves." ~ George Carlin | |
#include <core_esp8266_waveform.h> // so we can independently disable PWM sources | |
#include <ESP8266WiFi.h> //the main WiFi routines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Objective of the design: use inexpensive components to produce a cleanroom-style particle counter that can be run semi-continuously, monitored from outside the cleanroom. | |
The 攀藤 (PlanTower) PMS5003 (fifth generation) or PMS7003 (seventh generation) dust sensor costs $15 to $22 on eBay from Shenzhen suppliers. It samples 0.1 liter and calculates dust particles in > 0.3um, 0.5um, 1um, 2.5um, 5um and 10um bins. In order to get a useful reading in a cleanroom, we need to add the results from 100 samples (10 liters of air) or the counts are too small to be reliable. ISO 14644-1:1999 specifies counts in 1 cubic metre of air, which would require 10,000 samples from this small sensor. 100 samples takes roughly 300 seconds to process, so sampling 1 m3 would take 500 minutes (8.3 hours). As this device is not intended to be a NIST-traceable particle counter, sampling at 1% should give a reasonable estimate of the cleanroom quality. Note that the two smallest particle bins have up to 50% uncertainty; the larger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <Schedule.h> | |
#include <PolledTimeout.h> | |
const char* AP_SSID = ""; // your router's SSID here | |
const char* AP_PASS = ""; // your router's password here | |
void setup() { | |
Serial.begin(74880); | |
while (!Serial); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Schedule.h> | |
#include <PolledTimeout.h> | |
#define WAKE_UP_PIN D3 // D3/GPIO0, can also force a serial flash upload with RESET | |
// you can use any GPIO for WAKE_UP_PIN except for D0/GPIO16 as it doesn't support interrupts | |
void IRAM_ATTR wakeupPinIsr() { | |
schedule_function([]() { Serial.println("GPIO went from HI to LO"); }); | |
} |