5V and 3.3V and aref

Dear Arduino forum people,

First time posting, sorry if I do something wrong.

For a project I'm using a accelerometer (GY-61) that uses 3.3V with the AREF.
I'm also using a bluetooth module that uses 5V. Can I do that? Will it blow something up?

I use this code to use AREF:
analogReference(EXTERNAL);

Hopefully someone can help me.

PS: I'm a total n00b!

kasszz:
Can I do that?

Yes

You can do that only if you switch the voltage on the AREF pin. Whatever you set for analogReference() is connected to the AREF pin. If you connect the 3.3V regulator to AREF and use analogReference(DEFAULT); that will connect the internal default +5V reference to the output of the 3.3V regulator and BAD THINGS WILL HAPPEN.

I think your best bet is to use only the DEFAULT (+5V) reference and live with the same (roughly) 5 mV resolution when measuring both voltage sources.

Sorry, I don't understand it completely. I have my AREF connected to the 3.3V of the accelerometer. The bluetooth module uses 5V and only digital outputs. I use the analogReference(EXTERNAL); so that it will use the 3.3V.

can I just connect the bluetooth to the 5V and ground and use the digital pins or is that bad ?

kasszz:
can I just connect the bluetooth to the 5V and ground and use the digital pins or is that bad ?

Yes, you have to connect the grounds. If the module needs 5V, then you can use the 5V pin.

But why are you (thanks for replying btw :slight_smile: ) saying that it's just possible and johnwasser says that there could be a big problem ?

kasszz:
But why are you (thanks for replying btw :slight_smile: ) saying that it's just possible and johnwasser says that there could be a big problem ?

John is explaining you need to be careful when connecting an external voltage to AREF. If you do not call analogReference(EXTERNAL) before your first analogRead(), you may cause damage.

Since the step resolution from the default 5V reference to a 3.3V reference is 4.98mV vs 3.2mV, it calls into question if you should bother changing AREF at all.

In other words, just because your accelerometer is running on 3.3V and it's max output may be 3.3V, you don't have to use 3.3V for AREF.

Oohh, okay. Then I'm good to go, thanks a lot for the quick replies :slight_smile: