Jump to content

Ambient Light Bricklet influences Analog In Brickelet


blackfox

Recommended Posts

I found the behavior of the Analog In Bricklet strange:

 

index.php?action=dlattach;topic=1857.0;attach=1433

 

With no sensor connected to the A.I. Bricklet and Bricklet at 0-6V:

 

When it's dark at night the A.I. Bricklet stays at ± 8mV. During the day with increasing light the value goes up, rises by ± 12mV to ± 20mV and drops again by night. During dawn and dusk there is a spike of ± 12mV.

 

I found this to be the cause:

 

Obscuring the Ambient Light Bricklet on the same Master Brick kept the value of the A.I. bricklet constant at ± 8mV.

 

Disconnecting the Ambient Light Bricklet kept the value of the A.I. bricklet constant at ± 20mV.

 

Is it normal that the output of the Ambient Light Bricklet influences the output of the Analog In Bricklet? 

ft_1377509196304_1377077003000_1377163380000_7.png.efbf9762fddc510d94099108c313b507.png

Link zu diesem Kommentar
Share on other sites

Both Bricklets are using analog sensors that are read out using the ADC in the microcontroller. This effect you're seeing is a known problem/limitation with the multiplexing used in the ADC to read out values from different inputs. This only happens for specific Bricklet port combinations and does not affect all microcontrollers, it varies between different production batches. I can reproduce this with the Analog In Bricklet on port C and the Ambient Light Bricklet at port B on one of my testing Master Bricks. When I change one of the Bricklets to another port then the problem goes away.

Link zu diesem Kommentar
Share on other sites

F.Y.I. My specific Bricklet port combination: the Ambient Light Bricklet at port C and the Analog In Bricklet on port D.

 

But I also got a Humidity Bricklet at port A and a Barometer Bricklet at port B

 

 

I swapped the Analog In Bricklet to port A and the Humidity Bricklet to port D and the problem is fixed, at least for the Analog In Bricklet. The Value at the A.I. bricklet is now ± 8mV.

 

But why was the value of the A.I. bricklet constant at ± 20mV by disconnecting the Ambient Light Bricklet in the original situation.

Link zu diesem Kommentar
Share on other sites

Let me clarify this. The problem you're seeing and that I can reproduced with one of my Master Bricks here is also related to letting the VIN input pin float. The problem goes away for me if I connect something to VIN that the Analog In Bricklet can measure, instead of letting it float. For example directly connecting VIN and GND on the Bricklet gives a totally straight line at zero.

Link zu diesem Kommentar
Share on other sites

Hi Photron thanks for your help.

Let me clarify this:

But why was the value of the A.I. bricklet constant at ± 20mV by disconnecting the Ambient Light Bricklet in the original situation.

This question is actually not relevant because it only happens with the bricklet in a conflicting port, so I shouldn't have asked it in the first place.

 

The problem you're seeing and that I can reproduced with one of my Master Bricks here is also related to letting the VIN input pin float.
I only let it float eventually to test the situation and to eliminate other causes for the problem. But I noticed the problem with a sensor connected in the first place.

 

What's maybe more relevant is a sort of Rule of Thumb, by which conflicting Bricklets are correctly installed, and also which Bricklets are potentially conflicting. 

Link zu diesem Kommentar
Share on other sites

Hello,

 

i am not shure if i understand this topic, but i try to summarise it.

 

I think nothing is conflicting. A floating Analog-In Bricklet is like an (Receiving)-Antenna. Everything around it can influence the Voltage of the "open" port in a different way. Any Bricklet Cable is a (Transmitting)-Antennna. To solve the problem use the Analog-In port and connect it.

 

 

The Ambient-Light Bricklet should always work correctly in any tested combination?!

 

If i am totally wrong, please explain the problem to me, because i would like to understand it.  ;)

 

Thanks.

 

Der Loetkoben

Link zu diesem Kommentar
Share on other sites

Hello Loetkoben,

 

I noticed a problem with the Analog In Bricklet which seemed to react to changing light, since there is also a Ambient Light Bricklet on that Master Brick it seemed logic that there was a connection between the two.

 

I also want to emphasis that the A.I. Bricklet reacted exactly the same way with a sensor connected or without a sensor (floating).

 

I followed Photron's advice and swapped ports and this seemed to solve the problem.

 

Following your message I decided to do a test with shielded cables and my original configuration.

 

The result was almost exactly the same as with the standard cables (the effect of the Ambient Light Bricklet was still there).

 

Than I tried the shielded cables and the new configuration (the one I used after Photron's advice) but the result was not the same as with the standard cables. (but the effect of the Ambient Light Bricklet was gone)

 

I ended up by removing everything (cables as well) from the Master Brick except the A.I. Bricklet (with directly connected VIN and GND) and tested it with different standard and shielded cables and tried all the ports.

 

The shielded cables gave a different result to the standard cables. With a shielded cable I only get a 0mV reading when the range is set at 0-10V, all other ranges gave me 3 to 5mV reading. With the standard cables I got a 0 to 1mV reading for the 0-6V and 0-10v ranges and the two other ranges give more eratic higher values.

 

I could not find a difference between all the standard cables or all the shielded cables, and the different ports also gave no difference.

 

Unfortunately I don't have multiple A.I. Bricklets nor Master Bricks to do more tests.

 

Link zu diesem Kommentar
Share on other sites

Maybe I can also add something to the discussion. I have two Masterbricks here, both are connected to the PC by independent USB connections. Yesterday I decided to rearrange some of the bricklets connected to the Masterbricks. So I moved a humidity bricklet from MB 1 to MB 2 and I also completely removed an ambient light bricklet from MB 1.

Now comes the strange part:

the values from the bricklets are read out every minute and stored in an rrd which is then used to plot the values in cacti. Since I removed one of the ambient light bricklets, I expected the corresponding graph to show a value of zero from now on, but instead I get some "ghost" values as you can see in the attached image.

How can that be?

graph_image.png.83944337e32df5a983ad342d3ba596fb.png

Link zu diesem Kommentar
Share on other sites

Okay, I just did some more tests:

 

First of all: Are you using a Master Brick hardware version 1.x or 2.0? Hardware version 1.x did not auto-calibrate its ADC, hardware version 2.0 does. So if you have only the Analog In Bricklet connected to a Master Brick 1.x and still get an offset from 0V if VIN is shorted to GND then you might need to calibrate its ADC. See the documentation about this.

 

As Loetkolben said, the Bricklet cables can act as antennas and pick up interference. Rule of Thumb: Use the shortest Bricklet cables possible. Also shielded cables are a good idea if you have trouble with interference.

 

I tested other Bricklets with analog sensors and none of them has a similar problem. Only the Analog In Bricklet can be affected by other analog Bricklets. The problem only occurs if the Analog In Bricklet is connected directly behind another analog Bricklet in the ADC channel multiplexing. Rule of Thumb: Connect the Analog In Bricklet to Bricklet port A to avoid this.

 

The technical problem with the Analog In Bricklet is the way its voltage divider is configured. The VIN isn't really floating if nothing is connected. In auto-range mode a weak 120 kOhm pull down is selected. This is not very robust against interference. If you actually drive the VIN pin then it's much less prone to interference.

 

There is a 100 kOhm series resistor between VIN and the ADC input on the Brick. This results in very little current flowing to the ADC. This is probably the cause why your Ambient Light Bricklet can affect the measurement of the Analog In Bricklet. In my tests I can see a change of 5 to 10mV if the Ambient Light Bricklet is in bright light and the Bricklets are connected to the right ports.

 

So there is no general problem. It's only the Analog In Bricklet that's having a slight offset in its measurement under specific conditions. We tested a modified version, that lets more current flow to the ADC pin and this fixed the problems. So the next hardware version of the Analog in Bricklet won't have this problem anymore.

Link zu diesem Kommentar
Share on other sites

Yesterday I decided to rearrange some of the bricklets connected to the Masterbricks. So I moved a humidity bricklet from MB 1 to MB 2 and I also completely removed an ambient light bricklet from MB 1.

Now comes the strange part:

the values from the bricklets are read out every minute and stored in an rrd which is then used to plot the values in cacti. Since I removed one of the ambient light bricklets, I expected the corresponding graph to show a value of zero from now on, but instead I get some "ghost" values as you can see in the attached image.

 

Did you restart both Master Bricks after changing the Bricklet configuration. You cannot hotunplug Bricklets. If you hotunplug then the ADC input used to read out the Ambient Light Bricklet is floating now and you can ready any value from a floating input.

 

If you did restart the Bricks, does your program probably handle timeout errors? If you remove an Ambient Light Bricklet and are still requesting data from it you'll get timeout errors that your program needs to handle properly.

Link zu diesem Kommentar
Share on other sites

Hello Photron,

Are you using a Master Brick hardware version 1.x or 2.0?

I'm using V2.0.

As Loetkolben said, the Bricklet cables can act as antennas and pick up interference

I agreed with what he said, but it turned out not to be the problem.

The problem only occurs if the Analog In Bricklet is connected directly behind another analog Bricklet in the ADC channel multiplexing. Rule of Thumb: Connect the Analog In Bricklet to Bricklet port A to avoid this.

That's great, you found the problem and a good solution that works. Thanks for all your help.

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...