Apart from Arduino Due, all Arduino's that I am aware of have an ATmega running @ 5V(DC). Check the Arduino product page Arduino Nano where it clearly states "Operating Voltage (logic level) 5V".
Apart from that many Arduino boards have a 3V3 regulated output that can be used to supply an external circuit when required.
External circuit output voltage \$V_{OH}\$
When you attach a logic circuit to this 3V3 power rail, the outputs usually swing between near 0V to near 3V3 (unloaded) but you have to check the specific datasheet for exact voltages (usually called \$V_{OL}\$ and \$V_{OH}\$. It is clear from the above that any ATmega will have no problem recognizing a '0' signal, doubt comes with a logic '1'.
So the real question is: Does ATmega recognize 3V3 as a logic '1'? Again the answer is in the datasheet for the ATmega on your Arduino.
I didn't check all variations of ATmega that Arduino's come by, I picked the first datasheet I found: ATmega168. Chapter 29 has "Electrical characteristics". The symbols for "Input high voltage" you want to check are labeled \$V_{IH}\$ and there seems to be plenty of choice ( |1|2|3), but if you read carefully you'll notice that only the first two lines are relevant for GPIO pins on Arduino.
Input HIGH sensitivity \$V_{IH}\$ for Arduino's ATmega.
- Condition at the bottom for \$V_{IH}\$ is met: \$V_{CC}=2.4V - 5.5V\$, the ATmega has a 5V supply, so let's continue focussing at the bottom of those boxes
- Minimum \$0.6V_{CC} = 0.6 × 5V = 3.0V\$
- Maximum \$V_{CC}+0.5V = 5 + 0.5 = 5.5V\$
To answer your question: Will 3V3 logic outputs (or the regulated 3V3 supply rail) work with standard Arduino inputs?
- yes it is safe to connect 3V3 from the Arduino board to an input, because the voltage is lower than 5.5V;
And when attaching external circuitry:
- yes; as long as the output \$V_{OH}\$ of the external circuit is higher than 3.0V.
Word of warning: Be aware that the controller pin must be configured as INPUT, otherwise you may exceed maximum current for the pin and you'll damage the controller. When experimenting it is safer to connect a \$330\Omega\$ resistor in series with the inputs.
Glossary
Let's throw in a short, slightly trivial glossary while I'm busy:
- \$V_{OH}\$ Voltage Output High
- \$V_{OL}\$ Voltage Output Low
- \$V_{IH}\$ Voltage Input High
- \$V_{IL}\$ Voltage Input Low
It sounds like you have a mistake in your firmware (program). What I mean is that you run through the "Send whatever to bluetooth module" once and then not again.
It should look something like this in your program:
while(1) // Forever and ever since 1 won't change.
{
Read whatever from accelorometer();
return xy;
Transmit to bluetooth(xy);
}
Best Answer
The ACS712 datasheet says:
So as long as the resistance on the output is bigger than 4.7kΩ it is safe.
Any voltage can be stepped down using a pair of resistors in series. This is called a voltage divider. In this case (5V down to 3.3V) it would ideally have a ration of 5:3.3 However, for simplicity this shows 5v to 3V, using standard resistor values
simulate this circuit – Schematic created using CircuitLab
That has a total resistance of 2.2kΩ+3.3kΩ = 5.5kΩ, so enough above 4.7kΩ to be okay.
If you assume the same current flows through R1 and R2, then the current through R1 and R2 is:
So the voltage across R2
That could be slightly improved by getting the ratio of the two resistors closer to 5:3.3. However, that is only 10% off, and those resistor values should be extremely easy to get.
Further, the arithmetic should be very easy to understand; it is a ratio of 3:5 (2+3).
The power rating (Watts) of the resistors is almost anything; its only creating less than 5mW of heat. Easy to find resistors are usually 1/4 watt (25omW) so almost embarrassingly big enough.
You might increase the resistance of the two resistors overall, but don't lower it below 4.7kΩ.
Edit: Don't increase the resistance of R1+R2 above 10kΩ. The analogue input of the Due needs some current to track the output voltage of the ACS712. My skim of the SAM3X8E datasheet is it will track voltages at all sample rates, with full 12bit resolution for inputs with an impedance of less than 10kΩ.