Philips EE & Picaxe: a happy marriage between old & new, sustainable for the future ...

kranenborg

Senior Member
Dear Picaxe Colleagues,

At some instances I have indicated that I still use my childhood's Philips EE (Electronic Engineer) set of kits (https://ee.old.no/) to prototype most of my projects, including the Picaxe-based ones. I know now that these kits have been very popular in Great Britain as well, in particular the EE1003/4/5/ from the EE1000 series, as well as earlier series like the EE20, EE10, A8 etc. . This all plays in the sixties and seventies, as is clear from for example the following link: https://www.vintage-radio.net/forum/showthread.php?t=63719 . It seems to me that from the EE2000 series on the availability in GB was less compared to mainland Europe (and I doubt whether English manuals were made available). To me the use of these kits combines nostalgia & inquiries into electronics and technology in an almost magical and very satisfactory way … .

I recently embarked on a project to 'Picaxify" my Philips EE set-up, thereby allowing me to use modern microcontroller-based projects on the Philips EE system with equal ease as compared to other (analog) EE projects. The Picaxe concept supports my projects wonderfully, through functions like PWM generation, frequency measurement, simple controls based on analog signals inputs etc. etc., all through rapid prototyping (but that is still the strength of the Picaxe approach).

I wonder then if there are more Picaxe enthusiasts on this forum that are Philips EE adepts as well. If so, I may provide some inspiration in this thread by giving examples on my upgrade project on the key part, namely the front plane of the EE1000 system. The concept is still similar to the EE1000 series, but I developed my own general-purpose base plate and an application-specific overlay to it, allowing the AXE133/133Y display and other modern components to be integrated. Furthermore, the availability of color inkjet printers does wonders … .

The picture below shows the new front plane, made specially for a bat detector project (close to finalization) in which a Picaxe-08M2 is used to generate a PWM signal between 20 - 120 kHz as input to a mixer. The actual frequency is to be shown on the display.

Front3LCDsmall.jpg

The AXE133 LCD is used here as intended by Rev-Ed, namely as a serial display. However, with a slight change of the display hardware setup as discussed here [https://picaxeforum.co.uk/threads/improving-the-axe133-oled-firmware.29710/post-339628] using a 4-bit interface, the picaxe-18M2 on the display board can used as a general purpose controller itself applicable in the project whilst also controlling the display.

Here is a view from a larger angle vertically, revealing a bit more of the circuit board (and the sometimes ancient types of components like the mustard capacitors and the tube capacitors that came with the kits, as well as the Picaxe-08M2 seated on the green board)

Front3LCD_backtop-small.jpg

And of course here is the magical transformation depiction itself … :

Philips EE EE20 oldstyle - 2 - small.png

In case someone wants to know more (and/or even do a similar Picaxe upgrade him/herself on the Philips EE system) then I am of course most happy to provide relevant info on my designs and experiences.

Best regards
Jurjen
 

Attachments

Last edited:

tmfkam

Senior Member
If only I had been able to get hold of (and afford to buy) something like that. It's superb, I'm truly jealous.
 

Dartmoor

Member
I recall having a set from about age 8. Probably still have a few parts left now, 50 years later. I learnt a lot from it (probably started me towards HNC electronics).
Perhaps 'Blockly' is in a way the modern equivalent?
 

bogbean

Active member
I didn't have one of those EE sets but I am interested to hear how your bat detector is going...
I recently built the bat detector circuit given here: https://www.nutsvolts.com/magazine/article/june2011_berber
I think it is working well but after spending an hour out in the cold the other night doing some unsuccessful bat detecting I've since read that bats near me will still be in hibernation for a few more weeks yet! So far I've only detected ultrasound from a piezo driven by a function generator.

The oscillator in the nutsnvolts circuit gives a squar-ish wave from a LM324N op amp. I hadn't thought to use a picaxe for the oscillator but it would be interesting to compare the detecting performance using a picaxe instead; and I like the idea of a digital frequency readout.
 

hippy

Technical Support
Staff member
I recall having a set from about age 8. Probably still have a few parts left now, 50 years later. I learnt a lot from it (probably started me towards HNC electronics).
Perhaps 'Blockly' is in a way the modern equivalent?
An EE kit is what started me on my path to where I now am.

The more modern equivalent of the EE kits would probably be the "150-in-1 Project Lab" and similar from Science Fair and others. There were numerous different types of those covering radio, analogue to digital -


"Snap Circuits" from Elenco included an 8-pin PICAXE module -

 

kranenborg

Senior Member
I recall having a set from about age 8. Probably still have a few parts left now, 50 years later. ...
In case one would like to modernize & "picaxify" the set in a similar way as I did, then I think there is the following bare minimum list of original Philips EE parts one would need (in descending order of complexity for making it yourself):
  • The two metal brackets for the panel: to be dug-up from the attic after 50 years :D or scavenged (Ebay etc. ?) & cleaned (they do corrode significantly but can be turned into a quite shiny state again by polishing) from an old/used EE1003/EE1010 set.
  • The mounting plate for the components: likewise approach (but should be feasible to be made from plywood)
  • The springs for mounting components: likewise approach (but they are still being produced - not by Philips b.t.w.: https://www.winklerschulbedarf.com/de/i/klemmfedern-25-stk-pkg-100394 (formally they ship only within Germany, so one needs a shipping service from Germany to the home country - Such a service exists for NL as I have used it myself, I do not know about such a set up for GB or other countries)
  • The small boards containing transistors etc.: to be scavenged as well, but there are PCB-companies to make this anew
The front panel, overlay and components on/in it (knobs, loudspeaker raster, etc) that I have used are all new and do not originate from the EE set and are made of different materials. The front panel could be easily made from plywood, for the overlay I have used "passe-partout" material (for making photo collages) as this looks very nice with several color/patterning options and allows cutting into shape easily. Both materials are relatively cheap.

I am going to publish on these practical matters on my Philips EE website as there is a certain interest for my front panel upgrade from some hard-core Philips EE - fanatics (as I am) in Germany (which was by far the biggest market for this system, although NL was considerable too): . Some time investment is needed for building this (I started in Christmas holiday), but I am very happy and satisfied with the result as a future-proof upgrade and Picaxe breadboard system. I will publish my front panel design as part of the endeavor.

/Jurjen
 
Last edited:

kranenborg

Senior Member
I didn't have one of those EE sets but I am interested to hear how your bat detector is going...
...
I hadn't thought to use a picaxe for the oscillator but it would be interesting to compare the detecting performance using a picaxe instead; and I like the idea of a digital frequency readout.
Still some testing & tweaking to do this weekend (and consequential updates), but here is the circuit currently implemented. It is based on a SA612A mixer IC (admittedly not a Philips EE component). The frequency input (20kHz - 120kHz) is generated by a Picaxe-08M2 (an extension of the following PWM generator: link) , the PWM frequency is set by a potmeter.

BertriK-V3-PicaxeFREQ.JPG

The PWM signal at leg 5 is first fed through a filter (to "shave off" the harmonics) before it is fed to the mixer. The audio stage is based on a more modern BTL audio driver (TDA7052A), but any standard audio part like LM386 or even discrete end stage will do fine. The input stage is a high-gain three-stage amplifier (too much gain it seems now, some tweaking necessary). In the actual circuit I am testing two different sound receptors: either a 40kHz ultrasonic transducer (that comes with the EE2016, but easily available at a component shop) with a range of approx 30kHz - 50kHz or a MEMS-Microphone (SPU0410LR5H-QB) with a range of 20kHz - 80kHz or more, the latter on a easy-to-handle board: Ultrasonic Mic Board.
(B.t.w., the circuit design is not entirely mine, see here).

A different set-up is also possible (using the LM3900 quad opamp - one of the oldest quad opamps ever but still in production in PDIP-package, and the central component of the EE2001 series) based on an ultrasonic receiver design from the Philips EE2016 kit: EE2016-ultrasonic-converter-revisited-and-improved-heterodyne-bat-detector . One evening just after sunset I recorded the following bat signal with it: recorded bat sound (40kHz ultrasonic transducer)

/Jurjen
 
Last edited:

kranenborg

Senior Member
...
I hadn't thought to use a picaxe for the oscillator ...
During my swimming chores this week I got some inspiration :cool: on how the presence of an intelligent device like a Picaxe-08M2 could be used for more than just generating a single PWM signal with the frequency knob ... . Since bats operate at a range of frequencies (roughly 20 - 100kHz, see here) one would like to continuously alternate between at least two rather different frequencies in an automated way, to see "what is going on in the air". So, by adding a simple push-button one could implement a simple state machine as follows:
  • State 0: At power-up: behaviour as usual, i.e. PWM listening frequency set through the frequency knob/dial
  • First push -> State 1: Move to a state where the higher frequency can be specified (through the knob)
  • Second push -> State 2: Store the higher frequency, specify the second, lower frequency, again through the knob
  • Third push -> State 3 and 4: Store the lower frequency & start alternating between the two frequencies. The knob could now get a different function: to change the alternation speed (left: minimum of say 2 secs, upper right: indefinite at the current frequency (low or high) to keep on listening)
  • Last push -> Return to "normal" (State 0), knob becomes the ordinary frequency selector again
This should not be hard to implement, and may quite improve the usability of the device. The Picaxe-08M2 could even feature an extra line to the audio stage of the detector to give a short low or high beep when alternating between the low and high frequency, to give an audible indication which one becomes active ... .
This can be implemented independent of how the actual analog implementation of the bat detector is done.

Now back to optimizing the analog detector circuit itself ... , more to come. But the basic program for the frequency generation and LCD info is ready now (attached)

/Jurjen
 

Attachments

Last edited:

hippy

Technical Support
Staff member
This should not be hard to implement, and may quite improve the usability of the device.
This is probably the main reason things have moved towards digital electronics and microcontrollers over the years. Yes, there are plenty of cases where an analogue solution is necessary or the best choice, but microcontrollers like the PICAXE can do things which would otherwise require a whole stack of components to implement. It is simpler, easier and cheaper to use a microcontroller, allows projects to have capabilities which would otherwise be infeasible for most people.
 

bogbean

Active member
Thank you for posting your circuit and code Jurjen!
My LM324 circuit was sufferring from the oscillator dropping off much above 60 kHz and it would be good to have a detector able to hear some of the bats around 100kHz, even if they are rare ones I may never find near me. I think the op amp circuit did not really serve as a proper mixer. I've put in a parts order to get hold of the mixer, audio amp and 47mH inductor and then I'll build a replica, you've drummed up some business for Philips parts. I spotted that you have 2 of 'C6' in your schematic by the way.

What a great word fledermaus is. I will use it in preference to 'bat'. Does it literally translate to english as 'flutter mouse'?

I'm interested if you have any success with the MEMS microphone or have a recommendation for a simple piezo transducer. I have moved to using one of the typical ultrasound piezo 'metal can' types and it does seem to respond better at 40kHz than the flat piezo I previously tired. I ought to buy a transducer with a published datasheet though so I have an idea of the frequency response range.
 
Last edited:

kranenborg

Senior Member
Thank you for posting your circuit and code Jurjen!
My LM324 circuit was sufferring from the oscillator dropping off much above 60 kHz.
Thanks for your kind words! The PWM signal is derived through division from the main PICAXE clock at a much higher speed, with the large range (factor 6) as a nice consequence.
I've put in a parts order to get hold of the mixer, audio amp and 47mH inductor and then I'll build a replica ...
Although the SA612A is not made in DIP package anymore, Philips still produces it in SO-8, which should be in reach for most to solder. The TDA7052A is generally only available in hobby shops (if they have them at all), but then there are other, more common audio stage options.
Note that this is not the final circuit, some updates are needed in the first transitorized amplifier stage, I will try to update that this weekend and publish.
What a great word fledermaus is. I will use it in preference to 'bat'. Does it literally translate to english as 'flutter mouse'?
I must admit that I do not know for sure. I am from The Netherlands, the word is German (in Dutch: "vleermuis")
I'm interested if you have any success with the MEMS microphone or have a recommendation for a simple piezo transducer. I have moved to using one of the typical ultrasound piezo 'metal can' types and it does seem to respond better at 40kHz than the flat piezo I previously tired. I ought to buy a transducer with a published datasheet though so I have an idea of the frequency response range.
I can confirm that the ultrasound metal can types perform very well. The only drawback is that they work in a quite limited frequency range, effectively around 35 - 45 kHz, see the following diagram. My first results with the MEMS version are good regarding sensitivity over a much wider range (at least 80kHz), but at quite some selected frequencies one hears some irregular sounds (which disappear when the device is decoupled), I will check with another sample that I have whether there is an issue with the first one.

/Jurjen
 
Last edited:

kranenborg

Senior Member
Here is the final schematic of the bat receiver:
  • The 3-transistor input stage has been optimized and tested, the first two stages are identical. The transistors T1, T2 and T3 should be low-noise types, like BC549C/BC550C.
  • R7 in the new scheme (in the supply line towards the TDA7052A amplifier) has been lowered from 100 Ohm to 10 Ohm.
  • It is indicated that the input is designed for a MEMS-microphone. One might want to use a high impedance FET stage instead of the T1 stage for passive, high-impedance devices like a ultrasonic 40kHz or Piezo element, to avoid loading them too much. (checked this with a 40kHz canned ultrasound receiver and a FET stage (BF245A), but very similar performance, so no advantage here)
  • Added are the mode switch and the "beep" sound line to the audio amplifier (see post #8). R24 needs to have a high value in order for the beep to remain soft even at maximum listening audio setting.
  • The schematic below has been updated a few times to incorporate all new findings later on in this thread. Please note that other audio circuits are possible than the one with the hard-to-get TDA7052A (although I really like that one), no hard requirements.


/Jurjen
 
Last edited:

kranenborg

Senior Member
Here follows the tested code that implements the options as indicated in post #8, allowing to switch between normal mode (where the tuning dial is used to set the listening frequency) and alternating mode (for listening in on two fixed frequencies) - the latter shown by the display message.

The program implements a simple state machine. Switching between states (post #8) happens during interrupts (States 0 to 3 - when the button is pushed) or in the main loop during alternation (States 3 and 4). When changing between states, different sounds are generated (which themselves depend on the state entered) , so a LCD/OLED display is not strictly necessary.

Now there is approx. one month left before the bats wake up from hibernation!

/Jurjen
 

Attachments

Last edited:

bogbean

Active member
I've built your circuit Jurjen (apart from S1 and the LCD module) and it's working well for me too, both with a metal can piezo mic and the MEMS mic although I agree the MEMS mic seems to respond better across the full 20kHz - 120kHz frequency range. I got the same MEMS mic module as you from mic booster.com but I also got the bare mic and had a go at soldering to it inspired by instructions here: https://skillbank.co.uk/bat_detectors/afd4.html. I managed to get it working but my assembly isn't pretty enough to post a picture of here. Despite the datasheet saying all 4 ground pins needed to be connected I found it worked with only one ground soldered.

I have a SSD1306 OLED module so I will try to display the frequency using that.

I was worried about putting 5V on the MEMS mic so used a 22k / 33k resistor divider to bring the supply down to 3V for it.

I'm excited now for the bats to come back to the garden and try the circuit out for real.
 

kranenborg

Senior Member
I've built your circuit Jurjen (apart from S1 and the LCD module) and it's working well for me too, both with a metal can piezo mic and the MEMS mic although I agree the MEMS mic seems to respond better across the full 20kHz - 120kHz frequency range.
Nice! Which circuit did you implement, the final one (post #12) I presume? It would likely be relatively easy to add the remaining parts of the circuit (the switch, the audio "beep" line and indeed the display). The frequency alternation appears to work really well.

I got the same MEMS mic module as you from mic booster.com but I also got the bare mic and had a go at soldering to it inspired by instructions here: https://skillbank.co.uk/bat_detectors/afd4.html. I managed to get it working but my assembly isn't pretty enough to post a picture of here. Despite the datasheet saying all 4 ground pins needed to be connected I found it worked with only one ground soldered.
With the mems mic I tend to hear some irregular sounds at some of the selected frequencies (not heard when disconnecting the mic, or with the 40kHz can), does something similar happen with your device (even at night, when solar power induced noise should be absent) or is it just me? It could be the mic itself, or something like a grounding issue in my implementation ... .

I have a SSD1306 OLED module so I will try to display the frequency using that.
I have one too, I would be interest in your code example!

BTW: if one does not have an LCD/OLED, an alternative solution could be a simple LED output to indicate the different states in combination with a dial layout with a combined frequency + interval time depiction.

I was worried about putting 5V on the MEMS mic so used a 22k / 33k resistor divider to bring the supply down to 3V for it.
That seems like a good solution. In my circuit I applied R25 = 15K which works too, since I then measure 3.0V at the microphone's supply terminal.

I'm excited now for the bats to come back to the garden and try the circuit out for real.
Yep, me too. And since the current circuit is working well, my next step is to get it on a PCB and in a nice wooden box with the help of a friend.

BR,
Jurjen
 
Last edited:

bogbean

Active member
Nice! Which circuit did you implement, the final one (post #12) I presume? It would likely be relatively easy to add the remaining parts of the circuit (the switch, the audio "beep" line and indeed the display). The frequency alternation appears to work really well.
I implemented the circuit from post#12 but with my alteration of the voltage divider for the mems mic Vdd. I am also using an AXE029 breadboard adaptor so I can update the picaxe programme easily. To upload I have to temporarily remove the link pulling physical pin 2 to ground.

With the mems mic I tend to hear some irregular sounds at some of the selected frequencies (not heard when disconnecting the mic, or with the 40kHz can), does something similar happen with your device (even at night, when solar power induced noise should be absent) or is it just me? It could be the mic itself, or something like a grounding issue in my implementation ... .
I have the circuit on a breadboard at the moment and apart from a white noise hiss I don't hear any irregular sounds when I've moved down the garden aware from interference sources, and that is across the full range of the picaxe-generated oscillator. I pick up various interferences when I'm working on it in my shed, including a kind of theremin effect from my body near any of the wiring. I also pick up that mobile phone interference I remember was common in the early 2000s. Any knocks to the biasing resistors on the transistors generate noise but I think that's to be expected on a breadboard. I did notice that with the metal can mic (only) I was sometimes picking up BBC 5 live, a radio station here in the UK. If you can describe any specific conditions that cause the irregular noise I can try to recreate the effect here.

When I have some OLED code I'll share it with you. I've not used one before but I went for the OLED module as they are so cheap and I'd like to make a few detectors to give away to friends / family. It may take me a while to implement.

I agree a PCB will eventually be a good idea, I don't fancy attempting a stripboard layout.
 

kranenborg

Senior Member
...
I have the circuit on a breadboard at the moment and apart from a white noise hiss I don't hear any irregular sounds when I've moved down the garden aware from interference sources, and that is across the full range of the picaxe-generated oscillator.
Thanks for the update. I checked with another MEMS mic which showed the same behavior, so likely there is some irregular disturbance in my environment. Given your report this should not be a problem.

I implemented the circuit from post#12 ...
Yesterday I noted an important omission in the circuit, namely the 100nf stabilization capacitor for the MEMS mic supply line, as shown below (and also indicated in the mic's datasheet). I added it to the circuit in post #12 as well. It significantly increases the sensitivity (and thereby adds some white noise too ...)

/Jurjen
InkedBertrik-V4-PicaxeFREQ-CapDetail_LI.jpg
 
Last edited:

bogbean

Active member
Yesterday I noted an important omission in the circuit, namely the 100nf stabilization capacitor for the MEMS mic supply line, as shown below (and also indicated in the mic's datasheet). I added it to the circuit in post #12 as well. It significantly increases the sensitivity (and thereby adds some white noise too ...)
Yes well spotted. I have not tried the circuit with the capacitor in place yet, it will be interesting to have even more gain!

I have been working on building into your code an OLED driving routine based on an extension (e.g. to add the characters k,H & z) of the Temperature v.3.bas in post#7 of this thread: https://picaxeforum.co.uk/threads/full-ascii-character-font-for-ssd1306-with-08m2-and-above.32003/#post-336939/

But using an 08M2 we have a conflict of pin C.2 needing to perform pwm and hi2c sda. :(
I suppose a 14M2 could be used to overcome this conflict, or the i2c output could be bit banged. I have no experience of that and feel daunted about trying but I found this thread that may help... (https://picaxeforum.co.uk/threads/bit-bang-i2c-on-08m.19213/)

LATER EDIT: the i2c output can indeed be bit banged using hippy's routines (mast08-2.txt) but for us with C.4 needed for ADC and C.2 needed for pwm I don't think that leaves a pair of pins that can be tri-stated as is needed. I did get the bit-banged i2c routine running with C.1 used for SDA and C.0 used for SCL (and replacing the 'Input SCL' statements in mast08-2.txt with 'High SCL'). I'm new to i2c but from what I've googled I think this leaves the routine not robust to receiving the ACK from the slave device so probably not a good idea although it did work using my OLED as the slave (to send the ACKs) and decoding the i2c packets on a scope.
I've been weighing up what I think are the options:
  • Integrate your bat detector code with OLED driving code snippets and the bit-banged i2c routines in an 08M2: quite a lot to do there and I'm not sure I could get it working reliably
  • Buy a 14M2 and use the built in hi2cout command.
I feel using a 14M2 would be the better option.
 
Last edited:

bogbean

Active member
I have made progress in combining you code in post #8 with OLED routines from the following sources (to whom I also owe thanks for generously posting their code):
I stepped up to using a 14M2 to make use of the i2c, pwm and ADC capabilities running together and it works well but I have been unable to implement the additional frequency-hopping functionality described in your post #13 because I have run out of working variables.

One little tweak I made in the code was to implement a small deadband in the code that checks for a new ADC value from the pot, I found I could not quite reach 120kHz without it. I also implemented a quadruple-height double-width character display based on hippy's routine in post #27 of the ssd1306-oled-screen-help thread. I re-mapped several of your variables when combining your code with the OLED code. I've attached a variable map I used to keep track of the mapping. I have posted my currently-used code here in case it is of interest to anybody.

I hope to have another go at implementing your full functionality if I can work out a way of saving the variables I need or making use of the upper ram. But for now I'm pleased to have the OLED working and I'm looking forward to hearing my first bats with it, hopefully in the next couple of months!

Code:
Variable map combining bat detector and OLED driving

;w0
;b0        For top (1st row) of quad height working char
;b1        For 2nd row of quad height working char
;w1          
;b2        For 3rd row of quad height working char
;b3        For bottom (4th) row of quad height working char
;w2              
;b4        char
;b5        i    ; used as index in for loops
;w3
;b6        ndx    ; used as counter in string lookups
;b7        period8            ### was b6
;w4        Frequency        tableAdr
;b8        w4                b1 of tableAdr
;b9        w4                b2 of tableAdr
;w5
;b10    NewPotADCvalue    ### was b0
;b11    PotADCvalue        ### was b1
;w6        FreqKHz_x5        ### was w1
;b12    w6                ###    was w1
;b13    w6                ###    was w1
;w7        dutyCycle        ### was w2
;b14    w7                 ### was w2
;b15    w7                 ### was w2  
;w8        Frequency        ### was w4
;b16    w8                ### was w4          
;b17    w8                ### was w4          
;w9
;b18    units in oled routine        ### was b16
;b19    tens in oled routine        ### was b17
;w10  
;b20    hundreds in oled routine    ### was b18
;b21    thous in oled routine        ###    was b19
;w11  
;b22    ten thous in oled routine;    also used as intermediate variable in frequency change calc
;b23    used as counter in ClearDisplay. could be saved
;w12    tableAdr
;b24    used by w12
;b25    used by w12
;w13
;b26    OLED: row
;b27    OLED: col

Byte 28: start of upper RAM
B28        used for character manipulation
B29        used for character manipulation
B30        used for character manipulation
B31        used for character manipulation
SSD1315progressSmall.jpg
 

Attachments

kranenborg

Senior Member
Hi Bogbean,
Thanks for the information and I am really grateful for the code with the display driver: this will allow me to use small displays in my projects whilst still providing readable text for eyes of any age ... .
Do I get it right then from the picture that your published code works in practice for you for a larger 128x64 OLED display? Should it work then on a SSD1306 directly as well (that is the one I have instead of the SSD1315)?

One and a half weeks ago I tested my detector as depicted in practice as the first bats became visible after sunset around my house. Their signals were picked up very clearly and loudly; the audio volume is definitely more than sufficient to entertain a group of people seated around a table, so I am thinking of a tabletop-type of design for the final wooden box implementation. To be continued ...
 
Last edited:

bogbean

Active member
Hi Jurjen,
Yes I confirm mine is a 128x64 OLED. What I ordered (eBay) was a SSD1306 OLED but the unit that arrived has SSD1315 printed on the foil packaging label and I believe that over the eBay ad. I think to know for sure I'd need to break the glass screen to see the chip underneath! I don't know enough to say for sure if my code will work for your SSD1306 unit but my code is based heavily on that from 14OLED_128x32.bas in post # 36 of thread https://picaxeforum.co.uk/threads/ssd1306-oled-screen-help.30783/ and that code has comments that suggests it works on a SSD1306 OLED (but a 128x32 one). If it is of any help my OLED has GM009605 printed on the back and I have attached a picture.

I'm glad your unit is working well and you have bats around.

I need to examine my circuit on the breadboard because my audio is fine with headphones but quiet with an 8 Ohm speaker. Could you tell me what voltage you achieve at Vdd of the mems mic? I'm using the SPU0410LR5H-QB and I biased mine for 3V but when I plug in the mic this voltage drops from 2.95V to 1.49V, which I don't understand. Editied as you've already told me you achieve 3V! I will try your mic supply arrangement.
OLED.jpg
 
Last edited:

kranenborg

Senior Member
I'm glad your unit is working well and you have bats around.

I need to examine my circuit on the breadboard because my audio is fine with headphones but quiet with an 8 Ohm speaker. Could you tell me what voltage you achieve at Vdd of the mems mic? I'm using the SPU0410LR5H-QB and I biased mine for 3V but when I plug in the mic this voltage drops from 2.95V to 1.49V, which I don't understand. Edited: as you've already told me you achieve 3V! I will try your mic supply arrangement.
View attachment 25334
Indeed, in your setup of the mic connection the current draw of the microphone would quickly bring down its supply voltage level to a too low level. Furthermore, the 33K resistor to ground would dampen the signal unnecessarily.

A question remains regarding the audio stage: Do you use exactly the same amplifier chip version, i.e. the TDA7052A? There exist several variants (TDA7052, TDA7052A - used here, TDA7052B) with different functions/pinouts. From the datasheet it seems that the TDA7052A does might support headphone use (single-ended, so not BTL-connected, but I do not think the chips is intended for that), but with a 8-Ohm speaker tied in the BTL-fashion (see the circuit diagram) you should really get some volume (and background noise), as I can confirm.

/Jurjen
 
Last edited:

bogbean

Active member
I kept a lookout this evening and saw some bats around so raced off to the shed to try the detector: I'm pleased to report I can hear them too! After a few minutes of use the circuit jumped to being much louder and has stayed that way so perhaps I had a loose breadboard connection. I confirm I can now hear bats very clearly using a speaker and in fact if I use headphones I have to turn the volume down very low. I am also using the TDA7052A.

Since that breakthrough I've also changed my mic Vdd supply and by removing the pulldown resistor and I get a better supply voltage now.

I do have some background noise:
  • a very quiet background hiss that is ok
  • some tones that appear and rapidly change frequency if I move the speaker position relative to the breadboard position
  • a 'sawing' noise that appears as I move my hand near the breadboard
  • some hiss/buzz that only occurs with the OLED connected and is significantly reduced by a 330uF (or greater) capacitor between OLED GND and VDD
I think the tones and 'saw' sound may result from breadboard capacitance / inductance, I'll see if they go away with a PCB.

Thanks for making your circuit available and your encouragement, it was a real joy to hear the bats this evening.
 

kranenborg

Senior Member
Cool!

Your report is now very much in line with what I experienced, providing confidence in having a stable, reproducible design, thanks for that.

Since the circuit is based on the approach of mixing two ultrasonic frequencies to an audible one, and the circuit has considerable amplification in all of these areas, I can imagine that the amount of audible noise sources is much higher as a consequence, as we both noticed. Maybe indeed the breadboard design and some EM-shielding within the box containing the circuit might help a bit. Still, the sound of the bats was much louder than the background noises so these do not pose a practical problem.

I will now proceed with my PCB board design (a stripboard one, actually, I have no experience in PCB-board design myself) and publish on this as well as soon as I have built it and performed some first tests.

/Jurjen
 

bogbean

Active member
I'd be very interested to see your stripboard design, do you use pebble to lay it out?

I have actually designed a pcb in Kicad for the bat detector, to try to make it compact (I'm quite a noob and my brain can only cope with connections in rows and columns so my stripboards tend to be inefficently laid out). I have nearly populated it and will report how it works. On the pcb I have an area (intended to be cut away) containing the recommended footprint for soldering a mems mic to since the mics are cheaper to buy at component level. I soldered it in a frying pan of sand over a gas stove and it worked well, actually easier than the 'dead bug' soldering style I tried before. I made a few (hopefully patchable) mistakes on the pcb but will probably produce a revised board and make that available.
 
Last edited:

bogbean

Active member
I have some bat detector progress to report:

Using the SSD1315 OLED caused an annoying cicada buzz that could not be 100% removed even with a 1000uF decoupling capacitor. I think many people have had trouble with this in audio projects where an OLED is used.
I had no success with all the suggestions in reply #11 of this forum: https://www.eevblog.com/forum/projects/oled-audible-noise/
But disabling the SSD1315 charge pump immediately stopped the problem, achieved by commenting out the following OLED initialisation lines of the code attached to my post #19 of this thread:
Code:
hi2cout (0, CHARGEPUMP)
hi2cout (0, 0x14)
This disabled the charge pump so requires the (easy in this case) OLED mod of supplying a screen voltage supply in the right range (fortunately we have 9V available). This video shows the modification needed:
I hope this may be of help to others experiencing OLED noise in audio projects.

I have built up an initial version of a PCB as shown in the attached photo. It's very crowded, I tried to fit everything into a 60mm x 100mm outline. The result is nice and compact but I've ordered a revised version of the PCB to fix a few errors.
PCB_v3r0_small.jpg

Can you tell me if you experience an oscillation that I describe below?
  • In the first approx 15% rotation of the volume pot (the quiet end) I get low hiss and only 20mA current draw with a quiet/reasonable sound level from a loudspeaker.
  • There is a sudden increase in hiss and current draw after 15% rotation of volume pot and an increase in current draw from 20mA to >60mA. A scope on the TDA7052A output pins shows an oscillation occurs at this point, frequency is approx 16kHz.
  • Further increase of the volume pot to 100% increases the hiss and current drawn to >200mA and R7 becomes very hot. The oscillation increases in magnitude when seen on a scope. The sound level from the speaker is good but I don't like running like this with R7 so hot.
This oscillation is not dependent on the picaxe-generated pwm frequency and doesn't occur when I use headphones instead of the speaker so I believe it is cased by audio feedback. I wondered if you experience it too and what kind of separation you have between your mic and speaker?
 

kranenborg

Senior Member
Hi!
Sorry to hear that you have run into some trouble here. I do not have the circuit on the board anymore, but will build it up again (that will be mid-next week I think), starting from the audio part as that one is giving you some trouble. Indeed the current draw seems high (although the audio chip can take quite some consumption according to the datasheet), and I will then do some current measurements and scope measurements myself for various audio potmeter settings. A few questions for now:
  • Does the audio amp show this behaviour as well when the input signal is removed by temporarily removing C7? (In this way pin 2 of the TDA7072A does not receive a signal from the SA612A but is still properly (AC-)grounded through R5). How does the approx current consumption in this case look like for a number of audio potmeter settings?
  • If this first step is OK then you could even add a test signal from the PICAXE through R24 to see whether you get normal "linear" audio (and current consumption) behaviour. If this is this is still OK then it maybe is a matter of mic-speaker coupling indeed, or instability due to the high gain factor of the design (but that can be reduced in a simple way).
  • NEW: If the above steps are indecisive, maybe one also wants to check the possibility of unwanted feedback into the volume control circuit (either through pin 4 or internally on the silicon). I looked at the datasheet of another variant of this chip, namely the TDA7052B. This chip has the same type of volume control circuit, but in this datasheet a second, alternative method is indicated (not present in the A-version datasheet that we use), which does not depend on the internal reference voltage supply. This method provides the control voltage directly through a simple voltage divider which - given the much lower resistance - loads the pin much stronger. In the attachment below I copied the relevant part of the datasheet and have proposed an adaptation of the circuit (in green) that I will test myself the coming week as well ... . Note that the new 56k resistor needs to be tied to the stabilized 5V from the LDO.
  • Do you remember whether your proto-board setup showed similar behavior (post #23)?
  • NEW: Does the TDA7052A chip itself get hot as well?
My circuit is exactly as shown in my posts above (I did not yet manage to make a PCB/Stripboard version), so there the physical separation of mic and speaker is quite strong, and in the design I tried to decouple by reducing the amplification path T1-T2-T3 for audible frequencies through small valued capacitors C1, C2, C19, C22 and C23, plus decoupling caps C10 and C11. I would need to test on a PCB version to test a different situation.

Maybe you would better halt ordering more PCB's as there might be a problem here that would require some fixes still ... .
/Jurjen
 

Attachments

Last edited:

bogbean

Active member
Thank you Jurjen for your diagnostic suggestions. I do still have the circuit set up on a breadboard, the table below gives measurements from the breadboard circuit (my PCB version gives very similar results). Note that my pot is a 1M linear pot but I've connected it (confusingly) for decreasing volume with clockwise rotation.
Code:
Pot pos [%] | I_supply [mA]  |  TDA7052A Pin4 [V]  |  TDA7052A Pin 8 Oscillation | Comment
100         | 20             |  0.00               |  None                       | 100% = no sound (quiet end)
99          | 25             |  0.90               |  None                       | Gentle hiss. Key jangle can be heard clearly
95          | 27             |  0.94               |  None                       | Limit of operation before oscillation
90          | 90             |  1.02               |  1.2 Vp-p                   | approx 18kHz oscillation, unsteady magnitude
50          | 250            |  1.15               |  3.5 Vp-p                   | approx 18kHz oscillation, unsteady magnitude
0           | 255            |  1.17               |  3.5 Vp-p                  | approx 18kHz oscillation, unsteady magnitude
Does the audio amp show this behaviour as well when the input signal is removed by temporarily removing C7? (In this way pin 2 of the TDA7072A does not receive a signal from the SA612A but is still properly (AC-)grounded through R5). How does the approx current consumption in this case look like for a number of audio potmeter settings?
With C7 removed the oscillations completely disappear for the full range of pot settings. The current then drawn is shown below...
Code:
Pot pos [%] | I_supply [mA]
100         | 20
99          | 21
95          | 29
90          | 29
50          | 28
0           | 27
If this first step is OK then you could even add a test signal from the PICAXE through R24 to see whether you get normal "linear" audio (and current consumption) behaviour. If this is this is still OK then it maybe is a matter of mic-speaker coupling indeed, or instability due to the high gain factor of the design (but that can be reduced in a simple way).
With C7 still removed I injected a 1kHz sine wave after R24 and see a reasonably linear volume response from the amp, with current drawn ranging from 20mA (pot at 100%) to 67mA (pot at 0%).

NEW: If the above steps are indecisive, maybe one also wants to check the possibility of unwanted feedback into the volume control circuit (either through pin 4 or internally on the silicon). I looked at the datasheet of another variant of this chip, namely the TDA7052B. This chip has the same type of volume control circuit, but in this datasheet an alternative method is indicated (not present in the A-version datasheet that we use), which does not depend on the internal reference voltage supply but provides the control voltage directly through a simple voltage divider which - given the much lower resistance - loads the pin much stronger. In the attachment below I copied the relevant part of the datasheet and have proposed an adaptation of the circuit (in green) that I will test myself the coming week as well ... . Note that the new 56k resistor needs to be tied to the stabilized 5V from the LDO.
For the alternative volume control your sketch is slightly different from fig 15 of the TDA7052B datasheet, did you intentionally include a connection between the 56k resistor and pin 4? I haven't yet tried this alternative method because I feel the results point towards the amp arrangement being ok and the effect being caused by audio feedback. I'm interested to hear if you have the same opinion.
I believe L1 & C5 form a 2nd order low pass filter and I've been able to partly subdue the oscillation by increasing the value of C5 to 220nF at the expense of the audio losing some of its treble content. I feel that a solution may be a combination of setting the cutoff frequency of this filter and achieving some mic / speaker separation.

Do you remember whether your proto-board setup showed similar behavior (post #23)?
NEW: Does the TDA7052A chip itself get hot as well?
My breadboard and pcb versions shows near-identical behaviour. I have posted my schematic below. My equivalent of C16 is only 330uF and I have a diode present in the 9V supply line but I get the same behaviour without my changes.
When I'm drawing 250mA R7 gets very hot (enough to smell but not smoke) but the amp gets only warm (approx 60C I estimate by finger)

UPDATE:
Despite the conclusions I drew above I think the alternative volume control does solve the problem! I didn't have a 22k pot to try but I found a similar arrangement used in a commercial product as described here (includes schematic):
The alternative volume control gives much more linear volume response and whilst an oscillation is present when the volume is turned up high I found it easier to achieve an optimum volume setting: whilst jangling keys, set the loudest volume that does not clip, an oscillation is not present at this setting and the current draw is only approx 30mA.
 

Attachments

Last edited:

kranenborg

Senior Member
Hi,
Given your update I think this is an interesting outcome: apparently the standard volume control (1M pot) approach as promoted by Philips appears not very stable in certain conditions. Given your test results I feel that this indeed is due to positive feedback of the audio signal into the volume control part - the fact that a 1M potmeter value is needed may be part of the problem since this suggests that pin 4 has a relatively high-impedance, allowing cross-talk etc. to enter.

Therefore I can imagine that the alternative volume circuit with much lower resistances in the voltage divider solves that problem as it appears simply to work so much better. So we should go for that configuration then, right?
I didn't have a 22k pot to try but I found a similar arrangement used in a commercial product as described here
I would like to update my circuit accordingly, but which values have you used to test it (not the ones as stated in the link I guess, and these seem a tad too high to me - I would suggest more in the range of 47K (linear) for the potmeter (that is a value I have in my box) and 100k for the additional resistor towards 5V)?
For the alternative volume control your sketch is slightly different from fig 15 of the TDA7052B datasheet, did you intentionally include a connection between the 56k resistor and pin 4?
The difference is due to two reasons:
  • In my variant the caps C9 and C18 are directly connected to the wiper, and thus help to counteract the ageing effects of the potentiometer (damping of the effects of crackling). To me this is THE key reason to prefer the TDA7052A variant over the non-A, standard version. This is also how it works for the original volume control circuit.
  • I presumed it would be easier for you to test (I think) given your existing PCB layout).
Please indicate if I still can help in any way. I will in any case design, build and test my stripboard prototype with the alternative version during next two weeks, apparently the baseline design is not stable enough, so many thanks for highlighting and chasing the issues.

/Jurjen
 
Last edited:

bogbean

Active member
Hi Jurjen,
Therefore I can imagine that the alternative volume circuit with much lower resistances in the voltage divider solves that problem as it appears simply to work so much better. So we should go for that configuration then, right?
I agree this alternative volume control seems much better and I want to use this method too.

I would like to update my circuit accordingly, but which values have you used to test it (not the ones as stated in the link I guess, and these seem a tad too high to me - I would suggest more in the range of 47K (linear) for the potmeter (that is a value I have in my box) and 100k for the additional resistor towards 5V)?
I've tested a few setups now, they are all good:
  1. The arrangement from the article I sent: 470k 'pullup' to 9V rail (8.3V for me) and 100k pot: allows range of 0.01 V to 1.17 V at amp pin 4
  2. Your arrangement of 100k 'pullup' to 5V rail but 50k pot (what I had): allows range of 0.01 V to 1.28 V at amp pin 4
  3. Your arrangement but with 220k 'pullup' to 9V rail and 50k pot (what I had): allows range of 0.01 V to 1.20 V at amp pin 4
  4. Your arrangement but with 470k 'pullup' to 5V rail and 100k pot
My preference is for either option 2 or 3, I haven't yet seen any performance difference between them and they will be easy enough to implement on my pcb (which is on the way and couldn't be stopped but was very cheap). All these tests were done with a wire link in place of R7, I experimented and found that from a marginally stable volume setting oscillation was induced if I included R7 and would fade out if I shorted R7. So I will probably remove R7. Update: I've moved on to option 4 , it works ok and my normal parts supplier only has 9mm Bourns pots at 100k (I have several knobs that don't fit Alpha pots).

With these arrangements I still see an oscillation of approx 19 kHz, 0.5 V p-p on amp pin 8 when the volume control provides 0.97 V on pin 4, which is around the best operating point I've found (maximum volume achieved before the output clips). I don't feel the need to chase reducing this oscillation as the current draw is not excessive (50mA at that operating point, over 150mA can still be reached at higher volume) and above this point the sound output clips. Increasing the value of C5 reduces the oscillation but makes the sound output feel a bit muffled.

Thanks for explaining the reasons for your modifications of the volume control arrangement, and for considering the impact on my pcb. I feel the circuit is performing very well now, and it's still a joy to hear the bats so clearly! I'll move on to building up a pcb and will post an update of the built version and an enclosure, if I decide to make one. Thank you so much for all the help you've provided, and the inspiration, I think I've run out of questions to ask you though! I would be interested to see your stripboard version. Let me know if you would like me to design you a pcb, it would not take me much time as our circuits are only slightly different. I should check mine works first though.

I'll keep the circuit set up on breadboard for a couple of weeks, let me know if you'd like me to try anything.
 
Last edited:

kranenborg

Senior Member
I updated the circuit in post #12 accordingly (and added the modification for in-circuit programming for the picaxe as well ...)
Edit: I keep R7 for the moment and test/measure it myself. but may then remove it later ...
/Jurjen
 
Last edited:

bogbean

Active member
Hi Jurjen,
I found the sound output is improved with a cap in the nF range (I'm using 10nF at the moment) directly at the mixer input pin 6. I think this may be needed to avoid upsetting the biasing of the mixer's gilbert cell. I find the audio out is less 'clipped' with this cap and I also see this cap present in other circuits using the NE612 / SA612. Fortunately it's not difficult to implement on my pcb.
 

kranenborg

Senior Member
Hi Jurjen,
I found the sound output is improved with a cap in the nF range (I'm using 10nF at the moment) directly at the mixer input pin 6. I think this may be needed to avoid upsetting the biasing of the mixer's gilbert cell. I find the audio out is less 'clipped' with this cap and I also see this cap present in other circuits using the NE612 / SA612. Fortunately it's not difficult to implement on my pcb.
Hi Bogbean,
Thanks for this suggestion! I guess you mean that the capacitor should replace the wired connection between R15&R16 and pin 6 of the SA612A, right? I can indeed imagine that this is the proper thing to do and will test it as soon as I have built up my stripboard PCB (design is basically ready, but work duties are keeping me from getting more progress currently (but this will come)

/Jurjen
 

bogbean

Active member
Thanks for this suggestion! I guess you mean that the capacitor should replace the wired connection between R15&R16 and pin 6 of the SA612A, right?
Yes, that's it.
I found it improved the bat sound significantly.
I scoped the SA612A output at pin 4 and it looked to me that with the capacitor present at pin 6 the mixer does a much better job of removing the input frequencies of pins 1/2 from the output. And I 'felt' (I don't have a spectrum analyser and just relied on my scope's FFT, which has a coarse output) that the detector was much more selective, i.e. produces an audio output only when the ultrasonic input and the pixaxe's pwm output are within a few kHz of each other. This encouraged me that the detector may even be useful to distinguish between bat species.
 
Top