Page 1 of 1

3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Fri May 10, 2019 11:13 pm
by Derrihj
Am trying to make a voltmeter ranging from 0-55v but this time using a 3digit 7seg Display,this meter has two LEDs that turn ON/OFF in an interval off two seconds,Delay obtained from Timer0 INT overflow with an offset of tmr0+=3;.This works well as desired,the only trouble am geting is displaying voltage on the 3digit 7seg that is why i really need your help.Voltages below 10v should be displayed on Digit1 eg 9.00v,8.03v,7.52v,5.00v,4.00v,3.00v,2.00v,1.00v but also float decimals should be displayed as well eg 23.8v, 54.5v, 30.0v i will not use Digit0,i only need to use Digit1,Digit2 and Digit3 to display voltage from 0-55v.Please help me on the part of displaying voltage on the 3digit 7seg display.Below is my flow chat.

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Sun May 12, 2019 8:43 am
by Steve001
Hi

Not got V8, but in V7 you can read the ADC using

"read as string" have you tried this ? then you can define the length of the string to 4

https://www.matrixtsl.com/wiki/index.ph ... #GetString

Steve

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Sun May 12, 2019 1:39 pm
by Derrihj
Thanks Steve but i would love to see how its done someone download my flowchat help work it out and repost it would be even more helping and quick learning that way.Thanks once again.

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Sun May 12, 2019 9:05 pm
by viktor_au
Attached an example of voltmeter I found on this forum (I am not sure who is the author).
You can see the string manipulation...

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Mon May 13, 2019 11:10 pm
by Derrihj
Thanks so much Viktor but to make my understanding this better an example with a 3 digit 7 seg display would be better showing how to display voltages on it instead of an lcd.

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Tue Jun 04, 2019 8:00 pm
by Derrihj
Is there no one here to help me work on my flowchat and show me how i can display DC voltage on a 7 segiment quard display?

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Tue Jun 04, 2019 9:26 pm
by chipfryer27
Hi

I've just got back from travels and off again tomorrow so I'm sorry to be brief due to being a bit tired. I looked at your program and when simulated it didn't show any digits after the decimal point until in excess of 10v, and then only the decimal displayed.

In circuit debugger I displayed the variables being used (IntADC,Voltage, Digit1, Digit2, Digit3). It's always a good idea to do this to see if results are as expected. From there I saw that IntADC and Voltage appeared correct (Note that I assume you are using a divider circuit hence the Dvf multiplier of 11). Your calculations in the Seg macro don't seem correct to me. Modulus will give you the remainder after the division. You have for example, Voltage = 5.73 so for digit three you are (voltage/100)%10 which equals 0.0573 % 10.

If you multiply by 100 you would then get 573 %10 which equals 3. Changing your calculations to such then gives you the correct display up to 9.99v. To display 10v or greater you will need to add in an extra routine / branch / whatever to check if Voltage is greater than 10, and if so move the decimal point and digits accordingly.

Hope this helps,
Regards

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Wed Jun 05, 2019 1:03 am
by chipfryer27
Hi

Further to my last post I notice that you had IntADC set as a Byte which gives a range of values between 0 and 255, and when reading the ADC you were using GetAverageByte. This means that you could only ever obtain 255 as the maximum value of your potentiometer thus limiting the maximum voltage to around 13.x volts

Changing this to make IntADC an Unsigned Integer (UINT) gives you a range of 0-65535 and using GetAverageInt now allows you to read the full 1023 ADC range and thus the 55v you are after.

I changed your program to reflect all the above and also to display x.yy if under 10v and if over that value then xx.y There are other ways to do it, possibly more efficiently but this may help you.

Regards

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Wed Jun 05, 2019 8:17 pm
by Derrihj
Thanks a million times Chipfryer27 i was waiting for people like you to work out my flowchat.I love learning i will go thru it when i get back home today right now am on phone.

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Wed Jun 05, 2019 8:41 pm
by chipfryer27
Hi

You are welcome.

Your program was quite easy to follow and it didn't need much to make it work as you wanted it to. Just an easy to overlook calculation, and we have all done that :)

Regards

Re: 3 Digit 7 Segiment quad Display 0-55v Voltimeter

Posted: Thu Jun 06, 2019 9:34 am
by Derrihj
Hi Chipfryer27 i saw your update of my flowchat and its exactly what i wanted now I've learnt how to play around with "MOD" thanks again now am going to build it and see how it goes on a real board next I will need to know how to go about a current meter like from 0-100 or 200A