User:Bertrik Sikken: Difference between revisions

From RevSpace
Jump to navigation Jump to search
(211 intermediate revisions by the same user not shown)
Line 5: Line 5:
}}
}}


You can reach me at bertrik@sikken.nl or bertrik@gmail.com
You can reach me at [mailto:bertrik@sikken.nl bertrik@sikken.nl] or [mailto:bertrik@gmail.com bertrik@gmail.com].


Studied Electrical Engineering at Twente University.
Studied Electrical Engineering at Twente University.
Line 11: Line 11:


Main interests:
Main interests:
* reverse-engineering things (USB stuff, mp3 players), working on http://rockbox.org
* reverse-engineering things (USB stuff, mp3 players), worked on http://rockbox.org (sansa clip players)
* studying bats and making electronics for recording/listening to bat sounds
* studying bats and making electronics for recording/listening to bat sounds
* radio stuff, in particular software-defined radio
* radio stuff, in particular software-defined radio
 
* energy-related stuff, visualisation
* citizen science, particulate matter measurement, noise (future)


Projects I work(ed) on ([https://revspace.nl/index.php?title=User:Bertrik_Sikken&action=purge refresh]):
Projects I work(ed) on ([https://revspace.nl/index.php?title=User:Bertrik_Sikken&action=purge refresh]):
Line 27: Line 28:


== Project ideas ==
== Project ideas ==
[[File:praktischnut.jpg|right]]
[[File:idea.jpg|right]]
This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.
This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.


=== Calorie counter ===
https://pine64.com/product/128mb-ox64-sbc-available-on-december-2-2022/
Count the number of calories of products (drinks / candy bars / etc) at revspace, by listening to the bar MQTT stream of products sold, looking up the calories at openfoodfacts.org and re-sending a MQTT message with the daily totals.
 
=== Zigbee device with esp32 ===
See https://github.com/P-R-O-C-H-Y/arduino-esp32/blob/8169a434c3e46e1bb7711ebcc04f27267db2093c/libraries/ESP32/examples/Zigbee/Zigbee_Light_Bulb/Zigbee_Light_Bulb.ino


topic revspace/bank/sale is used to publish the barcodes.
See https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Zigbee


=== PlatformIO ===
=== Cameratoezicht in Gouda ===
Investigate [http://docs.platformio.org/en/stable/what-is-platformio.html PlatformIO] for Arduino projects.
Gemeente Gouda publiceert een lijst van camera's in Gouda, zie
It appears this framework can help you build Arduino projects as a self-contained project with all properties defined in a text file, without having to configure them manually in the IDE each time
https://gis.gouda.nl/viewer/app/Basis_open?bookmark=57b682c39eb8426c81a67934044517c9
(e.g. which board you are compiling for, board options, lwip settings, memory size, cpu speed, etc.)


=== HC-06 stuff ===
Aanmelden (semi-automatisch) bij bijvoorbeeld [https://mapcomplete.org/surveillance Surveillance-under-surveillance] ?
The HC-06 is a serial-bluetooth converter. Default settings are 9600 baud, no parity.
It doesn't really have a 'command mode' you need to enter, just make sure no BT client is connected and
just send the command as a string of characters from the serial side within one second or so (without any CR/LF!).


To set odd parity:
=== SolarEdge ===
AT+PO
Interact with the solar edge api for PV installations.


=== WiFi "top" ===
https://developers.solaredge.com/
This idea is about a simple demo application that shows the number of unique WiFi stations detected.
This gives an idea about how busy a place is.


A bit like the CPU load in the unix/linux "top" tool, this is indicated as a number at different timescales, e.g. number of unique WiFi stations detected in the last minute, last 5 minutes and last 15 minute, last hour, etc.
See https://github.com/bertrik/solaredge-api


The implementation is done using an ESP8266 in promiscuous mode.
=== Stookalert ===
Using the callback for promiscuous mode, a table is built with an entry for each unique MAC address:
Idee: gekleurd lampje dat aangeeft of er op dit moment een stookalert actief is
* only "stations" (like phones, laptops, etc) are recorded in this table, not access points
* the table records the following:
** the unique MAC address
** the time is has been seen first
** the time is has been seen last
* the wifi channel is switched at some interval
* every minute (for example), the stats are calculated from the table and published on MQTT


Operations on this table:
Implementatie:
* entries older than 60 minutes are removed from the table.
* kijk m.b.v. WiFi locatieservice in welke provincie je je bevindt
* when we see a new unknown MAC, it's added to the table (if it fits) and we set the first-seen timestamp
* haal JSON op bij https://www.lml.rivm.nl/stookalert/stookalert.json
* when we see a known MAC, the last-seen timestamp is updated
* toon de bijbehorende kleur op het lampje
* getting stats from the table, for example:
** number of unique station MACs seen in the last minute
** number of unique station MACs seen in the last 5 minutes
** number of unique station MACs seen in the last 15 minutes
** number of unique station MACs seen in the last 60 minutes
* perhaps we can get stats using either the first-seen or the last-seen timestap?


Possible issues:
Resources:
* privacy: the unique MAC of any Wifi station is never exposed, only cumulative numbers. If you're really concerned, consider turning off your WiFi devices (e.g. using airplane mode)
* Officiele pagina: https://www.atlasleefomgeving.nl/stookwijzer
* random MACs: apparently some devices randomize their MAC address if they're not connected to a station. Not sure yet how to handle that.
* Achterliggende JSON met toestand per provincie: https://www.lml.rivm.nl/stookalert/stookalert.json
* switching between promiscuous mode (for sniffing) and station mode (for reporting stats): I don't know how complicated this is, we'll see.
* Er moet ook nog ergens een API zijn die fijnmaziger aangeeft wat de toestand is ...


=== investigate quadcopter remote control ===
=== Display of current electricity usage ===
It turns out that the typical little cheap Chinese quadcopters use a remote-control protocol that can be easily recreated using the famous NRF24L01+ chip (< $1 and easily connected to an arduino).
I have a [https://www.zuidwijk.com/product/slimmelezer-plus/ slimme lezer] connected to the P1 port of my smart electricity meter.
This gives nice opportunity to either:
The default firmware exposes meter readings using an event stream (SSE) at http://slimmelezer.local/events
# transmit our own control signal, to control a quadcopter from something different than the manual remote control, e.g. automatic control
# receive the control signal, so the manual remote control that comes with a quadcopter can be used to steer other things (like a model car).


I haven't found a good overview of quadcopter remote control protocol specifications yet, there seem to be plenty examples of "here-is-the-code" however.
So for example, you can read this with curl:
  curl http://slimmelezer.local/events
With result:
  event: state
  data: {"id":"sensor-power_consumed_phase_1","value":0.046,"state":"0.046 kW"}


=== mini word clock in dutch ===
Specification of SSE: https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
Basically an monochrome 8x8 word clock, in Dutch, showing local time in the Netherlands.
 
What I would like to do is to read these events and control a simple display to display  the current usage number.
 
=== Participating in ultrasonic sound project ===
https://bat-migration-europe.netlify.app/project/
 
Use an audiomoth for this.
 
=== ESP32 C3 ===
* [https://www.espressif.com/en/products/socs/esp32-c3 processor page]
* [https://wiki.luatos.com/chips/esp32c3/index.html luatos basic esp32 c3 board]
 
=== Flexible LED ticker ===
Ordered a flexible 32x8 RGB LED display:
https://nl.aliexpress.com/item/4001296811800.html
 
Matching diffuser to be 3D printed:
https://www.thingiverse.com/thing:1903744
 
=== Washing machine API ===
https://tratt.net/laurie/blog/2023/displaying_my_washing_machines_remaining_time_with_curl_jq_pizauth.html
 
=== TinyML ===
Investigate TinyML, see https://www.tinyml.org/
Apparently can run on a RP2040 (raspi pi pico).
 
https://www.hackster.io/mjrobot/esp32-cam-tinyml-image-classification-fruits-vs-veggies-4ab970
 
=== Bat box busy signal ===
My brother built little pyramid 'blinkies': solar cell + Lithium-supercapacitor + harvesting circuit + LED encased in clear expoxy.
 
Can we add a low-power PIR sensor to this, and make a blinky that blinks if movement was detected by the PIR in the past hour?
 
=== Super tiny RFID ===
See https://www.sparkfun.com/products/16464 an almost sand grain size RFID chip, 1.25mmx1.25mmx0.55mm
 
The accompanying reader "M6E Nano" is still quite expensive at $235.95 : https://www.sparkfun.com/products/14066
 
Uses the MuRata LXMSJZNCMF-198:
"This product can be used as an ultra small tag and this can be
fit on any metal objects, non-metal objects, as well as
embedding into any objects by glue or adhesive and so on."
 
See also: ISO18000-63 and EPC global Gen2(v2)
 
Specification:
* https://www.gs1.org/standards/rfid/uhf-air-interface-protocol
 
=== TheThingsNetwork-Sondehub bridge ===
Uploads balloon telemetry to sondehub.
 
See https://github.com/bertrik/ttnhabbridge/issues/6
 
=== Actually smart boiler ===
The boiler for hot water is about half of my electricity bill.
The idea is to use/build a smart switch that switches it on at time when electricity prices are lowest.
 
Currently have a "Slimme boiler module" from Eneco, which is *not* actually smart,
since it allows me no control whatsoever when it switches on (besides cutting the power in the meterkast).
For example, it will switch on mid-day when my price is high and eneco's price is low, perhaps good for Eneco, not for me.
Apparently, they even received a [https://nieuws.eneco.nl/slim-apparaatje-bij-boiler-vangt-pieken-wind--en-zonnestroom-op/ subsidy] for this.
 
A boiler is a pretty big load, about 3 kW, but it is not inductive.
 
Alternatives:
* https://www.shelly.cloud/en-nl/products/product-overview/shelly-plus-1-pm-2-pack/shelly-plus-1-pm
* https://www.solyxenergy.nl/solar-iboost/ to store excess solar energy in hot water, might also be useful for just controlling a boiler to use cheaper rates
* tuya smartplug, like https://www.wifilampkoning.nl/merken-slimme-verlichting/tuya/tuya-enkele-smartplug-met-energiemeting ?
* tuya 20A smart plug: https://nl.aliexpress.com/item/1005003347568206.html
 
=== Receiving gas meters ===
Apparently gas meters send gas consumption data to the slimme meter using a wireless link in the 868 MHz band.
Probably just FSK at 38.4, as mentioned here: https://a35.veron.nl/nieuwe-elektra-en-gasmeters/
 
Interesting leads:
* https://github.com/stef/smeter
* https://www.rtl-sdr.com/reading-household-wireless-utility-meters-with-an-rtl-sdr-and-plotting-the-data-in-home-automation-software/
* https://github.com/bemasher/rtlamr
 
=== Multi-network wifi manager ===
Figure out or create software so that ESP8266/ESP32 wifi manager can use multiple networks to connect (not just one),
so it allowing storing credentials for more than one network. For example, the network at home, the hacker space, at work.
Instead of reconfiguring the wifi manager for each network, you just *add* your credentials (and the existing credentials
are not replaced).
 
See https://github.com/folkertvanheusden/M.A.X.X
 
Interesting candidates:
* https://registry.platformio.org/libraries/martinverges/ESP32%20Wifi%20Manager wifi manager for ESP32, has a REST API for managing wifi network, but is incomplete in the sense that you need to write your own code (e.g. javascript) to actually *use* its API
* https://github.com/arduino-libraries/Arduino_MultiWiFi is the arduino multi wifi library, to allow connecting to multiple different WiFi networks, but it is not a wifi manager, that starts a captive portal, etc
 
=== Automated bat counting ===
Can we automatically count the number of bats from the image of a webcam mounted in a bat colony?
Perhaps using some kind of AI or machine learning algorithm?
 
The image in question:
https://stofradar.nl/coenecoop/
 
=== Use TheThingsIndoorGateway as Helium/ThingSix hotspot ===
I have a spare TTIG that could perhaps be used as a Helium gateway, investigate what is possible.
 
One possiblity is to capture the gateway traffic from the TTN gateway events API, convert uplink data to a format that the Helium network understands and forward it.
I don't really care about the Helium crypto tokens, this is just for fun and science.
 
What I definitely can do:
* Capture data from the TTN gateway events API, convert it back to Semtech UP format and forward it somewhere to Helium (just not sure where!)
* See also my https://github.com/bertrik/ttn-gateway-collector project which contains an initial implementation of TTN-to-UDP conversion
 
Showstoppers:
* If you want to be a gateway on the Helium network, you have to *pay Helium*! Obviously I don't want that, I just want to share data to improve *their* network.
 
Open work:
* Investigate if Helium has an open uplink API for their hotspots, if so study it etc, without paying the gateway fee
* Investigate if Thingsix has an open uplink API for their hotspots, if so study it etc, without paying any gateway fee
* Investigate if Thingsix is just another Helium, with weird crypto money


[https://github.com/bertrik/miniwordclock This git repo] has the current code.
Interesting stuff:
* https://docs.helium.com/use-the-network/setup-a-packet-forwarder unfortunately the link to setting up the 'light hotspot client' does not work!
* https://docs.helium.com/mine-hnt/light-hotspots/
* https://thingsix.com/


See [https://plus.google.com/103276078656203197145/posts/7ki7rpJzk3a here for a demo] running on an arduino nano.
=== Adding BLE GATT interface to sensors ===
The GATT specification allows measurement properties to be defined and transferred continuously over Bluetooth low-energy.


The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP. The time offset will be fixed to Dutch local time, i.e. GMT+1 taking into account summer time. Summer time will be determined using the general rule "from 2:00 local time on the last sunday of March until 3:00 local time on the last sunday of October".
With GATT you can define a collection of properties (e.g. measurement items like temperature/humidity/particulate matter/noise, etc)
organised in a simple structure of a BLE service.
The 'notification' method allows you to basically push the data continuously to a connected host, e.g. a smart phone.


Local date calculation:
Services collects characteristic, a characteristic has values with units.
* http://stackoverflow.com/questions/5590429/calculating-daylight-saving-time-from-only-date
Each of these (service, characteristic, unit) have their own unique "UUID".
* https://github.com/niekproductions/word-clock
This is described in the so-called [https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf 16-bit UUID numbers document]


=== Understanding LoRa ===
Interesting stuff in GATT:
Ultimate goal is to create an SDR algorithm to decode LoRa without the need for dedicated LoRa hardware. This could be useful when tracking HABs transmitting LoRa for example. See [[DecodingLora]] and [[EncodingLora]].
* See GATT_Specification_Supplement_v5 paragraph 3.151, it has a noise characteristic with 1 dB resolution.
* 0x27C3 is the GATT *unit* for sound pressure
* 0x181A is the GATT environmental sensing *service*, document name "ESP_V1.0.0.pdf"
* 0x2A6E is the GATT Characteristic and Object Type for temperature
* 0x2A6F is the GATT Characteristic and Object Type for humidity
* 0x2BD5 is the GATT Characteristic and Object Type for Particulate Matter - PM1 Concentration
* 0x2BD6 is the GATT Characteristic and Object Type for Particulate Matter - PM2.5 Concentration
* 0x2BD7 is the GATT Characteristic and Object Type for Particulate Matter - PM10 Concentration
* Unfortunately I cannot find a characteristic for carbon-dioxide (CO2) in the BLE GATT unit document


In particular, I should definitely check out [https://github.com/rpp0/gr-lora this gr-lora project].
See also https://programmaticponderings.com/2020/08/04/getting-started-with-bluetooth-low-energy-ble-and-generic-attribute-profile-gatt-specification-for-iot/
Perhaps make it work for decoding balloon telemetry modes.


An ambitious goal is to be able to decode LoRAWAN transmissions and implement an rtl-sdr based gateway.
=== Reverse engineering XS-8217 bluetooth air quality meter ===
This is a thing that measures CO2, humidity, temperature, TVOC and formaldehyde.


=== Cypress PSOC5 ===
See also https://wiki.liutyi.info/display/CO2/ZN-2CO3+Inside
Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See [[RadarOnAStick]].


=== Simple Doppler motion sensors ===
This teardown looks a lot like my sensor: https://www.youtube.com/watch?v=APnjhMrJChI
You can find basic doppler microwave motion sensors based on a single transistor, with some weird traces on the PCB very cheaply, for example
Mine contains a "TPM-300A" sensor for measuring VOC.
* https://www.aliexpress.com/item/RCWL-0516-microwave-radar-sensor-module-Human-body-induction-switch-module-Intelligent-sensor/32708877914.html


Typically the microwave part of these consists of a single transistor with a rectangular area on one leg and a meandering trace (with lots of vias to the other side) on the other leg.
It has a bluetooth interface, device name is XS-8217.
The output of this circuit seems to go into a chip very much like the ones used in PIR sensors.
It has a BLE GATT profile, with the following services
* service 0xC760
** characteristic 0xC762 (WRITE)
** characteristic 0xC761 (NOTIFY)
*** example data: 0x23 0x06 0x10 0x04 0xF1 0x00 0x23 0x65
*** example data: 0x23 0x08 0x10 0x04 0x01 0x9A 0x00 0x0A 0x00 0x03 0x0E
*** data shown on screen was approximately: CO2=418ppm, HCHO=0.003mg/m3, TVOC=0.013mg/m3, temp=24degC, humi=35%


See also https://github.com/jdesbonnet/RCWL-0516 for a reverse engineering effort of these doppler radar modules.
So data in the characteristic 0xC761 seems to have a 4 byte constant header:
* 0x23
* length byte


=== Rust ===
Then we have for the first message: 0x10 0x04 0xF1 0x00 0x23 0x65
Investigate the [https://www.rust-lang.org/en-US/ rust language].
* 0x10 0x04 fixed header
* 0xF1 is temperature in 0.1 degree Celcius most likely (24.1)
* 0x00 is ...
* 0x23 is humidity most likely (35)
* 0x65 is ... checksum perhaps


=== ESP32 ===
And for the second message: 0x10 0x04 0x01 0x9A 0x00 0x0A 0x00 0x03 0x0E
I have a Wemos "LOLIN32 V1.0.0" ESP32 board, play with it. Discover Bluetooth capabilities, low power modes. Compare it with ESP8266.
* 0x10 0x04 fixed header
* [https://github.com/wemos/arduino-esp32 ESP32 Arduino page] by Wemos
* 0x01 0x9A is the CO2 concentration (410)
* 0x00 0x0A is TVOC most likely (10)
* 0x00 0x03 is HCHO most likely (3)
* 0x0E is ... checksum perhaps


=== Bare-bones Arduino bat detector ===
=== ribbon tweeter for bat audio ===
This is an idea for a very basic heterodyne bat detector, doing signal processing on an Arduino, requiring minimal external components.
Someone gave me this idea:
Use a ribbon tweeter like this for playing back bat audio:
<s>https://nl.aliexpress.com/item/4000973201791.html</s>
https://nl.aliexpress.com/item/1005002565880660.html


The basic principle of a heterodyne detector is that it just mixes (multiplies) the audio signal with a square wave, low-pass filters the result and puts it on a speaker.
The frequency spectrum shows no sign of dropping off at 20 kHz.


Multiplying with a square wave can also be considered to be just alternatively inverting and not-inverting the signal.
=== 3d glasses ===
So if you sample an ultrasonic signal at twice the rate you want to multiply, you can just subtract odd samples from even samples and low-pass filter that.
I got some 2nd hand 3d glasses, they look exactly like these ones:
* GH-15 https://www.dhgate.com/product/g15-dlp-3d-active-shutter-glasses-96-144hz/213983026.html
* Sintron https://www.amazon.de/Sintron-Kompatibel-TDG-BT500A-TDG-BT400A-Deutschland/dp/B015PCWMZ8
The common name appears to be "G15-DLP".


How this can be done in an AVR Arduino:
A tear-down here:
* sample the audio signal at twice the detection frequency, say 84 kHz. An AVR should just be able to do that.
* https://blog.danman.eu/3d-shutter-glasses-teardown/
* apply a 1-pole IIR high-pass filter to remove DC bias, this takes one shift instruction and one addition.
* multiply by the detection frequency, this means just inverting the odd samples.
* low-pass filter the signal, this can be done using a moving average filter, say 16 samples long (first null at 5.25 kHz). Theoretically, averaging 16 samples should result in two bits extra accuracy. This operation takes some storage, an addition and a subtraction.
* output the filtered signal using PWM, possibly at the same rate that we are sampling the input audio.


The microphone can be a 40 kHz piezo transducer, to keep it cheap (but also limited to 40 kHz).
Interesting documents:
The pre-amplifier can be a single transistor with some resistors around it, providing about 40x gain.
* http://cmst.curtin.edu.au/wp-content/uploads/sites/4/2016/05/2012-28-woods-helliwell-cross-compatibility_of_shutter_glasses.pdf
The arduino does the signal processing (mixing, low-pass filter) to shift the bat audio to human range.
* http://cmst.curtin.edu.au/local/docs/pubs/2011-17-woods-helliwell-3D-Sync-IR.pdf
The speaker amplifier can just be a simple two transistor push-pull circuit, since the output from the Arduino is digital/PWM.


==== AVR Arduino sample rate ====
Someone claims he got something to work with some hacks:
As far as I understand, the ADC clock can be set to 1 MHz.
https://www.avsforum.com/threads/how-i-got-cheap-dlp-link-glasses-to-work-great.1887145/
Conversion takes 13 cycles, so this can be a problem to reach a sample rate above 80 kHz.


==== Example C code ====
=== Waterniveaumeter ===
(this is the general idea, but I don't know if it compiles):
Op verschillende plekken in Gouda staat er water in de kruipruimte van huizen van bewoners.
<pre>
Kunnen we dat meten en inzichtelijk maken, voor bewoners, op een kaart bijvoorbeeld?
#define BUF_SIZE    16


static void ISR(void)
Idee:
{
* in de kruipruimte plaats je een module die waterhoogte kan meten
    static int16_t buffer[BUF_SIZE];
* de module bestaat uit een microcontroller en een afstandsmeter, die de waterhoogte bepaalt
    static int16_t lowpass = 0;
* de gegevens worden via WiFi doorgestuurd naar een centraal punt, waar de data wordt verwerkt en gevisualiseerd
    static int32_t sum = 0;
* op een webpagina kan je een overzicht zien van alle meters die online zijn
    static bool even = false;
* de meting wordt gedaan door bijv. een laser-afstandsmeter of een ultrasoon-afstandsmeter
* voeding? lastig, hoe krijg je 5v naar een potentieel natte plek?
* kosten? verwachting < E 40,-


    int16_t input, signal, mixed;
In Gouda wordt op veel verschillende plekken de grondwaterstand gemeten, zie https://opendata.munisense.net/portal/wareco-water2/group/581/Gouda-KJ38A , maar:
* geen visualisatie op de kaart, je ziet alleen de meetlokaties d.m.v. een icoontje!
* geen meetpunten in Gouda noord!


    // sample signal as 16 bits (10 bits significant)
=== Online bat detector ===
    input = ....
Idea: use an ultrasonic microphone, connect it to a WebSDR, so people can tune into bat sounds remotely.


    // HPF input signal
=== Raspberry pi airplane tracking ===
    signal = input - lowpass;
Apparently now you can also participate in MLAT tracking of planes that don't transmit GPS coordinates themselves.
    lowpass += signal >> 4;


    // multiply by carrier
=== APRS gateway ===
    mixed = even ? signal : -signal;
http://qso365.co.uk/2017/02/a-guide-to-setting-up-an-aprs-receive-only-igate-using-a-raspberry-pi-and-an-rtl-sdr-dongle/
    even = !even;


    // calculate moving average sum
=== JQ6500 ===
    sum += mixed ;
Small inexpensive modules that play mp3 from an internal flash. Could be nice for a custom door bell for example.
    sum -= buffer[index];
    buffer[index] = mixed ;
    index = (index + 1) % BUF_SIZE;


    // output LPF as 8-bit number
More info at:
    out = sum >> 7;
* https://www.elecfreaks.com/wiki/index.php?title=JQ6500_Mini_MP3_Module
    ...
* https://sparks.gogo.co.nz/jq6500/index.html
}
</pre>


=== Bat call cleaner ===
=== FPGA ===
This idea is about a simple push-button tool to clean up bat call recordings, to make them more suitable for playback in a bat lure.
Cheap FPGA boards and nice applications:
* https://bitbucket.org/appanp/artificial-neural-networks/wiki/Home/FPGAsAndNeuralNets.md#!sbcs-and-iot-boards
* [http://nl.aliexpress.com/item/Altera-fpga-cycloneii-ep2c5t144-learning-board-development-board/872520721.html inexpensive ep2c5t144 board]
* http://land-boards.com/blwiki/index.php?title=Cyclone_II_EP2C5_Mini_Dev_Board


By cleaning up, I mean removing the background noise and turning it into a pure sine wave like signal characterized only by an instantaneous frequency and amplitude.  
=== Neural networks on low-end hardware ===
Any harmonics will be lost.
Investigate if you can run a powerful neural network on relatively low-end/cheap/low-power hardware. For example a Raspberry pi.
A RPI runs Linux, run python, just like some common neural frameworks.
Do we need hardware acceleration from the GPU and does the RPI GPU support that?


This way, you can pick a nice bat call recording and turn it into a file suitable for playing back at relatively loud volume from a bat call player / lure, without the broadband noise.
Read list:
* https://www.zdnet.com/pictures/raspberry-pi-meets-ai-the-projects-that-put-machine-learning-on-the-35-board/
* https://www.pyimagesearch.com/2017/12/18/keras-deep-learning-raspberry-pi/
* https://www.indiegogo.com/projects/sipeed-maix-the-world-first-risc-v-64-ai-module#/
* https://ai.intel.com/intel-neural-compute-stick-2-smarter-faster-plug-and-play-ai-at-the-edge/


The signal is put through the following signal processing stages:
Bought a MaixPy:
* Apply a high-pass filter to get rid of non-ultrasonics like speech, say at 10 kHz
* see https://maixpy.sipeed.com/en/
* Convert the signal into a complex [https://en.wikipedia.org/wiki/Analytic_signal analytic signal], by creating the imaginary part using a [https://en.wikipedia.org/wiki/Hilbert_transform Hilbert transform].
* see https://www.youtube.com/watch?v=KResVuAIMb4
** The Hilbert transform can be approximated by a FIR filter of appropriate length to get the desired bandwidth.
* see http://educ8s.tv/sipeed-m1-dock-review/
* Split the complex signal into an instantaneous frequency and amplitude.
* interesting? https://www.instructables.com/id/Transfer-Learning-With-Sipeed-MaiX-and-Arduino-IDE/
** The frequency is determined by differentiating the instantaneous phase (inverse tangens i/q).
** The amplitude is determined by calculating the norm of the complex signal (sqrt of i^2 + q^2)
* Average/low-pass the frequency component, say at 0.1 ms intervals. Do the same to the amplitude.
* Re-synthesize the signal s using the simple model s = A.sin(2.pi.t/f) where A is amplitude, t is time and f is frequency, interpolating A and f.


Alternative:
=== mini word clock in dutch ===
* Apply a high-pass filter to get rid of non-ultrasonics like speech, say at 10 kHz
Basically an monochrome 8x8 word clock, in Dutch, showing local time in the Netherlands.
* chop the signal up in segments of (say) 100 ms and determine the total energy content in each segment
* choose the quietest segment and use this as a "background noise template"
** perform a fourier analysis on the template
* reduce the noise on the signal using the template:
** for each segment, apply for each frequency an attenuation based on the signal level compared to the template level
** resynthesize from fourier back into the time domain using an overlap-add method
=> perhaps there is already software which performs these steps?


=== Disable flashy modes on an inexpensive flashlight ===
[https://github.com/bertrik/miniwordclock This git repo] has the current code.
I have one of those flashlights with an XML-T6 LED.
It runs on a single 18650 and puts out about 250 lumens (guesstimate).
However it also has a bunch of annoying 'modes':
* max
* bright
* low
* strobe
* SOS


The flashy modes are really annoying, I see no use for them and only makes the flashlight harder to use.
See [https://plus.google.com/103276078656203197145/posts/7ki7rpJzk3a here for a demo] running on an arduino nano.


The plan is to modify the light according to [https://devjoe.com/2014/09/20/cree-led-flashlight-mod-disabling-different-modes-sipik-sk68-clone/ instructions like these], so it becomes a '1-mode' light.
The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP.
Ideally, I'd like to have the max/bright/low modes without the flashy modes and also have a bigger difference between the modes, like 2.5/25/250 lumens.
Andreas Spiess demonstrated on youtube how existing libraries on the ESP8266 can be used to do the local time (including summer-time) calculations.


=== ESP8266 modbus adapter for solar converters ===
=== Cypress PSOC5 ===
This idea is about programming an ESP8266 to talk to solar converter over RS485 on one side as a MODBUS/serial master, and making it appear as a MODBUS/TCP slave on the other side. This way you can talk to your solar converter using an existing MODBUS/TCP slave application.
Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See [[RadarOnAStick]].


The particular solar converter is the "EP Solar MPPT Tracer A 3210A".
=== Simple Doppler motion sensors ===
[https://github.com/kasbert/epsolar-tracer This github project] may give some clues to which modbus registers contain what.
You can find basic doppler microwave motion sensors based on a single transistor, with some weird traces on the PCB very cheaply, for example
* https://www.aliexpress.com/item/RCWL-0516-microwave-radar-sensor-module-Human-body-induction-switch-module-Intelligent-sensor/32708877914.html


The RS485 side is done using a (soft-)UART on the ESP8266 with a TTL-to-RS485 converter.
Typically the microwave part of these consists of a single transistor with a rectangular area on one leg and a meandering trace (with lots of vias to the other side) on the other leg.
The output of this circuit seems to go into a chip very much like the ones used in PIR sensors.


The TCP/IP side is done using the built-in wifi of the ESP8266.
See also https://github.com/jdesbonnet/RCWL-0516 for a reverse engineering effort of these doppler radar modules.


ESP8266 as modbus slave (over network):
=== Bare-bones Arduino bat detector ===
* https://github.com/andresarmento/modbus-esp8266
This is an idea for a very basic heterodyne bat detector, doing signal processing on an Arduino, requiring minimal external components.
* https://github.com/yaacov/ArduinoModbusSlaveTCP


ESP8266 as modbus master:
The basic principle of a heterodyne detector is that it just mixes (multiplies) the audio signal with a square wave, low-pass filters the result and puts it on a speaker.
* https://github.com/4-20ma/ModbusMaster


=== GPS repeater ===
Multiplying with a square wave can also be considered to be just alternatively inverting and not-inverting the signal.
This idea is about experimenting with a cheap GPS repeater built out of an "active" GPS antenna.
So if you sample an ultrasonic signal at twice the rate you want to multiply, you can just subtract odd samples from even samples and low-pass filter that.


The problem this solves is that often indoors you have no GPS reception, but you like to have some signal to experiment with (e.g. a LoRa tracker).
How this can be done in an AVR Arduino:
* sample the audio signal at twice the detection frequency, say 84 kHz. An AVR should just be able to do that.
* apply a 1-pole IIR high-pass filter to remove DC bias, this takes one shift instruction and one addition.
* multiply by the detection frequency, this means just inverting the odd samples.
* low-pass filter the signal, this can be done using a moving average filter, say 16 samples long (first null at 5.25 kHz). Theoretically, averaging 16 samples should result in two bits extra accuracy. This operation takes some storage, an addition and a subtraction.
* output the filtered signal using PWM, possibly at the same rate that we are sampling the input audio.


Plan:
The microphone can be a 40 kHz piezo transducer, to keep it cheap (but also limited to 40 kHz).
* get a cheap active GPS antenna from AliExpress (some as cheap as E2,- !), most just mention one frequency (1575.42 MHz)
The pre-amplifier can be a single transistor with some resistors around it, providing about 40x gain.
* get a bias-T circuit to feed it the supply voltage (e.g. from a KOPPLA) and pass the RF signal onto an indoor antenna
The arduino does the signal processing (mixing, low-pass filter) to shift the bat audio to human range.
* the indoor antenna may be as simple as a 1/4 wave coax dipole: center conductor sticking up (about 47 mm), coax shielding is divided into 3 of 4 ground radials sticking sideways
The speaker amplifier can just be a simple two transistor push-pull circuit, since the output from the Arduino is digital/PWM.
* build it and test it with a smart phone, tracker hardware, etc.


See also:
==== AVR Arduino sample rate ====
* [https://electronics.stackexchange.com/a/156488 Reradiating antena for GPS]
As far as I understand, the ADC clock can be set to 1 MHz.
Conversion takes 13 cycles, so this can be a problem to reach a sample rate above 80 kHz.


=== Indoor radar speed sign ===
=== Indoor radar speed sign ===

Revision as of 08:15, 7 June 2024

User info Bertrik Sikken
Name Bertrik Sikken
Nick bertrik
Tagline heb ik niet

You can reach me at bertrik@sikken.nl or bertrik@gmail.com.

Studied Electrical Engineering at Twente University.


Main interests:

  • reverse-engineering things (USB stuff, mp3 players), worked on http://rockbox.org (sansa clip players)
  • studying bats and making electronics for recording/listening to bat sounds
  • radio stuff, in particular software-defined radio
  • energy-related stuff, visualisation
  • citizen science, particulate matter measurement, noise (future)

Projects I work(ed) on (refresh):

 Project Status
FrontDoorDisplayAbandoned
HabAlertAppAbandoned
ISSOAbandoned
IbmPosDisplayAbandoned
Pico TrackersAbandoned
RadarOnAStickAbandoned
WifiLampAbandoned
A4PaperDispenserCompleted
BuildStatusTrafficLightCompleted
CJMCU-811Completed
CO2MeterHackingCompleted
CrawlSpaceSensorCompleted
DecodingLoraCompleted
DustSensorCompleted
ElectronicLoadCompleted
EspNowSkipCompleted
IntakefancontrollerCompleted
LichtKrantCompleted
LoRaGatewayCompleted
LoraBatBoxCompleted
LoraWanNodeCompleted
MHZ19Completed
MainsFrequencyCompleted
MiniSTM32F103ZECompleted
PowerLightCompleted
RC522HackingCompleted
RevRadioCompleted
STM32Completed
Secure iButtonCompleted
SoilHumiditySensorCompleted
StofAnanasCompleted
StofradarCompleted
TTNHABBridgeCompleted
VINDRIKTNINGCompleted
ZigbeeCoordinatorCompleted
Sensor-data-bridgeCompleted
AntiLostIn progress
AudioMothIn progress
CubeCellIn progress
EspAudioSensorIn progress
Esp32camIn progress
FMCWRadarIn progress
KaraburanIn progress
LoRa-E5-miniIn progress
LoraWanDustSensorIn progress
MainsFrequency2.0In progress
Msi2500SDRIn progress
MysteryLidarIn progress
Sim7020In progress
StereoBatRecorderIn progress
... further results


Project ideas

Praktischnut.jpg
Idea.jpg

This is a list of ideas I'm thinking about, but have not fully developed into an actual project yet.

https://pine64.com/product/128mb-ox64-sbc-available-on-december-2-2022/

Zigbee device with esp32

See https://github.com/P-R-O-C-H-Y/arduino-esp32/blob/8169a434c3e46e1bb7711ebcc04f27267db2093c/libraries/ESP32/examples/Zigbee/Zigbee_Light_Bulb/Zigbee_Light_Bulb.ino

See https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Zigbee

Cameratoezicht in Gouda

Gemeente Gouda publiceert een lijst van camera's in Gouda, zie https://gis.gouda.nl/viewer/app/Basis_open?bookmark=57b682c39eb8426c81a67934044517c9

Aanmelden (semi-automatisch) bij bijvoorbeeld Surveillance-under-surveillance ?

SolarEdge

Interact with the solar edge api for PV installations.

https://developers.solaredge.com/

See https://github.com/bertrik/solaredge-api

Stookalert

Idee: gekleurd lampje dat aangeeft of er op dit moment een stookalert actief is

Implementatie:

Resources:

Display of current electricity usage

I have a slimme lezer connected to the P1 port of my smart electricity meter. The default firmware exposes meter readings using an event stream (SSE) at http://slimmelezer.local/events

So for example, you can read this with curl:

 curl http://slimmelezer.local/events

With result:

 event: state
 data: {"id":"sensor-power_consumed_phase_1","value":0.046,"state":"0.046 kW"}

Specification of SSE: https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream

What I would like to do is to read these events and control a simple display to display the current usage number.

Participating in ultrasonic sound project

https://bat-migration-europe.netlify.app/project/

Use an audiomoth for this.

ESP32 C3

Flexible LED ticker

Ordered a flexible 32x8 RGB LED display: https://nl.aliexpress.com/item/4001296811800.html

Matching diffuser to be 3D printed: https://www.thingiverse.com/thing:1903744

Washing machine API

https://tratt.net/laurie/blog/2023/displaying_my_washing_machines_remaining_time_with_curl_jq_pizauth.html

TinyML

Investigate TinyML, see https://www.tinyml.org/ Apparently can run on a RP2040 (raspi pi pico).

https://www.hackster.io/mjrobot/esp32-cam-tinyml-image-classification-fruits-vs-veggies-4ab970

Bat box busy signal

My brother built little pyramid 'blinkies': solar cell + Lithium-supercapacitor + harvesting circuit + LED encased in clear expoxy.

Can we add a low-power PIR sensor to this, and make a blinky that blinks if movement was detected by the PIR in the past hour?

Super tiny RFID

See https://www.sparkfun.com/products/16464 an almost sand grain size RFID chip, 1.25mmx1.25mmx0.55mm

The accompanying reader "M6E Nano" is still quite expensive at $235.95 : https://www.sparkfun.com/products/14066

Uses the MuRata LXMSJZNCMF-198: "This product can be used as an ultra small tag and this can be fit on any metal objects, non-metal objects, as well as embedding into any objects by glue or adhesive and so on."

See also: ISO18000-63 and EPC global Gen2(v2)

Specification:

TheThingsNetwork-Sondehub bridge

Uploads balloon telemetry to sondehub.

See https://github.com/bertrik/ttnhabbridge/issues/6

Actually smart boiler

The boiler for hot water is about half of my electricity bill. The idea is to use/build a smart switch that switches it on at time when electricity prices are lowest.

Currently have a "Slimme boiler module" from Eneco, which is *not* actually smart, since it allows me no control whatsoever when it switches on (besides cutting the power in the meterkast). For example, it will switch on mid-day when my price is high and eneco's price is low, perhaps good for Eneco, not for me. Apparently, they even received a subsidy for this.

A boiler is a pretty big load, about 3 kW, but it is not inductive.

Alternatives:

Receiving gas meters

Apparently gas meters send gas consumption data to the slimme meter using a wireless link in the 868 MHz band. Probably just FSK at 38.4, as mentioned here: https://a35.veron.nl/nieuwe-elektra-en-gasmeters/

Interesting leads:

Multi-network wifi manager

Figure out or create software so that ESP8266/ESP32 wifi manager can use multiple networks to connect (not just one), so it allowing storing credentials for more than one network. For example, the network at home, the hacker space, at work. Instead of reconfiguring the wifi manager for each network, you just *add* your credentials (and the existing credentials are not replaced).

See https://github.com/folkertvanheusden/M.A.X.X

Interesting candidates:

Automated bat counting

Can we automatically count the number of bats from the image of a webcam mounted in a bat colony? Perhaps using some kind of AI or machine learning algorithm?

The image in question: https://stofradar.nl/coenecoop/

Use TheThingsIndoorGateway as Helium/ThingSix hotspot

I have a spare TTIG that could perhaps be used as a Helium gateway, investigate what is possible.

One possiblity is to capture the gateway traffic from the TTN gateway events API, convert uplink data to a format that the Helium network understands and forward it. I don't really care about the Helium crypto tokens, this is just for fun and science.

What I definitely can do:

  • Capture data from the TTN gateway events API, convert it back to Semtech UP format and forward it somewhere to Helium (just not sure where!)
  • See also my https://github.com/bertrik/ttn-gateway-collector project which contains an initial implementation of TTN-to-UDP conversion

Showstoppers:

  • If you want to be a gateway on the Helium network, you have to *pay Helium*! Obviously I don't want that, I just want to share data to improve *their* network.

Open work:

  • Investigate if Helium has an open uplink API for their hotspots, if so study it etc, without paying the gateway fee
  • Investigate if Thingsix has an open uplink API for their hotspots, if so study it etc, without paying any gateway fee
  • Investigate if Thingsix is just another Helium, with weird crypto money

Interesting stuff:

Adding BLE GATT interface to sensors

The GATT specification allows measurement properties to be defined and transferred continuously over Bluetooth low-energy.

With GATT you can define a collection of properties (e.g. measurement items like temperature/humidity/particulate matter/noise, etc) organised in a simple structure of a BLE service. The 'notification' method allows you to basically push the data continuously to a connected host, e.g. a smart phone.

Services collects characteristic, a characteristic has values with units. Each of these (service, characteristic, unit) have their own unique "UUID". This is described in the so-called 16-bit UUID numbers document

Interesting stuff in GATT:

  • See GATT_Specification_Supplement_v5 paragraph 3.151, it has a noise characteristic with 1 dB resolution.
  • 0x27C3 is the GATT *unit* for sound pressure
  • 0x181A is the GATT environmental sensing *service*, document name "ESP_V1.0.0.pdf"
  • 0x2A6E is the GATT Characteristic and Object Type for temperature
  • 0x2A6F is the GATT Characteristic and Object Type for humidity
  • 0x2BD5 is the GATT Characteristic and Object Type for Particulate Matter - PM1 Concentration
  • 0x2BD6 is the GATT Characteristic and Object Type for Particulate Matter - PM2.5 Concentration
  • 0x2BD7 is the GATT Characteristic and Object Type for Particulate Matter - PM10 Concentration
  • Unfortunately I cannot find a characteristic for carbon-dioxide (CO2) in the BLE GATT unit document

See also https://programmaticponderings.com/2020/08/04/getting-started-with-bluetooth-low-energy-ble-and-generic-attribute-profile-gatt-specification-for-iot/

Reverse engineering XS-8217 bluetooth air quality meter

This is a thing that measures CO2, humidity, temperature, TVOC and formaldehyde.

See also https://wiki.liutyi.info/display/CO2/ZN-2CO3+Inside

This teardown looks a lot like my sensor: https://www.youtube.com/watch?v=APnjhMrJChI Mine contains a "TPM-300A" sensor for measuring VOC.

It has a bluetooth interface, device name is XS-8217. It has a BLE GATT profile, with the following services

  • service 0xC760
    • characteristic 0xC762 (WRITE)
    • characteristic 0xC761 (NOTIFY)
      • example data: 0x23 0x06 0x10 0x04 0xF1 0x00 0x23 0x65
      • example data: 0x23 0x08 0x10 0x04 0x01 0x9A 0x00 0x0A 0x00 0x03 0x0E
      • data shown on screen was approximately: CO2=418ppm, HCHO=0.003mg/m3, TVOC=0.013mg/m3, temp=24degC, humi=35%

So data in the characteristic 0xC761 seems to have a 4 byte constant header:

  • 0x23
  • length byte

Then we have for the first message: 0x10 0x04 0xF1 0x00 0x23 0x65

  • 0x10 0x04 fixed header
  • 0xF1 is temperature in 0.1 degree Celcius most likely (24.1)
  • 0x00 is ...
  • 0x23 is humidity most likely (35)
  • 0x65 is ... checksum perhaps

And for the second message: 0x10 0x04 0x01 0x9A 0x00 0x0A 0x00 0x03 0x0E

  • 0x10 0x04 fixed header
  • 0x01 0x9A is the CO2 concentration (410)
  • 0x00 0x0A is TVOC most likely (10)
  • 0x00 0x03 is HCHO most likely (3)
  • 0x0E is ... checksum perhaps

ribbon tweeter for bat audio

Someone gave me this idea: Use a ribbon tweeter like this for playing back bat audio: https://nl.aliexpress.com/item/4000973201791.html https://nl.aliexpress.com/item/1005002565880660.html

The frequency spectrum shows no sign of dropping off at 20 kHz.

3d glasses

I got some 2nd hand 3d glasses, they look exactly like these ones:

The common name appears to be "G15-DLP".

A tear-down here:

Interesting documents:

Someone claims he got something to work with some hacks: https://www.avsforum.com/threads/how-i-got-cheap-dlp-link-glasses-to-work-great.1887145/

Waterniveaumeter

Op verschillende plekken in Gouda staat er water in de kruipruimte van huizen van bewoners. Kunnen we dat meten en inzichtelijk maken, voor bewoners, op een kaart bijvoorbeeld?

Idee:

  • in de kruipruimte plaats je een module die waterhoogte kan meten
  • de module bestaat uit een microcontroller en een afstandsmeter, die de waterhoogte bepaalt
  • de gegevens worden via WiFi doorgestuurd naar een centraal punt, waar de data wordt verwerkt en gevisualiseerd
  • op een webpagina kan je een overzicht zien van alle meters die online zijn
  • de meting wordt gedaan door bijv. een laser-afstandsmeter of een ultrasoon-afstandsmeter
  • voeding? lastig, hoe krijg je 5v naar een potentieel natte plek?
  • kosten? verwachting < E 40,-

In Gouda wordt op veel verschillende plekken de grondwaterstand gemeten, zie https://opendata.munisense.net/portal/wareco-water2/group/581/Gouda-KJ38A , maar:

  • geen visualisatie op de kaart, je ziet alleen de meetlokaties d.m.v. een icoontje!
  • geen meetpunten in Gouda noord!

Online bat detector

Idea: use an ultrasonic microphone, connect it to a WebSDR, so people can tune into bat sounds remotely.

Raspberry pi airplane tracking

Apparently now you can also participate in MLAT tracking of planes that don't transmit GPS coordinates themselves.

APRS gateway

http://qso365.co.uk/2017/02/a-guide-to-setting-up-an-aprs-receive-only-igate-using-a-raspberry-pi-and-an-rtl-sdr-dongle/

JQ6500

Small inexpensive modules that play mp3 from an internal flash. Could be nice for a custom door bell for example.

More info at:

FPGA

Cheap FPGA boards and nice applications:

Neural networks on low-end hardware

Investigate if you can run a powerful neural network on relatively low-end/cheap/low-power hardware. For example a Raspberry pi. A RPI runs Linux, run python, just like some common neural frameworks. Do we need hardware acceleration from the GPU and does the RPI GPU support that?

Read list:

Bought a MaixPy:

mini word clock in dutch

Basically an monochrome 8x8 word clock, in Dutch, showing local time in the Netherlands.

This git repo has the current code.

See here for a demo running on an arduino nano.

The plan is to run this from an ESP8266 instead of an arduino nano, so it can get the time from the internet using NTP. Andreas Spiess demonstrated on youtube how existing libraries on the ESP8266 can be used to do the local time (including summer-time) calculations.

Cypress PSOC5

Play with the Cypress PSOC5 platform, which combines a ARM Cortex-m3 processor with configurable analog blocks. I'm thinking of combining it with a 24 GHz doppler radar sensor, to process the signal and present it as a USB audio device (stereo signal contains I and Q parts). See RadarOnAStick.

Simple Doppler motion sensors

You can find basic doppler microwave motion sensors based on a single transistor, with some weird traces on the PCB very cheaply, for example

Typically the microwave part of these consists of a single transistor with a rectangular area on one leg and a meandering trace (with lots of vias to the other side) on the other leg. The output of this circuit seems to go into a chip very much like the ones used in PIR sensors.

See also https://github.com/jdesbonnet/RCWL-0516 for a reverse engineering effort of these doppler radar modules.

Bare-bones Arduino bat detector

This is an idea for a very basic heterodyne bat detector, doing signal processing on an Arduino, requiring minimal external components.

The basic principle of a heterodyne detector is that it just mixes (multiplies) the audio signal with a square wave, low-pass filters the result and puts it on a speaker.

Multiplying with a square wave can also be considered to be just alternatively inverting and not-inverting the signal. So if you sample an ultrasonic signal at twice the rate you want to multiply, you can just subtract odd samples from even samples and low-pass filter that.

How this can be done in an AVR Arduino:

  • sample the audio signal at twice the detection frequency, say 84 kHz. An AVR should just be able to do that.
  • apply a 1-pole IIR high-pass filter to remove DC bias, this takes one shift instruction and one addition.
  • multiply by the detection frequency, this means just inverting the odd samples.
  • low-pass filter the signal, this can be done using a moving average filter, say 16 samples long (first null at 5.25 kHz). Theoretically, averaging 16 samples should result in two bits extra accuracy. This operation takes some storage, an addition and a subtraction.
  • output the filtered signal using PWM, possibly at the same rate that we are sampling the input audio.

The microphone can be a 40 kHz piezo transducer, to keep it cheap (but also limited to 40 kHz). The pre-amplifier can be a single transistor with some resistors around it, providing about 40x gain. The arduino does the signal processing (mixing, low-pass filter) to shift the bat audio to human range. The speaker amplifier can just be a simple two transistor push-pull circuit, since the output from the Arduino is digital/PWM.

AVR Arduino sample rate

As far as I understand, the ADC clock can be set to 1 MHz. Conversion takes 13 cycles, so this can be a problem to reach a sample rate above 80 kHz.

Indoor radar speed sign

This idea about placing a simple IQ-output radar sensor indoors in the hacker space, do some basic signal processing on the IQ doppler signal and determine movement speed and direction, then display this on a LED display. This is of no immediate practical use other than fun, but helps me to gain a bit more experience with microwave radar sensors and eventually build a more effective setup for detecting/counting bats flying in and out of a roost.

Implement this on a PSOC5 platform or on the STM32 using Arduino.