don't wire ADC to 5v

@NuRxG nobody is talking about shorting 5v to adc except you…

1 Like

Hey I’m talking about…

you know what I don’t know

2 Likes

@NuRxG I’m happy you were able to convince yourself not to short 5v to adc 🤷

1 Like

@NuRxG thanks for actually doing the leg work to look at a schematic and trace down the pin to the data sheet and report an actual tolerance. And to everyone else saying well I did it with this thing that I never looked at the datasheet for and it worked so it must be 5v tolerant, guess what just because you put 5 volts in doesn’t mean that’s what’s coming out on the signal pin. Giving bad advice from a point of ignorance and ripping on the guy that did the work is a jerk move that is going to cause someone to fry their gear.

3 Likes

So, I ran into this issue myself as well. Almost all ebike throttles are 5v halls with a 0.8 to 4.2v range, which means the ADC1 misses out on a bunch of throttle range. This reared it’s head really problematically for me as I am using a “mid point return” thumbwheel throttle which springs back to the middle and holds at about 2.4v. That means I get 0.5 → 2.4 for regen and 2.4 → 3.3 for acceleration (due to the vesc not reading above 3.3). That’s 1.9v of range for regen but only 0.7v of range for acceleration, which makes it feel SUPER twitchy.

Thanks to a quick consult with @kevingraehl I figured out how to wire up a voltage divider so that the return voltage on the signal line is scaled down to 0.3 → 3.0 range. Now I get the full usage of the throttle with both accel and regen behaving at the same scale.

Here’s a photo of how I wired this up:

Some notes:

  1. I only had 1k resistors on hand, so for the 2k section I just ran two in series
  2. This is clearly the most professional job done you’ve seen
  3. Excuse the odd part of mine where I cross the black/green, my throttle is wired wrong and I had to adapt
  4. My diagram is probably not, uh, engineering accurate, but does work

Overall, this does the trick really nicely and I’m happy.

(As a side note, I had a regular throttle hooked up to 5v/GND/ADC1 for eons and didn’t explode vescs as well, but I was clearly losing resolution on them; it just wasn’t as noticeable)

6 Likes

So, heck, why not have some fun and make this a bit nicer.

Send it off the https://jlcpcb.com/ and about 10 days later…

Noice.

6 Likes

You can also “invert” ADC, not sure the exact naming of that feature in the different versions of the software, but it exits, this reverses the throttle direction. So acceleration will be kind of OK, and the regen more twitchy, which could be preferable. Of course if we’re talking about ebike throttle on a handlebar, reversing operation or moving it to the left side isn’t super intuitive… But for your typical thumbwheel or single axis joystick, this reversing works well. You can also compensate some twitchiness through throttle curves, up to a point.

Also most hall effect bike throttles still work fine when fed 3.3V instead of 5V. The output range is obviously different, but once you calibrate the min/max/centre to match it, it does the job just fine. No harm in trying at least.

1 Like

You can also “invert” ADC, not sure the exact naming of that feature in the different versions of the software, but it exits, this reverses the throttle direction. So acceleration will be kind of OK, and the regen more twitchy, which could be preferable

Yeah, I played with doing that briefly but decided that over-engineering this would be waaaay better :wink:

1 Like

If i found this thread a couple weeks later i prolly woulda fried about 300 bucks worth of VESC, thanks everyone :+1:

2 Likes

Fellas.

4 Likes

1 & 2 work well too. Though, really, since the hall’s will only output 4.2 volt at the top, it might make more sense to do 1 and 3.6 together.

1 Like

This is a bold assumption; I would not make this assumption. There are many different kinds of hardware, both the hardware that exists now and new hardware that may exist in the future, plus the known kinds and the unknown kinds.

2 Likes

Yeah, and if my grandmother had wheels, she’d be a bike.

I mean, I get it – if you take my statement out of context from this entire thread, then “halls only ever do x” is, of course, wrong. But, thanks to the magic power of forums, topics, and threads, there’s LOTS of context. Like this, from my very first post in the thread!

Not at all a bold statement, put in context.

2 Likes

Early model 3shul vescs you connect ADC to 5v and the voltage is internally reduced.

1 Like

You edited the post after I “liked” it.

Where does it say that? Not on the image there.

I still see nothing saying it’s okay. It’s not that hard to just ask them.

1 Like

This is true according to @kevingraehl who sold it to me.

I went ahead and asked them, since you seem to have a phobia for no reason at all

1 Like

I wrote them days ago. I got ahold of the guy who sold it to me. No phobia here. And they confirmed what I wrote?

Did u call India?

You got ahold of the manufacturer, or a private seller?

The manufacturer replied and states 5V input voltages are fine on the 3shul ESC