DS18B20 and MAX9744 not playing well together

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
superdave913
 
Posts: 4
Joined: Tue Jan 08, 2013 2:50 pm

DS18B20 and MAX9744 not playing well together

Post by superdave913 »

I started off by setting up a DS18B20 1-wire (https://www.adafruit.com/product/381) with my Raspberry Pi to gather temperatures from my pool, and it was working great. I realized it would be a great idea to utilize the Raspberry Pi to also play music, and purchased a MAX9744 (https://www.adafruit.com/products/1752). The MAX9744 board is independently powered, and ONLY utilizing the 3.5mm connection between the board and Raspberry Pi. Within a few seconds of plugging the 3.5mm cable into the Raspberry Pi, the sensors stop registering as being connected. As soon as I unplug in the 3.5mm stereo cable to the Raspberry Pi, the sensors start working again. When the 3.5mm cable is connected audio is completely fine and adjustable with the analog knob.

So, I can have either the sensors OR the amplifier working, but not both at the same time! I originally thought it might be an EMF issue, and tried putting the MAX9744 in an Altoid tin, but with no success.

Any suggestions on how I should try debugging this? Have others run into this kind of issue? This seems like something that should have been "simple."

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 and MAX9744 not playing well together

Post by adafruit_support_bill »

How long is the wire for the DS18B20?

User avatar
superdave913
 
Posts: 4
Joined: Tue Jan 08, 2013 2:50 pm

Re: DS18B20 and MAX9744 not playing well together

Post by superdave913 »

I am guessing I know where you are going with this...

When I did the original breadboard of the setup, it worked fine... but when I added additional wire the sensor stopped working. I ended up using a smaller resistor to get it to work, as the longer wire was presumably adding resistance to the line.

So, are you guessing that the MAX9744 amplifier is somehow impacting the resistance on the sensor? That would seem odd since they are using completely different aspects of the board, but I suppose it is possible. Should I use an even smaller resistor, or is there some other way to isolate the components?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 and MAX9744 not playing well together

Post by adafruit_support_bill »

I don't think it is affecting the resistance. But longer wires make better antennas for picking up EMI. And the unfiltered outputs of the amplifier do have a good amount of high-speed switching noise from the class-D amplification.

What kind of wire did you use with the DS18B20? Twisted pair and/or shielded wire would help minimize the effects of noise on the sensor lines.

User avatar
superdave913
 
Posts: 4
Joined: Tue Jan 08, 2013 2:50 pm

Re: DS18B20 and MAX9744 not playing well together

Post by superdave913 »

The wire I used is not shielded or twisted pair. Due to the cable being exposed to outside elements, I was focused on finding weather resistant cable instead. I'm sure I could find something that meets both though. Re-running the wire is do-able, but not desirable if avoidable.

Would there be a way to shield the EMI at the amplifier? I had tried the tin box, but that didn't work.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 and MAX9744 not playing well together

Post by adafruit_support_bill »

Ethernet cable is good quality twisted pair. And outdoor versions are available.

The problem with the amplifier output is that it relies on the inductance of the speaker coils to filter the Class-D PWM switching. So the entire speaker wire is a transmitting antenna for EMI.

Before you start re-wiring things, let's see if we can confirm that this is the problem. If you disconnect the speakers and put your amp in the tin box, do you still have trouble with the DS18B20 readings?

User avatar
superdave913
 
Posts: 4
Joined: Tue Jan 08, 2013 2:50 pm

Re: DS18B20 and MAX9744 not playing well together

Post by superdave913 »

I finally had the health and time to look at this again.

I started off by wanting to listen to some music and just plugged the amp directly into my iPhone. As I was listening, I figured I should check to see if the DS18B20 were still working. Sure enough, they were still functioning just fine. I think that rules out the last suggestion, that the speaker wires were causing EMI issues with the DS18B20.

I then decided my solution might be as easy/cheap to just put another Raspberry Pi out there, but it ALSO had the same issue of the DS18B20 stopped working on Raspberry Pi #1. Raspberry Pi #2 had the amp, and Raspberry Pi #1 had the D18B20. This was obviously very odd. I decided the main difference between Raspberry Pi #2 and my iPhone was the power separation. The iPhone had been using battery power and wasn't plugged in during the initial test. I ran an extension cable from a different outlet to Raspberry Pi #2, and everything was OK again.

So, I'm beginning to wonder if there is some sort of grounding issue that takes out the DS18B20 when the amp is connected on the same power circuit. To me, this sounds a little weird. I even tried another physical source power outlet (same circuit), on the off chance that it was an outlet specific grounding issue.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: DS18B20 and MAX9744 not playing well together

Post by adafruit_support_bill »

Or it could be that the noise is coupling through the ground and/or power lines. Post a diagram of how you have it wired up.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”