Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Modbus RTU recessed thermostat

  1. #1
    Junior Member
    Join Date
    Mar 2015
    Posts
    4

    Modbus RTU recessed thermostat

    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-...60404213&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...nsors/7044546/ and for the same reasons i've choose the SHT21 (http://uk.rs-online.com/web/p/temper...nsors/7865554/) as humidity and temperature sensor.

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

  2. #2
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    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.

  3. #3
    Junior Member
    Join Date
    Mar 2015
    Posts
    4
    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?

  4. #4
    Senior Member
    Join Date
    Dec 2014
    Posts
    306
    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-pc...ototyping.html

  5. #5
    Junior Member
    Join Date
    Mar 2015
    Posts
    4
    Quote Originally Posted by Cosford View Post
    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-pc...ototyping.html
    thanks, page bookmarked!.

    I mounted the pcb and I found some problems.Click image for larger version. 

Name:	Termostato V1.8.jpg 
Views:	136 
Size:	76.7 KB 
ID:	4056


    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 5C.

    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...6b81314c1a.pdf )
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Termostato V3.0 board.jpg 
Views:	123 
Size:	105.3 KB 
ID:	4052   Click image for larger version. 

Name:	Termostato V3.0 bottom board.png 
Views:	120 
Size:	136.4 KB 
ID:	4053  

    Click image for larger version. 

Name:	Termostato V3.0 schem.jpg 
Views:	125 
Size:	73.7 KB 
ID:	4054   Click image for larger version. 

Name:	Termostato V3.0 top board.png 
Views:	110 
Size:	169.0 KB 
ID:	4055  


  6. #6
    Junior Member
    Join Date
    Mar 2015
    Posts
    4
    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

  7. #7
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    193
    Nice work Dany!
    Congratulations!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •