Arduino Reptile Vivarium COntroller

Job ID: 30963804

Budget: £250 – £750 GBP

design brief:

Modify this: https://github.com/Toekie/Enviromate/blob/main/README.md

To take Enviromate and to change the 'Heat' component from a simple On/Off driven by a timer to a PID driven PWM AC dimmer based on the input from a Thermostat and a timer. Specifically:

1) Heating to be controlled based on a manually entered 'set-point' target temperature via the GUI on the touch screen
2) For that heating control to be PID driven PWM AC dimmer
3) For there to be TWO heating channels operating independently (TWO different set points, Two dif thermometers)
4) For both heating channels to have a timer functionality allowing four different times per channel

An example. I would like to set heating circuit 1 to:
a) 30 degrees C between 6am and 11am
b) 40 degrees C between 11am and 5pm
c) 25 degrees C between 5pm and 8pm
d) OFF between 8pm and 6am

In this case Circuit 1 will be a very high-output light, so it can only be on during the day

Circuit 2 I would set to:
a) 25 degrees from 8pm to 11pm
b) 16 degrees from 11pm to 6am
c) 25 degrees from 6am to 8pm

Circuit 2 would be a IR emitter that is invisible and can be on 24x7, it will also physically be in a different spot in the vivarium, so will provide back-ground heat

Looking at the Code, the following PINS are already used:

#define LEDpinA 10 // PWM PIN
#define LEDpinB 11 // PWM PIN
#define LEDpinC 12 // PWM PIN
#define pinFogger 2 // Can be a relay
#define pinFanA 5 // PWM PIN
#define pinFanB 6 // PWM PIN
#define pinFanC 7 //PWM PIN
#define pinRelaisA 22 // Relay
#define pinRelaisB 24 // Relay
#define pinRelaisC 26 // Relay
#define pinRelaisD 28 // Relay
#define pinBeeper 31 // Relay


#define LEDlicht 0 // Not sure what this is


#define heat_lamp 23 // Relay based on time
#define UV_lamp 25 // Relay based on time
#define sprayPomp 27 // Relay based on time

So only 6 of the 16 PWM PINS are used in this project. We would no longer need PIN 23, but could use 8 or 9 as I believe both are PWM on the Mega.

The set-point and timing variables would need to be entered via the GUI which is a part of this project, but needs to be enhanced as you can only enter time variable, so we would need to add multiple time entries and set point target temp variables

The PWM PIN output would need to feed the following component:

https://www.amazon.co.uk/RobotDyn-Dimmer-Module-Control-Channel/dp/B07KMHSFNM

This will drive the Heat light and emitter (one per heat circuit). As you can see, it has 4 PINS, 1 - PWM, 2 - Zero Cross, 3 - GND, 4 - VCC. The code library for this component is at:

https://github.com/RobotDynOfficial/RBDDimmer

Zero-Cross I understand you can use the same PIN for all circuits, so we should use what is defined for the other PWM dimmers in the code

The RobotDyn dimmer will then drive the heat light circuit (one per circuit).

Each Heat Circuit will need to have its own thermostat, because they will be physically in different places.

Heat 1 will be in the day / hot spot and I will use this:

https://thepihut.com/products/waterproof-ds18b20-digital-temperature-sensor-extras

Heat 2 will be in the night / ambient spot and I will use this:

https://thepihut.com/products/dht22-temperature-humidity-sensor-extras

Heat 1 Thermostat will need to be newly defined in the code, and reported separately on the GUI - as "Basking Spot". It will need an IO PIN assigned to it

Heat 2 Thermostat is already in the code, but will need to be used to switch Heat 2. This Thermostat should continue to be displayed on the GUI. The beeper functionality in the Code that is currently driven by this Thermostat is fine.

All other functionality should broadly stay the same, think of this as an updated release of Enviromate where we are editing the GUI and Heat capability from timer driven on/off to thermostat driven PID / PWM with timer for multiple set-points and adding a new heat circuit and thermostat