Gentlemen PyBoarders, I have news to report.
First, again let me thank you all for your immense help and support!
I may have assumed that you knew my project, so let me give a few words of overview:
- I use the Pyboard to drive a network of analog switches via spi.
- These switches route signals from an electric guitar's pickups to the output plug, which is connected via a heavily shielded cable to an electric guitar amplifier.
- I run the circuit from a battery to avoid input noise from a PSU.
- The pyboard is powered from a Boost converter, outputting 5V to the Vin pin.
- The ground is common to the entire circuit, including the amp ground.
- The pyboard is connected to a linux pc, via usb, where I enter commands to the REPL via the linux 'screen' command.
In the following tests, I am not using my circuit or my code:
- I do not import any program into the pyboard, only the pyb module . The pyboard is powered and connected to my PCB with the analog switches, that is all.
- The electric guitar pickups are not connected to the circuit. So there is absolutely no input. It is simply floating.
I have now done some elementary testing to get all the info:
Test 0: Evaluate the Ambient Noise
- With the amp cable NOT connected, but laying near the circuit, with the circuit NOT powered and NOT connected to the PC, turn on the amp to full volume.
- There is a pretty loud hum. If I turn on/off room lights there is no additional noise.
This level of ambient noise is normal.
Test 1: Establish the Circuit Noise Baseline
- I plug the amp cable into the circuit, but the circuit is not powered. The amp is set to full volume.
- The Pyboard is not connect to the battery or to the PC.
- There is a steady hum. If I turn on a room light, there is a huge pop. I attribute this to the antenna effect of the PCB and wires hanging around it. But I am not 100% sure of that.
- I call this hum the Noise Baseline.
Test 2: Compare powered Circuit Noise to Baseline Noise
- Next, I power the Pyboard circuit and connect to the PC via USB.
- The amp meter reads 51mA which seems perfectly normal and ok to simply power the Pyboard.
- Remember, the pickups are not connected so there is no input to the circuit.
- The Noise Baseline is mainly unchanged, their are some transient whistles as the pyboard powers up, but these dissipate and we get back to the Noise Baseline, perhaps slightly noisier, but not significantly so.
Test 3: Explore effects of Pyboard commands with the amp cable not connected
- I power the Pyboard circuit and connect to the PC via USB.
- I unplug the amp cable from the circuit.
- I manually run digital reads, analog reads, accelerometer reads.
- The Noise Baseline is unchanged, No audible change whatsoever.
Test 4: Explore noise generated by Pyboard Commands
- I power the Pyboard circuit and connect to the PC via USB.
- I plug the amp cable from the circuit.
- Digital read:
Code: Select all
>>> p=Pin('X1',Pin.IN)
>>> p.value()
0
>>> while True:
... delay(100)
... p.value()
...
# I get a very faint ticking sound from the amp, faint, but audible,
- Analog read:
Code: Select all
>>> a=ADC('X19')
>>> a.read()
564
>>> while True:
... delay(100)
... a.read()
...
# I get a slightly louder ticking sound from the amp, stronger than the digital read, clearly audible.
- Accelerometer Reading:
Code: Select all
>>> x=Accel()
>>> x.x()
4
>>> while True:
... delay(100)
... x.x()
...
# I get a very clear and loud ticking sound from the amp.
At this point, I can see a pattern. So, now I see if I can eliminate the noise.
Put a 100n capacitor between the amp input and ground.
- The noise level is much much lower than the Circuit Noise Baseline.
- Run the same digital, analog and accelerometer read tests.
- There is no audible ticking noise.
Put a 180p capacitor between the amp input and ground.
- The noise level is still much much lower than the Circuit Noise Baseline, but higher than with the 100n capacitor.
- Run the same digital, analog and accelerometer read tests.
- There is very slight audible ticking noise.
I have tested the guitar pickups:
- With the 100n cap, the sound is seriously muffled, like setting the guitar tone to very very low.
- With the 180pF cap, the sound is slightly muffled, like setting the tone to 8/10.
- Ideally, I would like to maintain 100% tone, but not have the ticking.
Voilà for the tests. I feel like I have progressed!
Now my question is the following:
Given that I can select the polling frequency in the code by using a delay, say 100 to 200 ms, I can obtain a ticking frequency of 5-10Hz.
Is it possible to filter that frequency, but not the rest of the audible range?
Any suggestions would be great!
Cheers,
Bob