3

I'm working with Arduino Due and I have a sensor that outputs a square signal with voltages in the range of 0-5V.

In the Due specs there is a warning that says:

"Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V. Providing higher voltages, like 5V to an I/O pin could damage the board."

Is it possible to connect it to the board?

Thanks.

1

1 Answer 1

2

This is a tough one. If it was digital IO sensor, a simple level shifter would suffice. However, since it's analog, you have limited options.

The cheapest route (and the easiest) would be to use a voltage divider. They only take two resistors, and they divide linearly. That means 1/2 of 5V would be divided into 1/2 of 3.3V. You can then use the full range of the Due (be careful not to use 0-1023, as it has a 12 bit ADC: it'll give you weird numbers).

More on voltage dividers. Even more on voltage dividers.

To build one:

From Sparkfun (link at bottom)

That's four different ways to build one. R1 would be 1700 ohms and R2 would be 3300 ohms. Vin would be from the sensor and Vout would be to the Due.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.