Help converting the pot from bills pwm to a Hall effect

Discussion in 'The Projects Forum' started by bytraper, Mar 29, 2011.

  1. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    I've built Bills PWM unit on a small breadboard and it's pretty good but I'd like to control the pwm duty cycle with a 0.8-4.5v Hall effect throttle rather than the standard 10k pot.

    I don't know enough to hook it directly to the circuit and don't want to blow anything up but I need some help because I'm not sure exactly how to hook it up correctly and what resistors i need to add/change?

    Would someone be kind enough to help?

    Here is the diagram of what I have so far! Any Help Appreciated!

    [​IMG]
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    Thankee Kindlee. I'm not too familiar with Hall Effect switches. The key is to convert it to a variable voltage, once you are there you can massage it with op amp circuits to get the max and min that you want.
     
  3. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
    Hello,

    Do you have a datasheet of the hall sensor?
    As known the two limits of the PWM circuit are 1/3 Vcc and 2/3 Vcc,
    so if Vcc is 5 Volts as in the given schematic => 1.6666 - 3.3333 Volts.
    The output of the sensor must be adapted to this range.

    Bertus
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    This is similar to Bill's circuit, but replacing the 555 timer with one of the unused comparators.

    See the attached.
     
  5. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    So a hall effect sensor comes out with a variable voltage already? How do you set the endpoints?
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Apparently, the output range is established by the manufacturer.
    I just adapted a circuit I had to his output range.
     
  7. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,689
    901
    Aren't pins 5&6 already a comparator input? Why add another?

    [​IMG]

    I admit, this is more for my education than to answer the OP's question, but it is really not that far OT.

    John
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Not a bad question, John.

    Actually, I'm completely replacing the 555 timer with a comparator, so there is just one IC.

    The 555 actually does have a couple of comparators inside for the threshold and trigger levels. Transistorized 555's also have a voltage divider comprised of three 5k Ohm resistors in series, from Vcc to GND; for CMOS the resistance is more like 100k. At any rate, this voltage divider establishes the threshold and trigger levels at 1/3 and 2/3 Vcc.

    The top junction of the resistive divider is accessible via the CTRL pin. Unfortunately, the lower junction is not accessible externally. If it were, a pull-up resistor could have been connected from CTRL to +V, and a pull-down resistor from the lower junction to GND in order to match the input voltage range.

    Now, our OP could go ahead and use Bill's circuit as-is, replacing R4/R5/R6 with his Hall-effect sensor, but there is a mismatch in voltage ranges.

    The default 555 trigger/threshold levels being 1/3 and 2/3, low being 1.667v and upper being 3.333v in this case for a 5v supply, there would be very significant "dead zones" between 0.8v to 1.667v, and 3.333v to 4.5v, while the center of the range may seem to be overly sensitive.

    The circuit I proposed may have a somewhat higher parts count with the "extra" resistors, but will allow for the Hall-effect sensor to control the PWM over it's entire output range. Resistors are quite inexpensive and can have small "footprints" compared to ICs.
     
  9. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    Hi Guys,
    thanks for the great responses!
    Sarge is that circuit capable of Square wave output? and looking at your diagram, what frequency does this circuit run at? Can it be made adjustable like Bills?

    Also, if I were to swap out the Hall effect sensor for a Potentiometer, what would I need to add in that circuit that you posted? Some resistors at hallred and hallblk ?

    This would actually work out well because as you said It may have a few resistors but I could remove the ic.

    Thanks for the great help so far!
     
    Last edited: Mar 30, 2011
  10. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    So a hall effect sensor comes out with a DC voltage proportional to the magnetic field?
     
  11. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,689
    901
    Some Hall sensors have proportional outputs. Others are designed for switches and either latching or non-lathing varieties are available.

    John
     
  12. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    The hall effect throttle I use is the same as the Chinese throttles for toy electric scooters, its a 5v unit, and when you apply power to the red and earth the black, the green wire is a wiper that outputs from 0.8v to 4.5v.

    But to answer your question, for this type of controller I believe so.

    I'm running the entire circuit at 5v by using a LM7805 to power the pwm circuit that's your design, the only change I made was to add a 10uf cap which by trial and error I noticed cleaned up the output pwm signal.

    The fact that there's a pot on there solves half the problems, which was why I was looking to also have the option to fit a hall effect throttle which would solve the other half. Your circuit puts out a square wave, is frequency adjustable and gives 0-100% duty cycle, ultimately for my controller its nearly perfect :)

    I was also interested in Sarge's design because what he said about the voltage mismatch was right, but until I can get more information on the square wave out (pwm), frequency adjusting and if it can have a pot, i wont know for sure if it will be suitable for my controller.
     
    Last edited: Mar 30, 2011
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes. See the "Out" label below R6? That's where the PWM signal comes out.

    With C1 and R5 at the values shown, about 600 Hz.

    Frequency adjustable? Yes. Replace R5 with a potentiometer wired as a rheostat (just one of the ends and the wiper connected) of around 100k, and a 4.7k resistor in series with the pot. With the pot set to the lowest value (0 Ohms), the max frequency would be around 5.8kHz, lowest around 300Hz.
    If you wanted to go higher in frequency, replace C1 with a smaller value. 1nF (1,000pF) and R5=4.7k would be around 55kHz.

    A single 10k to 100k pot would work; wiper connected to HallGRN, and the "ends" connected to HallRED and HallBLK.

    Be sure to ground the inputs on the unused comparator channels.
     
  14. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    Does this look right?

    I'm sorry my LtSpice skills are non existent, but this is a topic that comes up again and again and what you've described here will help a lot of people so I drew it.

    One question though, how can you adjust the starting point of either the hall effect throttle or the pot? What do I add for this ?

    [​IMG]
     
    Last edited: Mar 31, 2011
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    What do you mean, the "starting point"?

    The circuit I originally posted was specifically for your Hall-effect sensor.

    If one wanted to change the "Tri" wave so that it toggled between 1/3 and 2/3 Vcc, then R3 would need to be changed to 100k.

    Going back on my earlier recommendation, if you want to make the frequency adjustable, decrease C1 to 1nF, and use a 1MEG pot and 47k resistor in series like you have in your modified schematic.

    I don't know where you got the 5n6 number from.
     
    Last edited: Mar 30, 2011
    bytraper likes this.
  16. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    Hey Sarge,
    I have updated the schematic to reflect your changes.
    It's not just MY hall effect throttle, 95% of the throttles used for scooters and quads and go-karts use an identical throttle. I Have a dozen different throttles here and all of them have the exact same voltage range. So it's not just a one off!

    What you have designed here is something that many people will be able to use and benefit from. Search Google and you will see what I mean. This is a fantastic, yet clean design, and thanks to the frequency adjust can be used for a variety of different purposes! Plus with a duty cycle of 0-100% its a very useful PWM generator.

    Thanks for your constructive design and input! I'm sure a lot of people will make use of this and appreciate your hard work!
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, I see where you're going with this.

    Also, I wasn't clear in my prior post. I meant to say, change VR1, from a 100k pot to a 1MEG pot, and change R5 from 4.7k to 47k.

    Or basically, rename R7 to R5 like it was originally, remove the 1MEG fixed resistor that you have labeled as R5, and change VR1 to 1MEG.

    If this is actually going in a scooter, I'd suggest getting the PWM to work at a reasonably low frequency, and then replace the 1MEG pot with a fixed resistor.

    The PWM circuit I posted is not adequate to drive a MOSFET gate at more than a low frequency. If the existing controller has a MOSFET gate driver, that gate driver should be used.
     
  18. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    Ok, I've updated the schematic to fix my misunderstanding.
    This will be going into my controller to replace the current PWM generator that's there which is unreliable. But I think this will be a popular circuit, god knows I searched for a long time for something like this and all I could find was bill's one which I didn't know how to adapt for a hall effect. But as I searched I came across a lot of other people wanting the same thing!
    Thanks Sarge.
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The LM2903 would be a better choice than the LM393, as it's rated for automotive service, where the LM393 is not. Basically, it would be more heat-resistant. It's pin-compatible with the LM393.
     
  20. bytraper

    Thread Starter Active Member

    Sep 28, 2010
    126
    4
    The circuit is Working perfectly!
     
    Last edited: Apr 12, 2011
Loading...