Aref Wiring Query

I'm about to revise a current project and wanted to check if my basic fundamental wiring diagram was okay to model. Please excuse the Fritzing object, namely an Adafruit mems microphone. Its supposed to be an Adafruit Log-scale analog light sensor, which does have the same 3 pins (in, out, gnd).

The light sensor has a maximum output voltage of 3v so I thought I could use the Aref for a reference then analog 4 (for the sake of the diagram) to read:

analogRead(4)

Also, once you set the Aref to EXTERNAL, does that mean that all analog inputs are 0-3v to 1023 steps as opposed to 0-5 to 1023 steps?

The actual incoming master power will be 9v (pp3 batt)

The light sensor has a maximum output voltage of 3v so I thought I could use the Aref for a reference then analog 4 (for the sake of the diagram) to read:

No Aref has to be a constant voltage not a varying voltage like you would get with the sensor.
If you wire it up like that then you will always read 1023 no matter what the voltage from your sensor is.

You need to provide a separate voltage regulator or reference voltage chip.

And remember to call analogReference(EXTERNAL) early in setup() - if you don't then the first call to analogRead() will
internally short AREF to Vcc and this might cause damage.

The default arrangement is that analogRead() selects Vcc as the analog reference, which involves turning on
a transistor in the chip that connects AREF to Vcc - this transistor is not designed to take large currents - it expects
AREF is only connected to a decoupling capacitor.

If you call analogReference(EXTERNAL) then analogRead() will let AREF float (assuming that there is an external
voltage reference).

Thanks for the replies. That makes sense now, I didn't think of the voltage varying. I've done two more diagrams to see which one is the best one to go with? However, the more space I can save the better so if the first possible solution is legal this will be great.

I imagine that before I solder or do anything I need to load the Nano with a semi-blank sketch with analogReference(EXTERNAL) called within the setup() before I start powering the board, etc.

Please note that the voltage regulator is a 3.3v TO220 package.

Yes the first one should work. It will be using the voltage regulator in the USB / serial chip.
The second one needs capacitors on the input and output of the regulator to work correctly and possible a 1K load resistor as well.

Thanks, I'll try the first proposed circuit, but may go with the second option if it takes the strain off the Arduino board it's self. There will only be a DHT22, light sensor, DS1307 date and time and micro sd card reader connected. My last version of this used a 5v regulator combined with two 0.1uf capacitors to help eliminate AC spikes, and worked okay. However this was the main live feed and not a constant voltage to the Aref.

I've attached another diagram for my second option with capacitors to check if its okay.

No the capacitors should be on the input AND output of the voltage regulator you only have it on the input.

With this system you are not going to get any more accurate than your regulator on the arduino board.

What you want is a "precision voltage reference" google those words for the many you can choose from. I would advise a 3V3 one.

Thanks, will google it when I've finished some other work.

I've just had a thought, if I apply the analog reference with 3.3 volts, will this affect my DS1307 real time clock as it uses the I2c analog connections at 5v (pull-up)?

daz1761:
Thanks, will google it when I've finished some other work.

I've just had a thought, if I apply the analog reference with 3.3 volts, will this affect my DS1307 real time clock as it uses the I2c analog connections at 5v (pull-up)?

The I2C bus isn't analog - it happens to use the same pins that's all. The analog pins accept voltages
in the range 0V to Vcc, but voltages above Aref just read as 1023 (no problem putting 5V on a pin
if Vcc is 5V)

The I2C bus isn't analog - it happens to use the same pins that's all. The analog pins accept voltages
in the range 0V to Vcc, but voltages above Aref just read as 1023 (no problem putting 5V on a pin
if Vcc is 5V)

Thats good to know. I can at least try out my first proposed fritzing diagram if thats the case.

What you want is a "precision voltage reference" google those words for the many you can choose from. I would advise a 3V3 one.

I had a search for what you say and I'm not 100% sure if I found the right component, and where and how would I connect it to my circuit?

http://uk.rs-online.com/web/p/voltage-references/7618285/

Yes that would work, just down load the data sheet for the circuit but basically it is like a voltage regulator.
However it is surface mount you can get through hole parts.

I've had a look at the data sheet, but unsure what the DNC and SHDN pins are. Also what would I solder it to? I've had a search on ebay, but cannot find any shield/board that will take smd's.

http://docs-europe.electrocomponents.com/webdocs/10ed/0900766b810ed89e.pdf

but unsure what the DNC and SHDN pins are.

It says on page 2
DNC = Do not connect so it goes no where.
SHDN = Shut Down - it has a bar over it which means connect it to ground to make the chip shut down - do not connect this either.

Also what would I solder it to?

It has 0.05" pin spacing so there are lots of choices.
You can cut normal 0.1" strip board. A sharp knife between the holes will divide the 0.1" strips into two 0.05" strips.
Or you can get 0.05" spaces matrix board.
Like this:-
http://www.ebay.co.uk/itm/Lot-of-5-SOIC8-MSOP8-Breakout-Boards-with-Header-pins-/180849354498?pt=LH_DefaultDomain_2&hash=item2a1b762702

Thanks :slight_smile:

Shame theres not a UK seller selling the SOIC8/MSOP8 break-out boards. Same with the actual precision voltage ref as RS want a fiver for postage :frowning:

Will my soldering iron be ok with this component? Its an Antex 15W with a ref 10 (0.5mm) tip.

Also, I was wondering what the difference is between these two voltage ref's. The only difference I can see is the price and slight change in the model number?

http://uk.rs-online.com/web/p/voltage-references/7618289/

http://uk.rs-online.com/web/p/voltage-references/7618285/

Shame theres not a UK seller selling the SOIC8/MSOP8 break-out boards

Lots here:-

But why not use wire ended parts:-

Ok, its been a while but I have sourced what I need for the job, but after looking at the data sheet I'm unsure what pins are what as the precision voltage refs have a beveled circle in one corner and the data sheet has a grey strip across one side from its 'top view'.

http://uk.rs-online.com/web/p/voltage-references/7618285/

http://docs-europe.electrocomponents.com/webdocs/10ed/0900766b810ed89e.pdf

Grumpy_Mike:

Shame theres not a UK seller selling the SOIC8/MSOP8 break-out boards

Lots here:-
http://uk.farnell.com/jsp/search/browse.jsp?N=203295+110401166+110401676+110401507+110590042+110403336+110403774+110403432&No=0&getResults=true&appliedparametrics=true&locale=en_UK&divisionLocale=en_UK&catalogId=&skipManufacturer=false&skipParametricAttributeId=&prevNValues=203295&mm=1003796||,&filtersHidden=false&appliedHidden=false&autoApply=true&originalQueryURL=%2Fjsp%2Fsearch%2Fbrowse.jsp%3FN%3D203295%26No%3D0%26getResults%3Dtrue%26appliedparametrics%3Dtrue%26locale%3Den_UK%26divisionLocale%3Den_UK%26catalogId%3D%26skipManufacturer%3Dfalse%26skipParametricAttributeId%3D%26prevNValues%3D203295

Last time I looked, the SMD adapters that Farnell had were mostly the Roth Electronik ones with stupidly high prices. Proto-pic has some of the Sparkfun SMD adaptors at more reasonable prices, see http://proto-pic.co.uk/Breakout-Boards/adapters/.

the SMD adapters that Farnell had were mostly the Roth Electronik ones with stupidly high prices.

Yes I would agree with that.
I find the suppliers on eBay from China are very competitive on price and quality in this area.

Not only that but you have substantial postage costs with RS and Farnell also.

So can anybody help me with the pin ins and outs from the data sheet I posted earlier? The beveled circle is positioned in the corner of the voltage regulator:

http://docs-europe.electrocomponents.com/webdocs/10ed/0900766b810ed89e.pdf

Pin 1 is where the circle is. The data sheet shows a chamfer along the left edge of the chip, that is not so common but not altogether unknown.

You only need connect three pins.
Pin 2 The input voltage to 5V
Pin 6 The output voltage to Vref
Pin 4 Gnd to the arduino ground
Also add the two capacitors as shown on page 1 of the data sheet.
All the other pins leave unconnected.