New analog temp component

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jgu1
Posts: 776
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 173 times

New analog temp component

Post by jgu1 »

Hi!

When I updated today I saw a new component Analog temp. Perfect will be easy to use all the analog temp devices. ;) I have made a small test where I have chosen a Temp36.
When I simulate (not testet in real world yet) there are way too many decimals after commas. Even when I TempString = FloatToString$ (Temp,2) I get 6 decimals and always zero´s

What am I doing wrong please?

Br jorgen
Attachments
AnalogTempComponent.fcfx
(10.08 KiB) Downloaded 117 times

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: New analog temp component

Post by medelec35 »

Hi, jorgen
Try the attached and see if that works for you.
Let me know if you would like any other analogue sensors added?
Attachments
AnalogTempComponent 2.fcfx
(10.24 KiB) Downloaded 114 times
Martin

jgu1
Posts: 776
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 173 times

Re: New analog temp component

Post by jgu1 »

Hi Martin!

Thanks for the quick reply. I had you suspect to make this component with multible sensores :lol: , if I'm right, this is very welcome and thank you.

Now I remember your "float rounding up". When I simulate your correction, now 2 decimal, but I always only see hole numbers not like this 24,5 or 40,7
ect. This will maybe work in real world?

I have a couble of the other analog sensors which is avaible in the list home and I will perform a test this evening when I am home. :D

Br Jorgen.

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: New analog temp component

Post by medelec35 »

Hi Jorgen.
Your welcome.
jgu1 wrote:
Thu Jan 06, 2022 6:41 am
I had you suspect to make this component with multible sensores
Yes, you are correct.
I have a TMP36 and LM35, so I thought I would make a component for people who have the same sensors.
At least then they don't have to look up a datasheet to get the component to work.
Then I thought, why not get the component to work with:
AD22100, AD22103, LM135, LM235, LM335, LM35, LM36, LM37, LM60, MCP9700, MCP9701, TC1047, TMP35, TMP36, TMP37, TSIC301
I have made the component free so it can be used without purchasing the sensors pack.
jgu1 wrote:
Thu Jan 06, 2022 6:41 am
When I simulate your correction, now 2 decimal, but I always only see hole numbers not like this 24,5 or 40,7
ect. This will maybe work in real world?
Yes, it will show the two decimal places in the real world.
Currently using TMP36 my room is showing 21.78 on the LCD
I will look into the simulation side.
If you want a better resolution you will need to have a lower internal or external reference.
Looking at the spreadsheet I created which shows ADC V vs Temperature, the highest voltage for tmp36 is 2.94.
Therefore have a 3V external reference set up.
You will need to change the Vref (mV) to 3000 or whatever the resister set the exact voltage at.
If you want to set up an external Vref then I can help you with that.
Martin

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: New analog temp component

Post by medelec35 »

Hi.
I have fixed a couple of simulation issues.
Now the decimal places are shown, and the Voltage shown was not correct.
Until the update is pushed, I have attached it if you would to test sooner rather than later,

In file explorer address bar, paste this:

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Extract the component within the attached zip file and save it into the above hidden folder.
Just select ok to replace the current file.
If you got Flowcode running when the file was placed in the components directory, you must select the reload icon before compiling again.
Attachments
AnaTempSensors.zip
(5.8 KiB) Downloaded 104 times
Martin

jgu1
Posts: 776
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 670 times
Been thanked: 173 times

Re: New analog temp component

Post by jgu1 »

Hi Martin!

First I add the fcpx file to the lib. and now the simulation work perfect. So push it in update ;) Thank you.

I have a Lm35 and TMP36 and made some test. Also perfect :D I had a pre board with an Uno and a Glcd display connected, work. But there I have to use the "float to string function" if I want all the decimal after comma. I have not testet the LCD yet but you have :D

Imagine all the kind of tempsensors we can choose between now in FC include your MCP96X, thats nice.

Thank´s again.

Jorgen
Attachments
Ili9163Me ST7735 Temperatur.fcfx
(24.78 KiB) Downloaded 104 times

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: New analog temp component

Post by medelec35 »

Hi Jorgen.
That's excellent news.
Thanks for letting me know.
Yes, there are a fair few analogue and digital temperature sensors now.
Martin

medelec35
Matrix Staff
Posts: 1919
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 622 times
Been thanked: 645 times

Re: New analog temp component

Post by medelec35 »

Hi Jorgen.
The update is now ready to download to the latest version.
Martin

Post Reply