Maker Pro
Maker Pro

Micro controlling resistance

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
Thank you Bertus,

I’m testing the solution Alec_t has provided I think this is the best approach if 100hz PWM freq works? With his solution it has much lest foot print so I can easily put it in my PCB.

thanks for the siggestion and I’m sure if I do not get any success with the MOSFET, I will be trying my solution so I will be looking for a package for transistors.
Thank you.
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
So I can go through the range, would this be ok for the cct suggested?

 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
Hello,

If you want to make the multi resistor approach, as in post #13, you might want to have a look at the TBD6208X series.

Bertus

Bertus, Are you suggest to use TBD6208 in a way like I have attached. I already use 4 bit shifters linked together and having this one linked on the end would take much doing! I prefer the solution Alec_t provided and I'm currently waiting for the parts to arrive. I am also waiting for his advise on if a 100Hz Duty Cycle will be ok, would like him to run it through his fancy Simulation and let me know.

But if the 100Hz is not fast enough I can get it to 130Hz but I do not want to change all my PIC timers as this controls the ECAN, PWM, scheduling etc.. so to make these changes would be a complete overhaul of the code. So I might then come back to my solution of the bit shifter. Your advise is welcomed on my design. Although I haven't attached it to the end of the 4 others,I just wanted to see in principle is this what your suggesting?

Also do i need to put current limited resistors on the input of the TBD62083. In the datasheet and search I have done i think it says it has a 2.7k resistor? is this correct?

Thank you.
 

Attachments

  • BSSelectSol2.png
    BSSelectSol2.png
    180 KB · Views: 2

bertus

Moderator
Nov 8, 2019
3,304
Joined
Nov 8, 2019
Messages
3,304
Hello,

Pin 10 of the TBD is for protection when an inductive load is used.
You can leave it open for now.

Bertus
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
brilliant, so I take it I can leave the resistors off the input then? So i have these on order, coming tomorrow so this is my backup. I do rather Alec_t solution and want to try that purely due to footprint, but at least my backup will work. Will test both solutions anyway for my understanding and knowledge base. I have been looking for a solution like this for different applications so it would be worth knowing both solutions work.

Thank you for your time and help.

Please see revised schematic, will this work then?BSSelectSol2.png
 

bertus

Moderator
Nov 8, 2019
3,304
Joined
Nov 8, 2019
Messages
3,304
Hello,

The TBD chips have a clamping circuit inside.
They can be connected directly to the 595.

Bertus
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
I am also waiting for his advise on if a 100Hz Duty Cycle will be ok, would like him to run it through his fancy Simulation and let me know.
I don't know how your gauge would respond to a large 100Hz (or 130Hz) ripple on its input. It will probably hum at you :). It might have enough inertia (assuming it's a moving coil type) to average the varying PWM satisfactorily, mechanically. If not, to reduce the ripple to the amount present in the 1kHz simulation would mean increasing C1 to 5000uF ! Can you experiment by eliminating C1 and using any transistor you have on hand to drive the gauge input with 'raw' PWM (no smoothing) ?
Btw, the gauge scale percentage is a very non-linear function of the PWM duty cycle, so you'll probably need a look-up table in your software.
 
Last edited:

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
Thank you Alec_t. So the answer is test it and see!! This is my sort of building :) !
I have the parts arriving tomorrow so i'll build the suggestion and try that, and if it doesn't work hopefully you're around to give me some guidance.
The gauge is not quick, even when changing the resistor values on the Resistor box, I had to wait 2-6 seconds for the gauge to respond and reach the desire output.
The 5000uF Cap is probably not feasible, due to size and footprint. So at 100hz, if this don't work is my best solution the Bit Shifter cct that I came up with and had help from Bertus?

Jason
 
Last edited:

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
I had to wait 2-6 seconds for the gauge to respond and reach the desire output.
If the gauge is some sort of heated element device then I suspect it won't mind in the least having a raw PWM input signal and the cap would be redundant. Give it a try.

Edit:
Sounds as though the gauge is this type. If so, no cap needed.
 
Last edited:

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
If the gauge is some sort of heated element device then I suspect it won't mind in the least having a raw PWM input signal and the cap would be redundant. Give it a try.

Edit:
Sounds as though the gauge is this type. If so, no cap needed.

Thank you, I'll try the circuit you suggested tomorrow, with and without the CAP. Lets hope we have success.
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
If the gauge is some sort of heated element device then I suspect it won't mind in the least having a raw PWM input signal and the cap would be redundant. Give it a try.

Edit:
Sounds as though the gauge is this type. If so, no cap needed.


Alec_t, Thank you,worked a treat. See You tube video. although between 50% duty to 95% Duty is only on the top 1/4 of the gauge, there is enough resolution for the gauge some meaningful display.

Can I ask for your help, one last time. Now I have done the Fuel Gauge and that seems to work fantastic, can you help me with the resistor values for the Water temp gauge.

The values are below;

Water Temp Dispay Ohms Voltage
120 -> 40Ohms -> 2.08V
110 -> 50Ohms -> 2.36V
100 -> 70Ohms -> 2.77V
90 -> 90Ohms -> 3.08V
85 -> 100Ohms -> 3.21V
80 -> 140Ohms -> 3.57V
75 -> 160Ohms -> 3.70V
70 -> 200Ohms -> 3.90V
65 -> 220Ohms -> 3.98V
60 -> 280Ohms -> 4.16V
50 -> 400Ohms -> 4.38V
40 -> 600Ohms -> 4.58V

If you could advise what resisitor would replace the 10Ohms and 2.2K that would be great. I can final mark this off my list.

Thank you

 
Last edited:

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
You could use 39 Ohms (a standard value) instead of the 10 Ohm resistor. (But the 10 Ohm would do; just needing a reduced duty cycle to get the same effect as 39 Ohms). The 2.2k stays the same.
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
Try 39 Ohms (a standard value) instead of the 10 Ohm resistor. The 2.2k stays the same.
Thank you. Been checking this all morning lol. Going to try it now.

Would love to know how this is worked out. Not that intelligent! lol

Thank you for your help, it is so appreciated.
 

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
Would love to know how this is worked out.
I just used the minimum resistor value in your post #32 list. The value isn't critical, but shouldn't really be zero in case the gauge throws a wobbly (it probably wouldn't) and also to protect the MOSFET in case the gauge somehow got short-circuited. Whatever resistance is used you are going to have to do some calibration so that you know what duty cycle corresponds to what gauge reading (be that fuel or temperature).
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
I just used the minimum resistor value in your post #32 list. The value isn't critical, but shouldn't really be zero in case the gauge throws a wobbly (it probably wouldn't) and also to protect the MOSFET in case the gauge somehow got short-circuited. Whatever resistance is used you are going to have to do some calibration so that you know what duty cycle corresponds to what gauge reading (be that fuel or temperature).

Thank you, Without getting into the fundamentals on how MOSFETs work and the architecture of the make up of MOSFETs I think I understand. Controlling the MOSFET to allow a current to pass through it (via Ohms Law) shows the MOSFET as a resistive state (I think.....!!)

I know this might not be technically correct and I don't pretend to have the foundation knowledge of all this, and hopefully this is why we have forums and experts who give there spare time to help dumb-nuts like me. Just like to thank all that help.

Stay safe all.

Jason
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Without getting into the fundamentals on how MOSFETs work
There definitely is some theory behind this.
Controlling the MOSFET to allow a current to pass through it (via Ohms Law) shows the MOSFET as a resistive state (I think.....!!)
In an application as this one, a MOSFET can be considered as a switch with a very high off resistance (for practical purposes: infinite, although there will be a small leackage) and very low on resistance (rdson, depending on the type of MOSFET, see datasheet). The switch is controlled by the gate-source voltage Vgs (to be a bit more precise: the difference between gate-source voltage Vgs and gate-source treshold voltage Vth). For an N-channel MOSFET (N-MOSFET) which is typically used in such an application the switch is off if (Vgs-Vth) > 0 V and is off if (Vgs-Vth) < 0 V. Note: the difference should be more than 500 mV, better 1 V or more for secure switching.
For a P-channel MOSFET polarities are reversed.

All theory aside: think of the MOSFET here as a switch.
 

huttojb

May 3, 2015
52
Joined
May 3, 2015
Messages
52
Thank you Harald for the explanation.

tested the water gauge and all working fantastic

 
Top