Page 1 of 2

Esp32 with Ili9341 and DS18B20

Posted: Sat Apr 09, 2022 6:58 pm
by jgu1
Hi!

I need help (again). I am starting a project with an Esp32 together with Ili9341 and DS18B20. I want to measure the temperature and log the temp on a graph. It work in real world but I can´t read the temp in simulation, maybe I miss some setting ?

I use the 3.2" display 240X320 To draw the Y axe I use the actual temperature to let the Y go up when temp increase and down again when decrease.

I know the Y axe start on zero in the top of the display and 320 in the buttom. So when the temp increase the graph go in down direction and opposite.

My wish is that the the graph go up when temp increase and down when decrease. Somehow I need to "invert" my tempmeasuring.
How do I do this, please :D

Note, I am not finish with the project so the botton is not active.
Hope you understand the my description. By the way also other improvement is welcome ;)

Thank´s in advance

Br Jorgen.

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 10:36 am
by chipfryer27
Hi

I want one of those displays. Amazon or such like will be my next site :D

Not having the chance yet to play with one I can only suggest some things to try. Maybe someone with better knowledge can assist further.

In properties it appears to be able to Flip X and Y (in Hardware) but in simulation this doesn't appear to do anything so I don't know if that would even be of use.

You could however use an offset. In your Live_x Macro you could include a calculation before you plot to include an offset (temp=225-temp) I believe 225 is your lower baseline therefore your plots will now appear to ascend in value rather than descend.

Also, in the same Macro would Plot not be better than DrawLine as it looks like you arent "joining the dots" :) ?

Hope this is of some help.
Regards

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 6:51 pm
by jgu1
Hi Chipfreyer!

Thank you very much. I will test your suggstions. Concening these display, I have made some project with these they are very good. I use the SPI after Bens speed the them up they are very fast.

Do you know why my project not work in simulation?

Br Jorgen

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 7:12 pm
by chipfryer27
Hi Jorgen

I only had a quick look today. I should get more time tomorrow to look further.

It turns out I do already have one of those displays. I ordered up one last year, but as it came with zero documentation it went into the "play later" pile. I've since found a good site that provides help including pinouts and how to change modes (https://wiki.52pi.com/index.php/EP-0065).

Just starting to explore the ESP32 too, so I'm very interested in seeing how they are being used in projects.

Regards

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 8:38 pm
by jgu1
Hi Again!

Flip X 0r Y is like you look in a mirror :D

I try to make some calculations, so far without luck I have to play a little more. Thank´s for help.

Br Jorgen-

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 8:57 pm
by chipfryer27
Hi Jorgen

Looks to me that you might have forgotten to set the device address in your DS18B20 macro. Try adding a AddressSpecificDevice ("000000000000") component macro before you sample.

I included the above and the calculation mentioned earlier and in simulation I can plot.

I'll forward a chart later as FC has just crashed again. It's being doing that recently and generally misbehaving.

Regards

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 9:28 pm
by jgu1
I just set the adress and after read it, forgot that, now it work in simulation. Thank you ;)
It will be easyer to test calculation....

Jorgen

Re: Esp32 with Ili9341 and DS18B20

Posted: Sun Apr 10, 2022 9:32 pm
by chipfryer27
Hi Jorgen

In the attached I "spun" the display around in 2D Panel to make it easier for me to read.

In the DS18B20 Macro I added in a command to set the address

I created a new variable called "Plot" and In the Live_x Macro I added a calculation Plot=225-Temp. This then offsets the Temp value with respect to the baseline.

I then use the "Plot" variable in the next command to display the result.

Please note that I haven't went through everything yet as FC is playing up, so the above may not be the best way to achieve. I do hope however it helps.

Regards

Re: Esp32 with Ili9341 and DS18B20

Posted: Mon Apr 11, 2022 7:11 am
by jgu1
Hi Chipfreyer!

Wow, Thank you. I am not Home now, But I Will test later today. Thank`s. :D

Jorgen.

Re: Esp32 with Ili9341 and DS18B20

Posted: Mon Apr 11, 2022 6:36 pm
by jgu1
Hi Chipfreyer!

Yes, it work, so perfect, thanks again. Honest I don´t understand how it work "Plot-225" and how it can icrease the graphhas it something to do with roll over? ;)

Br Jorgen