Old Grey wrote: ↑
Sun Apr 01, 2018 12:49 pm
Someone on FB is having a problem and we can't workout the drawing exactly., ie it says pullup but it's pulling float to GND, and the reversed diode, unless it's a 5V Zener.
+1 to Weaver's response. Perhaps outline the issue here or in it's own thread. The only time this would present a problem is if the input device (sensor, module, etc.) had an active high greater than 5V, such as +12V (expected, and purpose fo the circuit), but had only an inactive float without ever going to ground (device output +12V-to-float, never grounding). In that case a much 'stronger' pulldown must be used to pull the input lower against the 5V pullup when the device is not high. I would just suggest the Speeduino 5V pullup resistor be 10k and the pulldown in the circuit be 1k to 2.2k max (10-20% of pullup value). This would ensure the float state was pulled to a voltage low enough through the diode to be seen as a low by Speeduino. I don't know what he's using, so testing the final input voltage levels before connecting the Mega would be a good idea to be sure it's all together and working as-expected.
: The two things to be careful with here are 1) the current can become quite large without a small 10k pullup (the 1K pullup on some boards will pull ~30mA from the weak regulator and 1/4W of heat constantly
), and 2) the diode forward voltage means the pullup will not ever be pulled completely to ground. This is OK as Speedy only needs it to be lower than 1.2V for a low, but the pulldown must be a balance of small enough to pull diode Vf + divider voltage = <1.2V, yet large enough the active high will be enough to reach at least 3.3V high on the Speeduino side of the diode.
If all that poor hairball explanation isn't making enough sense for him, and his device is only
outputting +12V and float (no grounding), just tell him to try the 10k pullup/1K pulldown suggestion above.
Again, I don't know what he's using, so testing the input voltage levels before connecting the Mega would be a good idea to be sure it's all together and working properly.