Project

General

Profile

Reading temperature sensors problem with i2c dimmer module and mosfet module

Added by luca_ac almost 5 years ago

Hi,
I have a problem with my project which is composed as follow:
- a raspberry model B
- two DS18B20 immersion probe and one classic DS18B20 probe connected in parallel to the 1-wire pin (4) with a single 4.7K resistance between data and vcc (3,3 volt)
- one jeelabs dimmer plug module connected to two jeelabs mosfet plug module for driving four led lines connected to 12v power supply.

Everything works fine when led are off or when are full on (I read the correct temperature from the three probes) but when I use intermediate values of brightness for the led, the three probes give me bad values (CRC error) or the probe directory 28-xxx disapper.
This problem does not occur when I connect a very lower led load (for example with 5w led everythink works great but when I connect 70w led I can’t read temperatures).

I tried to:
- replace all the components
- connect the 1-wire probes on 5v vcc instead of 3.3 v
- powering the dimmer and mosfet module with an external power supply with ground connected to the rasp
- change the probes resistor with a 10K (but the problem is worse)
- change the raspberry power supply with a 6A one (max load measured is 1,10 A)

I’ve attached a wiring diagram of the dimmer - mosfet connection.

Thanks

forum.JPG (37.8 KB) forum.JPG
2045

Replies (7)

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by martynj almost 5 years ago

luca,

The symptoms point to noise from the MOSFET switching leaking into the sensitive probe measuring side. As you report, when the load current is small or zero, or 100% on, the problem goes away. This points the finger at the current pulse edges. As you would expect, these are close to square waves which generates harmonics of the switching frequency well into the MHz region - these will cross-couple into cabling through stray capacity and/or common earth paths.

Without a ‘scope to look at the waveforms and noise on the ’one-wire’ bus, it is difficult to see this effect and how changing your layout may reduce the coupling.
Here are some suggestions in rough order to try:

  • Reduce the capacitance coupling between the LED heavy current cables and the one-wire bus by separation, screening etc
  • Reduce the probe resistor to 2.2KΩ (temporarily, since this is out of specification for the sensors)
  • Reduce the RF noise on the one-wire bus by an LC filter just before Pin 4 (470pf to ground, small RF choke in series)
  • Rewire to avoid using the parasitic power (twin twisted pair cabling)
  • Reduce the RF noise generated by shaping the LED current. (Try 4.7KΩ in series between Dimmer output pin and MOSFET board input pin)

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by luca_ac almost 5 years ago

Hi,
thank you for the fast reply..

I ’m trying to reduce the RF noise on w1-bus with an LC filter. I have connected a 470pf but I don’t know what RF choke to use .. what inductance must have?

I’ve connected the filter to the rasp and the probe like in the attached scheme, it’s correct?

I’ve read that someone use a RC filter with a 100 Ohm resistence and a 4700pf condensator .. which is the best solution?

Thank you

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by martynj almost 5 years ago

luca,

Your circuit is correct - you can in fact use inductance in both wires (the ‘DATA’ and the ‘GND’). This is often done by having two windings on a common core or toroid (‘bifilar winding’). A good source is the mains filter from a scrap TV or similar appliance - the capacitor values are too big, but the inductor from there is fine.

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by luca_ac almost 5 years ago

Ok, I did some attemps:

  • with a 2.2KΩ resistor the readings of the probe have improved appreciably
  • I realized that when the led are connected (intermediate value of brightness) I get a lot of read and write error on the registers values of the dimmer plug (using i2cget tool: Read error - i2cset: Write error)

With these results I think it’s better to filter the RF noise of the dimmer - mosfet connection to avoid effects to other components rather than the temperature probe.
Do you think I can use the LC filter for each Dimmer output pin and MOSFET board input pin or is enough the 4.7KΩ resistor (one for each output?) The attached schemes are correct?
It’s useful lower the temperature of the mosfet to reduce RF noise?

Thanks again for your valuable advice!


RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by martynj almost 5 years ago

luca,

The first schematic is correct - the operation is quite different from the low-pass filter suggested for the sensor input pins.
Recall that the PWM is driving a voltage square-edged output. The MOSFET gate effectively turns this voltage shape into a similar, heavy current shape to pass down the LED string at the switching frequency. Thanks to Mr Fourier, we know that the sharper the “corners”, the stronger the harmonics of the switching frequency - extending easily into the MHz region. This energy radiates away using the LED string connection as an antenna.

Once you have high current EMI, it is quite hard to ‘bottle up’ to prevent pickup by local or remote circuits - it is better to reduce how much is generated in the first place.
The technique suggested is using a ‘hidden’ component on the schematic - the MOSFET Gate to Source capacitance. It is always there and it is free! If you imagine the parasitic capacitor on the MOSFET input pin to ground, when the drive signal goes from LOW to HIGH, the gate will take some time to go through the same transition. This has the effect of turning on the MOSFET gently, changing the output waveform into more of a trapezoid shape than a square edge. This softer attack (and similarly softer release) generates less intense harmonics.

The capacitor may be for free, but the method is not. The MOSFET switching action spends longer between open and fully closed - this increases the power lost across the switch, pushing up the heat the MOSFET needs to dispose of. For mild waveshaping, this is not usually a problem - just use the finger test on the MOSFET tab to check.

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by luca_ac almost 5 years ago

We are near to solution ! !
In-fact with the resistor in series to the output pin of the jeelabs dimmer plug I finally can read correct temperature and correct registers values of PCA9635 but the brightness of the led stripes connected to the jeelabs mosfet plug are all decreased depending on the resistor:

With a 4.7 KΩ resistor

Line 1: 4 Watt 12 Volt > almost off
Line 2: 75 Watt 12 Volt
> brightness decreased significantly respect without resistor
Line 3: 25 Watt 12 Volt ~~> brightness decreased significantly respect without resistor

With a 2.2 KΩ resistor
Line 1: 4 Watt 12 Volt~~> almost off
Line 2: 75 Watt 12 Volt > brightness decreased slightly respect without resistor
Line 3: 25 Watt 12 Volt
> brightness decreased slightly respect without resistor

With a 100 Ω resistor

Line 1: 4 Watt 12 Volt > almost off
Line 2: 75 Watt 12 Volt
> full brightness (like without the resistor)
Line 3: 25 Watt 12 Volt > full brightness (like without the resistor)
Line 1: 4 Watt 12 Volt
> without resistor work normally at full brightness and when PWM run

1- I can use lower resistor?
2- and if so I would have problems with higher load (like 120 Watt led stripes) ?
3- Why with a low load the led stripe is almost off ?

Sorry for this series of questions and clarifications, but we are made a product that will require a large number of these components, and we would like to be certain that there is full compatibility with any type of LED and any load.

Thanks in advance

RE: Reading temperature sensors problem with i2c dimmer module and mosfet module - Added by martynj almost 5 years ago

luca,

You really need to beg, borrow or steal (oops, hire) a ‘scope to visualise what is happening - I’m suggesting component values from experience, not from real observations.
If you check the schematic of the MOSFET board, you will see that there are 10KΩ resistors from gate to ground. You can change these to 100KΩ - the brightness problem should go away. You may get a ’blip’ on the LED strings when the power is first applied though.

If you are planning to make many of these devices, I suggest you look at the LED node - it has some of this waveform-shaping in place already. The PWM is done on the host instead of externally.

    (1-7/7)