Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with voltage divider for boat trim sensor

Status
Not open for further replies.

Gort

New Member
Hello all,
I am trying to get a boat trim sensor and meter configured, this is a 12 V DC system. The sender that attaches to the trim unit is a potientometer, and shows 145 ohms at “full up travel”, and 62 ohms at full down. The meter requires 0v at full up and 8.5 volts at full down.
I created a voltage divider with a 500 ohm pot for adjusting the range, and I get the best results at about 122 ohms, but I am only getting about 60% of the indication on the trim meter (basically a voltmeter).
Somehow I need to increase the scaling, as I am stuck with the sender on the pot. Not sure how to proceed. TIA.
2E2A2EFD-9058-438D-B92F-F0B759A56B8F.jpeg
FCF91348-F023-43A8-8AC2-AEACD0F97285.jpeg
A41D82E0-10F8-4567-863F-3429A8D4B752.jpeg
707751A9-2504-435E-B179-A432F8C70451.jpeg
 
I'll look at the rest of this tomorrow. In the meantime, crutschow may have an opamp circuit suggestion. I have not purchased any for a while and with global supply issues I don't have a good candidate off the top of my head. One more question: are you going to fabricate one on a breadboard or are you going to layout a printed circuit board. I ask because SMT parts can be hard to work with on a breadboard and most available parts come in those packages.
I will use a prototype board and a dip socket chip, never tried to solder smt’s. I do like the op amp circuit, I will learn a lot more from this. I deal with mouser and Allied regularly, am pretty sure they will have what I need. Just checked and even amazon has lm324’s.

I like the simplicity of the resistor based design, but I think I will learn more and have a little fun doing this with the op amp circuit that crutschow so nicely worked up. I appreciate all of your help, looks like a great group. Thank you.
 
Below is the LTspice simulation of a circuit that should do what you want.
It uses a common, single-supply op amp with a transistor output buffer to generate the 5V to 0V for a sensor resistance variation (Rsender) of 62Ω to 145Ω (yellow trace), to drive the meter (simulated by R_Meter).

I added the common LM317 voltage regulator to generate a constant 9V for the circuit which minimizes any change in the meter output voltage due to variation in the battery voltage.

If you have any problem buying the parts, let us know, as substitutes should be available.

View attachment 137883
Thank you, this is awesome, and will be fairly easy for me to construct with a dip socket device and protoboard. Does the lm317 need much of a heat sink?
 
Does the lm317 need much of a heat sink?
The circuit current is low, so the LM317 will be dissipating no more than about a half watt, which occurs at the maximum battery charging voltage.
If you use the TO-220 case version of the LM317, the case itself will dissipate that amount of heat readily without overheating.
 
Last edited:
Do you understand how to work out the voltages and currents that make the opamp circuit do what it does?
I like the addition of the LM317, mostly because it had not occurred to me. This is what collaboration is all about, and why it is so effective in product design.
 
Do you understand how to work out the voltages and currents that make the opamp circuit do what it does?
Do you mean how to analyze the circuit I posted, or to calculate the needed values?

As I noted, you can calculate the required values without solving any simultaneous equations, but you need to do the calculations in a specific sequence, since the value for the offset resistors affects both the inverting and non-inverting gain, and vice versa.
 
Do you mean how to analyze the circuit I posted, or to calculate the needed values?

As I noted, you can calculate the required values without solving any simultaneous equations, but you need to do the calculations in a specific sequence, since the value for the offset resistors affects both the inverting and non-inverting gain, and vice versa.
I was asking the TS if he knew how to analyze the circuit you posted, in case he has a future need to adapt or change the circuit. I'm confident that you know how to do it.
 
Do you understand how to work out the voltages and currents that make the opamp circuit do what it does?
I like the addition of the LM317, mostly because it had not occurred to me. This is what collaboration is all about, and why it is so effective in product design.
No, I have not learned to do that. I have a cursory understanding of electronics, but am only a mechanical engineer. I built hobby circuits 50 years ago with 2n222’s, 555 timers, 741’s, etc, all with the discrete components and values coming from the diagrams. I know what everything does, know what an r/c circuit is, am an amateur radio op, but have never learned to work the numbers to produce a result. Fortunately, this is where you guys come in, as I am at my limit of knowledge at the moment.
 
Fortunately, this is where you guys come in, as I am at my limit of knowledge at the moment.
So just let us know if you have any problems after you build the circuit and we should be able to resolve those. :)
 
The circuit current is low, so the LM317 will be dissipating no more than about a half watt, which occurs at the maximum battery charging voltage.
If you use the TO-220 case version of the LM317, the case itself will dissipate that amount of heat readily without overheating.
Thanks.
On papabravo’s question about calculating values, since I do not know, which resistor value would control scaling and which would control min or max values if I do need to tweak it?
 
So just let us know if you have any problems after you build the circuit and we should be able to resolve those. :)
Thank you, I am Chip hunting now. Will report back certainly if I have issues and also if it is successful, thank you all again, It’s really great being able to get this level of help. Gotta love the Internet!
 
which resistor value would control scaling and which would control min or max values if I do need to tweak it?
Unfortunately, that relatively simple circuit has an interaction between the scaling and the offset resistors so changing one resistor tends to change both.
If offset or gain needs to be changed, their values would need to be recalculated.
 
Unfortunately, that relatively simple circuit has an interaction between the scaling and the offset resistors so changing one resistor tends to change both.
If offset or gain needs to be changed, their values would need to be recalculated.
Well, it never hurts to ask, not surprised though. Thanks
 
If you want to add some adjustability you could change R6 to a 50kΩ pot and R2 to a 20kΩ pot.
R6 would mostly adjust the offset and R2 the gain, but there will be some interaction between the two.

If you use those pots, set them to near the values shown on the schematic before installing them.

To use them as adjustable resistors, connect the wiper contact to one end of the pot resistance element.
That way, even if the wiper element loses contact, you still have continuity through the resistance element.
 
Not discussed yet is an approach with a micro. Reasons why :

1) Can use A/D and map that data from one domain into another, eg one range with
its offsets into another range with its offsets. Note Arduino has an instruction to do
this.

2) Accurate because of onchip Vref.

3) Manage wiring failures.

4) No adjustment interaction.

5) Easy to add features at a later time thru simple programming. Many boat
systems could benefit from this. Even sophisticated stuff like monitor oil and
water T, even vibration/bearing noise, long term accumulation of trends.....
leading to potential failures, eg. pre warn.....

6) Program the operation using visual programming block languages. Rapid
fast development, used by 5'th and 6'th graders to program robots.

7) Pretty much eliminate T and V variation issues.

8) Cheap, use a $1 part, ATTINY85, expand to a Nano solution later as you add
capability.

1658197564302.png


Just a thought.


Regards, Dana.
 
The learning curve is a pretty big intimidation factor for most folks. It has been 60 years since I wrote my first line of FAP (Fortran Assembly Program) for an IBM 7090, so of course using a micro has always been a cinch for me.
 
The learning curve is a pretty big intimidation factor for most folks. It has been 60 years since I wrote my first line of FAP (Fortran Assembly Program) for an IBM 7090, so of course using a micro has always been a cinch for me.
Might have a big learning curve back then :D

However, the simplicity and popularity of the Arduino means the learning curve is quick and easy, and in the two days since the OP asked the original question he could have easily 'mastered' Arduino enough to have solved his problem.

As I recall the Arduino even has a 'sneaky' map() function for converting from one range to another :D

Analog Read.
Map.
Analog Out.
Loop.

Pretty well as simple as that.
 
The learning curve is a pretty big intimidation factor for most folks. It has been 60 years since I wrote my first line of FAP (Fortran Assembly Program) for an IBM 7090, so of course using a micro has always been a cinch for me.

There is this barrier for sure for some. But Scratch and mBlock and Flowcode and Snap4Arduino and...
being used by kids equates to learning how to jump over a mud puddle. At some point one learns
wet cold feet suck :). And the crazy thing is virtually everyone that uses a 4 function calculator is
already doing elemental programing, albeit mostly in head. Which of course is where most programming
comes from.

I guess the old adage you can make a horse run to water but you cant make it program still applies
for some.

Regards, Dana.
 
Kids are uninhibited, adults not so much. Foot dragging becomes endemic as we age.
 
However, the simplicity and popularity of the Arduino means the learning curve is quick and easy,
Don't know what popularity has to do with the learning curve. :rolleyes:
in the two days since the OP asked the original question he could have easily 'mastered' Arduino enough to have solved his problem.
I'd like to see the code that could be generated in two days from a cold start (from one that has no significant knowledge of microprocessors or programming) to solve his problem.

I'm sure programming seems easy for someone who already understands computer language and programming.
To me, a C program looks like a foreign language (and I've actually worked some with it way back when).
 
Don't know what popularity has to do with the learning curve. :rolleyes:

It's popular because it's so easy to learn - not that I'm particularly an Arduino fan :D .

I'd like to see the code that could be generated in two days from a cold start (from one that has no significant knowledge of microprocessors or programming) to solve his problem.

There's so much Arduino help out there, and it's such a simple task, that it wouldn't be difficult to learn enough - you don't need to 'understand' much of it to.

Even easier, just google it - Arduino is so popular you can almost always find multiple examples of what you're wanting to do:


I'm sure programming seems easy for someone who already understands computer language and programming.
To me, a C program looks like a foreign language (and I've actually worked some with it way back when).

Tell me about it - it's taken me decades (and I mean decades), and a forgotten number of attempts, to become proficient enough to use C on all my projects now. I learnt assembler, no problem - I learnt BASIC, no problem - I learnt Pascal, no problem - I learnt Delphi, no problem. Throughout all those decades I tried C multiple times, and gave up every time - I think it's all those horrible curly brackets? :D Eventually, and fairly recently, I actually succeeded :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top