this post was submitted on 18 Jun 2023
9 points (100.0% liked)

Ask Electronics

3316 readers
1 users here now

For questions about component-level electronic circuits, tools and equipment.

Rules

1: Be nice.

2: Be on-topic (eg: Electronic, not electrical).

3: No commercial stuff, buying, selling or valuations.

4: Be safe.


founded 1 year ago
MODERATORS
 

Solution

Using an open drain buffer like the 74LVC1G07 did the trick. Note that this part only works for inputs with a pull-up resistor. There are other parts from the same lineup that can work with any input.

Problem

I have an ebike computer that has two inputs that accept square wave signals. The range is 0-5V. One of the inputs has no pull-up/down resistors on it. When I hook up a device producing signal, the signal is detected correctly. Both highs and lows are detected correctly. The other input has a built-in pull-up resistor. When I hook the same signal to it, only the high side is detected. Measuring the voltage of the low side, it's a bit higher than when hooked to the other input and I'm guessing it isn't crossing the low threshold the computer expects in order to register the low.

Am I right in thinking that the pull-up resistor is increasing the lows?

Is it possible to counteract the internal pull-up resistor by hooking a pull-down resistor to the input?

I'm a software guy with decent soldering skills and minimal knowledge in electronics so please answer like I'm not the brightest electronic bulb on the tree.

Thank you in advance!

Cross-posting my question from StackExchange.

top 7 comments
sorted by: hot top controversial new old
[–] dack@sh.itjust.works 4 points 1 year ago (1 children)

Do you have a good low impedance ground connection between the devices? This sounds like there is something else going on.

[–] lightrush@lemmy.ca 1 points 1 year ago* (last edited 1 year ago)

Looks like it. I measured the cable and I got .1-.2 Ohms on every pin, ground included. I replaced both the computer and the sensor device in question with new units and the behavior is the same.

I got an interesting solution proposed in StackExchange - to use a buffer instead of messing with the pull-up. I ordered some parts to try it out.

Do you have any idea what "open drain" means in the context of buffers?

[–] hardware26@discuss.tchncs.de 4 points 1 year ago (1 children)

Problem you are having could be

  1. output impedance of the signal generator you use to generate the square wave. When you set it to low, output impedance of the signal generator builds a voltage divider together with the internal pull up, and the device ends up sensing a higher voltage than "low". This is something you can see if you have an oscilloscope, try to hook up a probe to the input and ensure whether you get what you set in the signal generator.
  2. some signal sources have no or limited capacity to drain current. And when you set it to low, this is exactly what it us supposed to do, drain current from the internal pullup.

As you mentioned in another comment, solution is a simple buffer. This could be an opamp, but even a simple nmos transistor should suffice (open drain as you said). But you need yo be careful with current ratings of the transistor, which you can easily calculate by dividing 5V by the pull up resistor. Send a message if you need help.

Before these, I suggest you yo use an oscilloscope or multimeter to measure the voltage when it is supposed to be low, and see that in fact the problem is that voltage at the input doesn't go "low".

[–] lightrush@lemmy.ca 2 points 1 year ago* (last edited 1 year ago) (1 children)

Thanks for the explanation!

I measured the signal generator alone, not connected to the input. It goes to 4.5V high and 0.001V low. Then I connected it to the input and measured at the input. I got 4.5V high and 1.1V low.

Also I ordered the 74LVC1G07 buffer along with a breakout board which should allow me to hook it up inline and test. I'll report back when I do.

[–] hardware26@discuss.tchncs.de 3 points 1 year ago (1 children)

It should do the trick I think. If you are working on electronics a lot, you may consider buying a breadboard and variety of resistors, capacitors and nmos, pros, bjt transistors in bulk for quick fixes instead of waiting for orders to proceed. Have fun

[–] lightrush@lemmy.ca 2 points 1 year ago* (last edited 1 year ago) (1 children)

It works!

I just built this monstrosity, tested and the signal is correctly detected by the computer. 👌

Now I just need to wire it properly.

[–] hardware26@discuss.tchncs.de 2 points 1 year ago

Well done, good to hear

load more comments
view more: next ›