Modbus RTU recessed thermostat

Status
Not open for further replies.

dany-dm

New member
Hello,

Introdution:
I am an eletrician with a little knowledge of electronics, english and with almost no knowledge of programming. So for me, this is a realy big big project!

What is this project:
This intend to be an ambient thermostat with 6 important objective:
1) It must have a graphic display;
2) it must have a slave modbus RTU interface;
3) It must measure light intensity;
4) it must measure humidity;
5) it must measure (obviusly) the temperature;
6) it must be small enough to stay in a "wall box fo the light switch"

Why I need it:

1) It is cool!
2) my house will be domotic and the core is a Siemens s7 1200 PLC , Modbus RTU is the simple way to comunicate with.
3) two reasons: one is to let the plc know how many lux are in a room and choose to if turn the light on or off; the second for turn the TFT backlight off when not needed or when I sleep.
4) automatically power on the fan when needed (especially in the bathroom)
5) ...
6) I like it and non rwcessed screens are ugly.

Optionally can have an ethernet interface (future implementation) and a micro sd reader (just in case).

so far i've bought many tft screen and at last i've choose a ILI9341 2.4" SPI TFT with touchscreen that fit exactly on a 3 modules of "Vimar" plate.
http://www.ebay.com/itm/2-4-240x320-SPI-Serial-TFT-Color-LCD-Display-Module-ILI9341-Touch-Panel-Screen/311058563693?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D28774%26meid%3D11d058b44d0340a0b9ac9c52fb1b1eb8%26pid%3D100005%26rk%3D2%26rkt%3D6%26sd%3D400760404213&rt=nc

I've seen the GY-30 light sensor module but i prefer to integrate it into my pcb because i am very restricted in space. (max pcb dimensions L= 65.3mm (2.57") X h= 42.5mm (1.67")). In the schematics i've drawn ISL29023 as light sensor chip because i can easily find it on RS http://uk.rs-online.com/web/p/colour-light-sensors/7044546/ and for the same reasons i've choose the SHT21 (http://uk.rs-online.com/web/p/temperature-humidity-sensors/7865554/) as humidity and temperature sensor.

i've appended my pdf schematic, what do you think? are all components connected right?
 

Attachments

  • Termostato V1.6_layer0.pdf
    107.3 KB · Views: 179
  • Termostato V1.6_Layer1.pdf
    106.4 KB · Views: 158
  • Termostato V1.6_Schem.pdf
    58.6 KB · Views: 171
That's a lot of things you are trying to integrate. If I were you, I'd try to break the various functions into bite size code. In other words, a very small loop() and detailed functions that govern the modbus, interface, etc. separately.

Libraries will help, too. My iPhone doesn't display your attachment so I cannot comment on that yet.
 
yes, that's a lot and it's why i am here. I'd try to do small loop but for now i am more focused on hardware, I am unable to develop such a small pcb by myself (maybe i can but not solder all pins without a solder mask), i need a prototype but etching the pcb cost a lot (about 90 €) so i hope to develope it right at the first time.

Do you know some cheap online pcb etcher selling in italy?
 
For home prototypes, I usually use iTead studio in China. Usually a couple of weeks from submission to receiving (in the UK) and quality isn't fantastic, but it should be perfectly fine for what you need. Oh, and they're really cheap. =)

http://imall.iteadstudio.com/open-pcb/pcb-prototyping.html

thanks, page bookmarked!.

I mounted the pcb and I found some problems. Termostato V1.8.jpg


I thought it was easier than expected.

1) the display cs and D/C connected to wrong pins (solved)
2) big temperature problems. the wrong temperature up to 5°C.

I absolutely have to solve this problem or the project will be abandoned.

I removed the relays, I'll have to replace it with optocouplers but still do not know what to choose, I have to drive 24V relays and say about 1W keeping overheating as low as possible.
I moved all the components away from the temperature sensor and made a hole to try to isolate the two sides.
I added two thermistores, one as close as possible to the outside (above the humidity sensor) and one in the terminal as external probe (only in extreme emergency).
to reduce consumption even further, I will supply the whole circuit with an 3.3V external power supply (far far away), hoping to not have excessive noise problems or voltage drops and that the 3 volts be enough for Modbus RTU communication.
I removed the resistance in series with the LED display and I will have to put a transistor with low voltage drop: this may be okay? http://docs-europe.electrocomponents.com/webdocs/1314/0900766b81314c1a.pdf )
 

Attachments

  • Termostato V3.0 board.jpg
    Termostato V3.0 board.jpg
    105.3 KB · Views: 260
  • Termostato V3.0 bottom board.png
    Termostato V3.0 bottom board.png
    136.4 KB · Views: 240
  • Termostato V3.0 schem.jpg
    Termostato V3.0 schem.jpg
    73.7 KB · Views: 229
  • Termostato V3.0 top board.png
    Termostato V3.0 top board.png
    169 KB · Views: 197
Hello
It's been a long time since I started this project but I've never abandoned it. I was a newbie and still I am. Remember this is practically my first project and I never had much time to spend.
This is an alpha version, I will post the code later (it's 95% of the memory for the record).
Meanwhile, here is a video demonstration:

https://youtu.be/NUph8v-G69A
 
Status
Not open for further replies.
Back
Top