About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

power supply and reference voltage

2089 Views - Created 03/11/2015

03/11/2015

Posted by:
josef

Users Avatar

Hello,

I am using the ADC Pi plus board as a field data logger.

Power supply is a UBEC 5V@3A (from Adafruit) and the raspberry pi (B+) has a USB modem for data transfer.

I recently found that I get lower readings from the ADC Pi plus when the modem connects to internet. It seems that it is because of the increased load on USB-ports and thereby slightly lower ouput voltage from the UBEC. 

I thought the onboard voltage reference would make the readings independent of power supply voltage but I  must have misunderstood how this works.

Here is a plot showing a simple test:

adc2 - the power supply from UBEC (with external voltage divider)

adc3 - external constant voltage generator 

 

not shown in plot:
adc1 - external power (pre UBEC) 
adc4-adc8 - connected to ground

How can I get stable readings from external signals, independently of smaller variations in the power supply?

Thanks!

 

 

04/11/2015

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

 Hello

The ADC chip on the ADC Pi Plus does use an internal voltage reference for making voltage measurements but sudden voltage changes on the power supply could cause errors in the reading due to the way the ADC works.  The ADC performs a self-calibration of offset and gain for each conversion but if a change in voltage on the power line occurs between the self-calibration and the sample being taken then a reading error could occur.

There may be a few things you can try to reduce the problem.  The ADC Pi Plus has 5V and GND pins on the board, you could try connecting your power supply to those pins as well as on the Raspberry Pi itself.  This will increase the amount of current available to the ADC Pi and Raspberry Pi but the downside is the fuse on the Raspberry Pi will be bypassed so you will have to be more careful when using the Raspberry Pi as there won't be any overcurrent protection if you short one of the GPIO pins to ground.  

Adding some large capacitors to the power line will also help reduce voltage fluctuations as they will be able to supply the extra current needed when the modem is being used.

If the problem still occurs then one other thing you could try is to use a second smaller power supply to provide 5V to the ADC Pi Plus independant of the Raspberry Pi. To do this you will need to cut the 5V trace on the PCB as shown by the red line on the image below and then connect the second power supply to the ADC Pi Plus 5V and GND pins.  This will isolate the power for the ADC Pi Plus from the Raspberry Pi so any voltage drops on the Raspberry Pi will not affect the ADC Pi Plus.  The ADC Pi Plus uses a voltage level translator for the I2C pins so as long as both power supplies share a common ground the ADC Pi Plus should still be able to communicate with the Raspberry Pi.Post image

AB Electronics UK Tech Support

05/11/2015

Posted by:
josef

Users Avatar

Andrew,
Thank you for your very informative answer.

In fact, I already tried your first suggestion and the data shown in the plot are collected while bypassing the raspberry pi fuse (sorry, I forgot to mention that).

OK, so errors may occur if the power supply changes between the self-calibration and the reading. I can see how that causes some kind of random noise on the readings.

But there also seems to be some offsets in the data, see for example at ~16:12:50 in the plot. Perhaps if the power supply was constantly increasing (or decreasing) there might be a systematic difference between the calibration and the reading. But I can not see any trends in power supply. Do you have any thoughts about this?

Anyway, I will try your other suggestions with a capacitor or a separate power supply for adcpi. I will let you know about the results.

06/11/2015

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

One thing that may improve the results is to set the ADC to continuous converstion mode so it is sampling the ADC inputs continuously.  By default the ADC is set to one shot mode which only samples the ADC when a read_voltage event is called.

If you are using our python library then you can use the set_conversion_mode(1) function to change the ADC to continuous converstion mode.

Changing the bit rate to a lower rate may also help as it will mean there are more samples being taken so it should stabalise faster.

AB Electronics UK Tech Support

25/11/2015

Posted by:
josef

Users Avatar

Andrew,

I just thought that I'd let you know the set_conversion_mode(1) made no difference. See linked figure where I switch to continuous mode at 13:31.

figure

I will try your other suggestion with a separate power supply as soon as possible

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.