Which approach to choose for motor bike voltage meter? - Page 1
Forum section: electronics / projects

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 12, 2021, 02:56:57 pm
content: Hey,I'm currently trying to get my head around electronics and started a few months ago with very basic experiments. My goal is to understand, how things work, how to design circuits, and how to fix stuff. It's going to be a hobby only;)So my first project will be a voltage meter for my motorbike electrical system. Here some requirements:- The circuit should indicate a voltage below 12V, between 12V and 15V and above 15V by means of a LED- The LED brightness should adapt to the ambient brightness, so I don't get blinded at night but see the LED in bright sunlight- The circuit should operate between 10 and 27V- A hysteresis would be nice, so the indication is clear. The lack of precision doesn't really matter.- For now, I plan on building the circuit using a prototype matrix board.- There is not too much space in my cockpit, so the smaller the better.So far I figured out the following alternative approaches:1) Arduino2) Comparator3) Z-Diodes4) ThyristorsCould you give me advice on which approach to choose? What are the advantages and disadvantages? Most interesting would be robustness/durability, power consumption, and anything I should take into account, which is relevant for using the voltage meter in my motorbike, and which I might not figure out in my lab.I build a step-down power supply, which provides 5V. I need that for the Arduino or for the 555 timer, which I use for dimming the LED in approaches 2-4. So I can use this to generate my reference voltage for approache 2. However, in the range of 10 to 27 V, my output voltage varies by a bit less than 1V. So this might actually be a problem for the reference voltage.1) ArduinoAdvantages:Straight forward simple designHysteresis simply implementedVery little components required, most likely the smalest alternativeDisadvantages:How likely are EMC problems with a microcontroller in close vicinity to all the wires running through my cockpit?2) ComparatorAdvantages:Relatively few components, compared to 3Hystereses simply implementedDisadvantages:Voltage divider required, which might not be too precise due to my power supply. But I suppose I can tune this by using potentiometers.I'll need the comparator and a NAND gate, so this might take most space in the end.3) Z-DiodesAdvantages:I don't need a reference voltage.Disadvantages:Requires relatively many componentes -> might not be the smales solutionHysteresis would require many more components4) ThyristorsAdvantages:Fewer components than 3, might be the smallest solution not using a microcontrollerI don't need a reference voltage.Disadvantages:Hysteresis would require many more componentsIf it helps, I can provide some schematics. I have not yet done the full design on all alternatives, but I have some drafts. For the moment, I spare you trying to decypher my scribbles;) I'd need to draw them nicely. My designs so far are based on circuits from the Encyclopedia of Electronic Circuits. I case you have them at hand, here the references: 2) Vol 6 page 689, 3) Vol 3 page 767, 4) Vol 3 page 762.Thanks a lot in advance for the support!Johannes

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 09:58:43 am
content: Hey,I started drawing the schematics in easy eda properly. Any comments on the circuit and on the formate are most welcome. These are my first schematics;)Power supply, LED driver and LED dimmer work fine. I have implemented the circuits on a breadboard so far.I choose the components connected to the MC33063 according to the datasheet. The potentiometer in the LED driver circuit adjusts the overall LED brightness. In the end, I'll be using one three-color LED. For now, it is much easier to debug my circuit, if I use three separate LEDs. The LED dimmer measures the ambient lighting conditions and dims the LED in the dark. The potentiometer in the LED dimmer circuit adjusts the difference in brightness of the LED aka the duty cycle of the timer.I started with some experiments on the Z Diode approach. I implemented the attached circuit on a breadboard. Unfortunately, the LED starts glowing at about 7V. The brightness is not increasing anymore above 12V. That is not precise enough to indicate a voltage range between 12 and 15 volts. Any suggestion on how to get the z diode approach working? I'll start experimenting with the comparators in the meantime:DJohannes

author: coromonadalix
author_rank: Super Contributor
timestamp: September 22, 2021, 10:26:52 am
content: you seem to choose a complicated roadyou have some small panel voltage meter(s) who can do 3 vdc in to 33vdc and display it on led display, and they dont cost a fortune, you have different size to choose.Examplehttps://www.ebay.com/itm/184389160638?Some of them can measure their own inputs voltages,choose carefullyi use a few of them for current and voltage sensing with very good precisionSome car(s) (cigarette lighter) voltage meters could do toohey could be teaked for brightness levels ??

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 03:08:27 pm
content: Thanks for the reply. The project is not solemnly about measuring the voltage of my battery, it's more about learning how to design a circuit and getting more familiar with the electronic components. I have already implemented the Arduino solution, which works perfectly fine. Buying one of the voltage meters, you have mentioned, would definitely do the trick too.I'm not sure, what you meant with your last sentence;)

author: Benta
author_rank: Super Contributor
timestamp: September 22, 2021, 04:04:24 pm
content: Do a search for "window comparator". That's the classic way of doing this. Don't worry too much about varying supply voltage, no matter what you do you'll need a voltage reference in the circuit.A TL431 will suffice, this is not about super-precision.

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 07:08:01 pm
content: Thank's for the hint! I'll search for window comparator and check out the TL431. It's always hard to find the right keywords to search forIn the meantime, I implemented the circuit with the comparator and it works nicely. The changing supply voltage is no problem, since I can tune the reference voltage with potentiometers.

author: Benta
author_rank: Super Contributor
timestamp: September 22, 2021, 07:20:48 pm
content: OK, didn't realise you already have a 5 V supply in your circuit. Then the TL431 might be unnecessary.But why use a switching regulator for something as simple as this? A 7805 or 78L05 is completely sufficient.Much more important is transient protection on your supply and input signal.Automotive/motorbike electrics is one of the "dirtiest" environments you can work in (from an electrical point of view).

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 07:32:10 pm
content: I once did an Arduino project, which runs hopefully for a long time on a car battery. Back then I read, that 7805 is much more inefficient than a switching regulator. I just measured the total current of the circuit. It's about 0.16 W, so I guess the switching regulator is a bit over-engineered:DIs the z diode in the upper left corner of the power supply sufficient as transient protection?I checked out some of the window comparator circuits. It seems to me, this is the approach I implemented with the comaparators.

author: Benta
author_rank: Super Contributor
timestamp: September 22, 2021, 07:50:01 pm
content: Quote from: Johannes Windmiller on September 22, 2021, 07:32:10 pmNo. You need a real transient suppressor, I'd suggest a 1.5KExx type or its SMD equivalent.Quote from: Johannes Windmiller on September 22, 2021, 07:32:10 pmCould be. Your "schematic" is more like a PCB layout, and I have no time nor patience for that kind of reverse engineering. Draw it correctly using comparator and logic symbols so that it's understandable.

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 09:08:51 pm
content: I used the symbols, that easy eda came up with;) I attached proper comparator and logical symbols.Thanks for the hint on the TVS.

author: james_s
author_rank: Super Contributor
timestamp: September 22, 2021, 09:18:42 pm
content: A switching regulator is more efficient, but it's also a lot harder to get right. The PCB layout and component selection is critical, whereas a linear regulator will almost always just work. When you need a large voltage drop or high current then a switching regulator is the way to go, but this appears to be neither.I would go with window comparators personally, the LM3914 IC is a classic way of doing this.

author: Benta
author_rank: Super Contributor
timestamp: September 22, 2021, 10:00:31 pm
content: Still unclear to me is:Do you want a kind of "VU-meter" where each LED comes on one after ther other? (on-off-off, on-on off, on-on-on)Or where only one LED lights at any time? (on-off-off, off-on-off, off-off-on)

author: Johannes Windmiller
author_rank: Newbie
timestamp: September 22, 2021, 10:13:52 pm
content: I've got one three-color LED. So the result should be "on-off-off, off-on-off, off-off-on". Easy eda had no appropriate symbol for a three-color LED and for debugging I started off with three LEDs. Sorry, that might have been confusing, since the schematics show three separate LEDs.LM3914 IC would be the right choice for a VU-meter with several LEDs, right?

author: james_s
author_rank: Super Contributor
timestamp: September 23, 2021, 01:56:24 am
content: The LM3914 has both bar and dot mode. Bar works like a classic VU meter and dot lights one LED at a time.