Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review Resistors Value #2

Open
tonyqui opened this issue Dec 5, 2018 · 1 comment
Open

Review Resistors Value #2

tonyqui opened this issue Dec 5, 2018 · 1 comment

Comments

@tonyqui
Copy link

tonyqui commented Dec 5, 2018

According to the reported voltage values and assuming that R2 = 1KOhm, it looks more precise to set R1 to around 520Ohm, to have a voltage of 3.3Volts between D4 and D5.

A R1 = 480Ohm resistor will force 3.37 Volts between D4 and D5, when the sensor outputs 5Volts
A R1 = 500Ohm resistor will force 3.33 Volts between D4 and D5, when the sensor outputs 5Volts
A R1 = 520Ohm resistor will force 3.289 Volts between D4 and D5, when the sensor outputs 5Volts

Is there any specific reason behind the fact that this design exceeds the 3.3V safe level reported in electron datasheet?
On top of that, as long as D-pins are digital only, It does not make any difference if you have an high voltage of 3V instead of 3.3V (I think the digital threshold should be above 1.75V). This is just a remark in case you want to remain on the safe side without exceeding constructor's recommendation.

Cheers,
Antonio

@tonyqui tonyqui changed the title Review Resistance Values Review Resistors Value Dec 6, 2018
@tonyqui
Copy link
Author

tonyqui commented Dec 23, 2018

Evidence is provided also in official documentation:
https://www.electronicwings.com/particle/ultrasonic-sensor-hc-sr04-interfacing-with-particle-photon

Using R1 = 2*R2 gives in output 3.3 instead of 3.37. Moreover, it believe it makes sense also to scale down this a little bit more around 3, due to the digital input on the board.

The library itself implemented by Particle, is simply checking if the pin is in high status:

"The time for which the echo pin remains high, i.e. the width of the Echo pin gives the time taken for generated ultrasonic sound to travel to the object and back."

and due to the digital sampling, a value >1.75 should be already considered as a True/high value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant