« first day    last day (24 days later) » 

3:08 AM
More quick replies. (1) It was two years ago that I read that AdaFruit circuitPython was not compatible with Rpi4B stretch IDLE python, and at that time I read about the PyPi base python package which seems ported from AdaFruit and should be compatible to Rpi and ESP8266-12 / ESP32. (2) But now Thonny python interpreter has options for AdaFruit M0 circuit python, ESP32, and also Rpi Pico micro python (which I am using).
In other words, my comment about incompatibility of circuit might be out of date. (3) Pyreos spec says Vcc limit is 3V to 8V, and that the values lie around rail to rail center, so I always think 5V is optimal. (4) The flame sensor output is from an opAmp, but I forgot that opAmp is dual polarity power (-5V to =5V). If you use a similar dual polarity opAmp to buffer the sensor output before ADC, you might find the output swings between +5V and -5V. But only wild guessing.
(5) I have a WaveShare 24-bit ADC which can handle both positive and negative values, but that cost over HK$400!. (6) Pyreos app note briefly mentions that FFT processing is very slow, so I guess they a small window size of 1000 points from speedy results. (7) My US$300 Rigol DS1504 50MHz digital storage scope can do hardware realtime FFT and display the frequency domain results on screen, they can also do socpe programmin, but I have not tried it.
(8) My current project is not on flame sensor (though I did play with CO2 sensor for smart home automation), but on RGB 1W power LED lamp. So I have RGB sensor and also environmental white light sensor, but only scratching the surface for now. (9) When the time comes, I might control R, G, B led lamps at different luminous intensities and use RGB sensor to direct input to scope to do and display FFT (That is why I ask if you have a scope). But above are wild guessing and brainstorming.
/ to continue later, ... Cheers,
 
 
11 hours later…
2:13 PM
Some more random notes: (1) About negative value of ADC output - most ADC sensor with +5V single power supply only gives output in the range of 0V to max of analog reference voltage eg, 4.096V. (2) However, you can easily use a cheaper opAMP to shift the whole output range from say (-1V to +3V) to (0V to +4V), and some sensors have built in up shifters, eg, this one:

PH-4502C pH Sensor Calibration and ADC using MCP3008, PCF8591, and ADS1115
https://raspberrypi.stackexchange.com/questions/96653/ph-4502c-ph-sensor-calibration-and-adc-using-mcp3008-pcf8591-and-ads1115.
 
 
7 hours later…
9:27 PM
Thank you for your help with all this. I tried the FFT method and it is OK, not ideal. I think sampling in my loop at .sleep(.05) up to 1024 samples takes about a minute to process so its not a great solution. The other issue is that, even without any algorithm like hanning/FFT, if I just try and detect the raw ADC values with a lighter or match at a distance greater than 1 feet, it barely detects any signal. The flame has to be basically right up to the sensor for it work.
 

« first day    last day (24 days later) »