Bat detector

Hi,

You need to use #SD and #SD1 for the default functionality. #SD2 is something I have planned to add but have not done so yet. Can you tell if both #SD and #SD1 are active what kind of errors you get.
Be aware that I am compiling using a different setup where i program using VisualCode with PlatformIO installed on multiple platforms. PlatformIO has a rather different setup/functionality . Next to that I am also working under linux instead of windows which also can lead to difference when compiling sources.

regards
Cor
 
Hi,
Yes we are agree : it could be very difficult to solve this kind of issue with so different environnements.

I use #define USESD1 wich imply USEDSD in your code. Same issue :
../arduino-1.8.9/hardware/teensy/avr/libraries/uSDFS/src/sdio.c:600: multiple definition of `sdhc_isr'
../arduino-1.8.9/hardware/teensy/avr/libraries/SD/utility/NXP_SDHC.cpp:911: first defined here

We use two library with function, same name in two locations. If you use both, why don"t you have any conflicts?
Regards
Remi
 
Hi,

I havent seen any reference to NXP_SDHC before in previous problems reported. As stated my environment is not the same and I never had issues with double references.

Did you try and compile other demo-code for the teensy that uses the SD card ? Did that compile as planned ? If so you could try starting with the code that DD4WH has made at the start.

regards
Cor

Hi,
Yes we are agree : it could be very difficult to solve this kind of issue with so different environnements.

I use #define USESD1 wich imply USEDSD in your code. Same issue :
../arduino-1.8.9/hardware/teensy/avr/libraries/uSDFS/src/sdio.c:600: multiple definition of `sdhc_isr'
../arduino-1.8.9/hardware/teensy/avr/libraries/SD/utility/NXP_SDHC.cpp:911: first defined here

We use two library with function, same name in two locations. If you use both, why don"t you have any conflicts?
Regards
Remi
 
Hi
We have the same Idea. the first code of this topic compile OK

I try with first "big" version of DD4WH

https://github.com/DD4WH/Teensy-Bat-Detector
https://github.com/DD4WH/Teensy-Bat-Detector/blob/master/DD4WH_Bat_detector_v1_2.ino

I suppress /arduino/library/Sd
to keep /arduino1.8.9/hardware/teensy/avr/..../SD

compile error : multiple definition of `sdhc_isr'

I try some example found into teensy/avr/librairy/sd/examples/ReadWrite.ino ok
../dumpfile.ino ok
/home/remi/arduino-1.8.9/libraries/uSDFS-master/examples/uSDFS_testuSDFS_test.ino ok
../sdhctest/sd.test..ino error due to missing #include "sdhc.h"
/../logger_rawwrite.ino OK

I conclude the last version ( after 2015..) of SD and uSDFS library are no more totaly different
we need both in bat project but they use function with same name...

In your code I'd like to try without SD catrd. I see that Sd is called even if we use only uFSD
Do you think we can use your code without selection of both library?
Could you confirm that we can not totaly remove SD suppport with comment on
//#define USESD1

Audio output and TFT is a good step for me.

many thanks
Remi
 
Hi

I have just updated the code on my github to allow disabling the usage of SD. Only changes in main.cpp have been made.
To disable SD you need to leave the #define USESD1 as it is (do not comment it out !), to disable the SD you need to comment inside
#ifdef USESD1 the #define USESD part only. Be aware that this restricts some functionality

Code:
#define USESD1


// ************************************  SD *****************************
#ifdef USESD1
  //#define USESD
  #include <SD.h>
  #include "ff.h"       // uSDFS lib
  #include "ff_utils.h" // uSDFS lib
  File root;
  FRESULT rc;        /* Result code */
  FATFS fatfs;      /* File system object */
  FIL fil;        /* File object */
#endif


regards
Cor
 
Last edited:
Hello Corbee. Many thanks to try to help witj your fast answer.
it is not ok : the compiling #ifdef is not solving the initial issue : one function in two library. Your modified code still use #include <SD.h> follow by #include "ff.h" .
I change : //#include "ff.h" // uSDFS lib qnd //#include "ff_utils.h" // uSDFS lib
I suppress uSDFS directory
Now I have a more classical error : FRESULT' does not name a type and a lot of other error. May be the issu is more complex.

I'm using your PCB , thus it is not compatible with pinout of DD4WH ( let me know if i'm wrong)

If somebody could add a project compiling under arduino, it could elp

I recently discover one solution : rename sdhc_isr.cpp in sSDFS/stdio.c .... it compile....

Regards
Remi
 
Last edited:
Hi,

The code I have left in the USESD1 section is needed to allow for instance the time-functionality. I have not produced a PCB, thats the product of Edwin (pe1wf) but this is pure hardware and your problem is software related.

Renaming a library is a possibility but has the risk that you want to use the library later on(for another project) and run into trouble again.

regards
Cor
 
Hello Corbee. Many thanks to try to help witj your fast answer.
it is not ok : the compiling #ifdef is not solving the initial issue : one function in two library. Your modified code still use #include <SD.h> follow by #include "ff.h" .
I change : //#include "ff.h" // uSDFS lib qnd //#include "ff_utils.h" // uSDFS lib
I suppress uSDFS directory
Now I have a more classical error : FRESULT' does not name a type and a lot of other error. May be the issu is more complex.

I'm using your PCB , thus it is not compatible with pinout of DD4WH ( let me know if i'm wrong)

If somebody could add a project compiling under arduino, it could elp

I recently discover one solution : rename sdhc_isr.cpp in sSDFS/stdio.c .... it compile....

Regards
Remi

FRESULT is specific to uSDFS
If you do bot use uSDFS then you should also remove also all definitions in the main sketch.
 
Hi,

The sketch uses ff.h and ff_utils.h for instance for the time2seconds function and the suggested solution(dont use SD) for remis compiled just fine on my system but I have the feeling his setup is too different from mine.
Sometime different environments create issues that are not simple. I could also start adding #ifdefs to the parts of the code where time2seconds is used but that is for me too much adaptation of the code.

regards
Cor
 
Hi,

The sketch uses ff.h and ff_utils.h for instance for the time2seconds function and the suggested solution(dont use SD) for remis compiled just fine on my system but I have the feeling his setup is too different from mine.
Sometime different environments create issues that are not simple. I could also start adding #ifdefs to the parts of the code where time2seconds is used but that is for me too much adaptation of the code.

regards
Cor

simply copy tm2seconds to sketch, or use stock time conversions
I created tm2seconds because I did not like the arduino time library, but your mileage may vary.
 
Hello
After few days of work I confirm that it's work with modification on SDHC_ISR function name see #231
It compile and I'm now able to see some spectrum on TFT.
I'm beginning test with generator. I have some chech to performed around transistor amplifier, again.

But I 'dont understand how to select spectrogram visible in Pei1F picture in #191.
I found it in DISPLAY mode 3 possible

I try to record : it start, but impossible to stop if. Same button? SR needed?

I hope it is not a compilation issue effect.

Thanks
 
Last edited:
Hi,

Good to hear that. If you have all buttons installed you can select the "waterfall" by pressing the LEFT microbutton, that allows you to step through the 3 modes of display (spectrum, waterfall, none).
 
Hello
Thank*‘s I found it*! Now I’m trying to record some file. I can start it. I cannot stop it with button.
After so many test, what is the best setup for register file on SD?
May-be the SD must be in FAT32, an only from some supplier*?
Regards
( I'm working on audio hardware and I have some results around Microphone...)
 
ICS40730 spurious

Hello
Is there any body who look ICS40730 output?
First I use home made solution to solders the mic. I use flip chip solution: not very difficult. I add 470nF decoupling capacitor for VCC. Next pictures are output with 3,3V power supply, High Z load. You can see a big spurious at 26Khz in opposite side on both output. saw it on two different parts.
This view is not incompatible with datasheet*: They don‘t talk about, but it is only visible with single ended ouput. With differential ouput, this spurious will be canceled. I’m not totaly surprised*: Hems parts use internal complex system to measure some femto farad changes.
I’m working on AOP differential amplifier.
Remi
 

Attachments

  • micro_solders.png
    micro_solders.png
    622.4 KB · Views: 157
  • MIC_noiseOutput.png
    MIC_noiseOutput.png
    50.6 KB · Views: 122
  • ouputMIC.png
    ouputMIC.png
    26.1 KB · Views: 112
Hi Remis,

we use the ICS40730 as a standard ultrasound microphone for our semiprofessional bat recorders (in single ended mode !):

* it has a sensational frequency response up to 160kHz
* it has the highest SNR I have ever seen in a MEMS mic
* its cheap
* its big enough to solder by hand

I have never seen such strange peaks as your picture shows. Maybe it is connected to your measurement setup?

I am not sure whether it is worth to build a differential amp in order to use the differential mode. The SNR will not improve, only the sensitivity will rise by 6dB. The ICS40730 has plenty enough sensitivity for bat work, so I do not think its worth it, but your mileage may vary.

BTW: the datasheet says: "The unused output pin should be left disconnected when the mic is used in single-ended mode; do not connect the unused pin to ground." From your photograph it seems you did NOT leave the unused output pin disconnected, maybe that is the cause for your strange peaks in the spectrum???
 
Hello.
My picture is not detailed: I use 2 wire for two outputs. I let the unused output open. I confirm my diagnosis , even with battery ( 2 cells ) , also in Bat detector with FFT Thus no issue with my power supply or my osciloscope or my setup.
 
Well, that is odd.

How would you explain that we use the ICS40730 in many devices with great sucess and in your setup the output is not clean?

I am not sure what you mean with two outputs? The ICS 40730 has only one output signal.

And in your picture there is indeed a wire soldered to the unused output.

As the datasheet states: "The unused output pin should be left disconnected when the mic is used in single-ended mode; do not connect the unused pin to ground."

I would recommend to leave the unused output pin disconnected, i.e. there is nothing connected, not even a wire (which could potentially collect noise).

How long are your wires? And did you measure the output of the MIC directly, or after amplification by an external amp, or even after feeding it to the Teensys´ ADC?

ICS40730 with Teensy Recorder DD4WH 2019_06_19.jpg
This is a recording at a sample rate of 500ksps with the ICS40730 and the Teensy Recorder designed by Jean-Do. Vrignault (https://framagit.org/PiBatRecorderPojects/TeensyRecorders/tree/master/PassiveRecorder) with a modified preamp and ultrasound (20,40,60,80,100,120,140,160 kHz) generated by the BatPlayer designed by Jean-Do (https://framagit.org/PiBatRecorderPojects/bat-player). The noise level of the whole system [ICS40730, analog preamp, internal ADC of the Teensy] that can be determined in the recording with Audacity is about -63dBFS.
The sound at 20kHz suffers from ADC overload. Some artefacts can be seen which are caused by 1.) the power supply of the BatPlayer and 2.) the Teensy internal ADC reference voltage which is drawn low by the immense power drain caused by the writing to the SD card
 
Last edited:
ICS40730 spurious

First, thanks to spend some time on this so obvious issue…
“How would you explain that we use the ICS40730 in many devices with great sucess and in your setup the output is not clean?” Very good question. My issue is there. I read also your interesting report, and datasheet ICS40730.

I repeat about my minimal setup : first I try without any wire ( except VCC) …without any amplifier, with probe oscilloscope directly on output pin ( done before the picture) and battery or externa VCC power

“I am not sure what you mean with two outputs? The ICS 40730 has only one output signal”. No: In datasheet ICS-40730 we talk about differential output
http://www.invensense.com/wp-content/uploads/2018/12/DS-000139-ICS-40730-v1.0.pdf
first page I see two output: “OUTPUT+’’ and “OUTPUT-“ and “a differential output amplifier”. See Pinout.
During my first test, to look at only one output I apply this : “The unused output pin should be left disconnected when the mic is used in single-ended mode; do not connect the unused pin to ground.”
The flex demo board confirm pinout.
https://www.invensense.com/wp-content/uploads/2017/06/AN-000012-v1.3.pdf

reading the ICS40720 ( 20 not30) datasheet I see a curve wich is no more visible in datasheet 730. Pic sensitivity at.....26Khz. In a MEMS , usually the notch or pic sensitivity are realtive to engin excitment, or probe resonnance... I will try with other parts.
 

Attachments

  • ICS40720pic.png
    ICS40720pic.png
    44.5 KB · Views: 199
Last edited:
I initially thought you were looking for people reporting about their experience with the ICS40730. Thats what I did.

Is there any body who look ICS40730 output?

I can highly recommend the ICS40730 which has proved to be of excellent performance in our setup for a bat detector. But I am not advertising any mic, you can use whatever you want for your purpose.

I will try with other parts

Good luck !

P.S.: a differential output also outputs only one signal, not two. However, a differential signal does not have a reference to GND, wheras in single ended mode the signal has a reference to GND. Maybe you forgot to connect GND in single ended mode ?
 
Last edited:
Hi. I am a complete newbie to this forum and to Teensy. I am OK with electronics and have several years experience with Arduino. I am building the Teensy 3.6 Bat detector V0.1 20180814 having bought the PCB and microphone via Ebay. I am attempting to compile the code published in Post #159 of this thread by Corbee as instructed in the pdf published by Edwin PE1PWF (https://drive.google.com/file/d/1Uu2kTnleLcJJ1JrEzeiRPV7JJSGXqBRW/view). I am using Arduino IDE 1.8.9 under Windows. I can't find a library ff_utils.h defined at the beginning of the code line 115. Its not in my standard Arduino Install Library list. Its not in my Arduino/hardware/AVR/Library folder which I understand is a supplementary set of libraries specifically for Teensy 3.6. I have read through most of the postings and it appears to pop up commented [/B]//uSDFS lib[/B] but I have searched this library as well and can't find any reference to it. I am probably missing something completely obvious. If someone can point me at a source for this library then I can install it and try and get a stage further. I apologise if I have committed any faux pas but I am new to this forum business as well.
 
Bat detector and Arduino

Hi,
You are lucky. I begann this project with arduino 1.8.9 two weeks ago. Please read all my post. You will be able to compile under arduino and teensee. Follow the special modifications in library describes here by Edwin
https://drive.google.com/file/d/1Uu2kTnleLcJJ1JrEzeiRPV7JJSGXqBRW/view
use the last code of Corbee in this forum
Add my modification in stdio.c to remove last compilation error
The only issue is the SD card...start but not stop...and freeze program.
Regards
 
Hi,
You are lucky. I begann this project with arduino 1.8.9 two weeks ago. Please read all my post. You will be able to compile under arduino and teensee. Follow the special modifications in library describes here by Edwin
https://drive.google.com/file/d/1Uu2kTnleLcJJ1JrEzeiRPV7JJSGXqBRW/view
use the last code of Corbee in this forum
Add my modification in stdio.c to remove last compilation error
The only issue is the SD card...start but not stop...and freeze program.
Regards

Hi. Thank you. I have downloaded all the modified libraries listed in Edwin's document. I will search for Corbees last posted code and download all your posts and study them. also your mod to stdio.c. Long night ahead!! Many many thanks again.
 
Hello
Thank*‘s I found it*! Now I’m trying to record some file. I can start it. I cannot stop it with button.
After so many test, what is the best setup for register file on SD?
May-be the SD must be in FAT32, an only from some supplier*?
Regards
( I'm working on audio hardware and I have some results around Microphone...)

The SD should be from a good type, I think Frank DD4WH has even tested the effect of lesser quality SDcards. I am using a toshiba Exceria 16Gb that works as planned.
 
Hello Corbee
Ok for toshiba Exceria 16Gb. I will try in AUTO_TE mode, with SR=44Khz. If not ok I need to work more on my code modification ( rename sdhc_isr.cpp in sSDFS/stdio.c to compile under arduino)
Regards.
 
Be aware that recording will switch to heterodyne mode as we cannot heavily process the incoming raw data at the same time. And using SR 44Khz will not record bats as you can guess
 
Back
Top