1
\$\begingroup\$

I have a project which uses an Arduino to detect tones generated by a laptop. The Tone Detector (TD) circuit is a very simple LM567 implementation designed to detect 10kHz. The circuit is powered by the Arduino, connected to the laptop headphone socket via a standard 3.5mm stereo audio cable. In testing, with Arduino externally powered, the circuit works fine - the laptop generates tones, which the TD detects and raises a signal to the Arduino.

enter image description here

The problem is that it doesn't work if a USB cable is connected between the Arduino and the laptop. I have tried all configuration variations I can think of, but the common factor is when the USB cable AND the audio cable are connected it doesn't work, and it seems the audio is simply not generated in this configuration. The target Arduino is a Leonardo, but the same problem occurs with a Uno.

All suggestions very welcome!

In response to questions, yes there is a common ground. The audio input for the TD is connected to 0v.

Tone Detector circuit:

enter image description here

Audio input is connected to Input and 0v; Arduino to 5v, 0v & Output.

It is clear from the comments that the issue is around connecting the audio and digital grounds together, the question now is, how can I solve this?

\$\endgroup\$
7
  • \$\begingroup\$ (1) Are all devices sharing a common ground? Disconnect the USB from the laptop and check for continuity from the USB COM through the Arduino, tone detector and audio lead to the laptop. \$\endgroup\$ – Transistor Jun 15 '20 at 12:12
  • \$\begingroup\$ How is the ground wire in the audio cable connected? \$\endgroup\$ – user253751 Jun 15 '20 at 12:40
  • \$\begingroup\$ If you connect a headphone in parallel to the circuit do you hear anything? Is the usb power enough for the arduino and TD circuit? Some computers do limit the usb power unless enumerated. \$\endgroup\$ – Passerby Jun 15 '20 at 13:21
  • \$\begingroup\$ Usually laptops have a DC blocking capacitor that keeps the virtual audio ground (typically at 2.5v relative to power supply ground) from passing through the audio cable and shorting to earth ground. Not always though. Check what voltage a zero signal is relative to the shield on the USB cable (with the headphone jack unplugged). It should be zero, if it isn't, that is your problem. \$\endgroup\$ – user1850479 Jun 15 '20 at 13:24
  • \$\begingroup\$ Please post the schematics of the tone input device and how it connects to Arduino. \$\endgroup\$ – Justme Jun 15 '20 at 14:27
0
\$\begingroup\$

Solution was to add an isolation transformer. Readily available on eBay with 3.5mm jacks, so I have just added one inline.

https://www.ebay.co.uk/itm/274391739005

\$\endgroup\$
2
  • \$\begingroup\$ That should not have been necessary. It seems either that something in your earlier circuit depiction perhaps related to the coupling capacitor was not actually accurate. Of course using an LM567 to detect output of a laptop and feeding the result back into the same laptop is a pointeless exercise unless as a stepping stone to a "real problem" you have neglected to mention. \$\endgroup\$ – Chris Stratton Jun 27 '20 at 18:24
  • \$\begingroup\$ I'll recheck the circuit & diagrams, but AFAIAA, it is accurate. This is just a test setup that demonstrates the problem in the simplest way - the elements (USB, LM567 etc) are part of a larger device. \$\endgroup\$ – Observer42 Jun 29 '20 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.