3 Digit 7 Segiment quad Display 0-55v Voltimeter

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

3 Digit 7 Segiment quad Display 0-55v Voltimeter

Postby Derrihj » Fri May 10, 2019 11:13 pm

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.
Attachments
3Digit 7seg 0-55v voltmeter.fcfx
(19.82 KiB) Downloaded 74 times
Last edited by Derrihj on Sun May 12, 2019 12:28 pm, edited 2 times in total.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1128
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 521 times
Contact:

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

Postby Steve001 » Sun May 12, 2019 8:43 am

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.php?title=Component:_ADC_Template_(Inputs:_Analog)#GetString

Steve
Success always occurs in private and failure in full view.

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

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

Postby Derrihj » Sun May 12, 2019 1:39 pm

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.

viktor_au
Posts: 183
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

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

Postby viktor_au » Sun May 12, 2019 9:05 pm

Attached an example of voltmeter I found on this forum (I am not sure who is the author).
You can see the string manipulation...
Attachments
pic-voltage_v7.fcfx
(21.41 KiB) Downloaded 68 times

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

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

Postby Derrihj » Mon May 13, 2019 11:10 pm

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.

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

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

Postby Derrihj » Tue Jun 04, 2019 8:00 pm

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?

chipfryer27
Posts: 220
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 145 times
Been thanked: 108 times
Contact:

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

Postby chipfryer27 » Tue Jun 04, 2019 9:26 pm

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

chipfryer27
Posts: 220
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 145 times
Been thanked: 108 times
Contact:

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

Postby chipfryer27 » Wed Jun 05, 2019 1:03 am

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
Attachments
3Digit 7seg 0-55v voltmeter - Update.fcfx
(21.6 KiB) Downloaded 74 times
These users thanked the author chipfryer27 for the post (total 2):
Derrihj (Wed Jun 05, 2019 8:13 pm) • medelec35 (Wed Jun 05, 2019 9:45 pm)
Rating: 10%
 

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

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

Postby Derrihj » Wed Jun 05, 2019 8:17 pm

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.

chipfryer27
Posts: 220
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 145 times
Been thanked: 108 times
Contact:

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

Postby chipfryer27 » Wed Jun 05, 2019 8:41 pm

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

Derrihj
Posts: 204
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 52 times
Been thanked: 20 times
Contact:

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

Postby Derrihj » Thu Jun 06, 2019 9:34 am

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