Hello,
I just discovered Blynk.
So I had an idea and I would need some help and advice to know if it would be possible using Blynk and CC3200. I threw together some pseudo code quickly.
The basic Idea is to publish humidity and temperature from a dhtt22 for example to blink. Along with soil moisture data.
Then using these inputs to create a couple of PID controllers that regulate fans with PWM to try to reach a certain setpoint for humidity and relays to control temperature with either PI or PID controller.
Also to control lighting with relay and on a schedule, to switch them on at a certain time of day and turn them off aswell.
Now these setpoints for PI/PID controllers should be saved in a csv file for example so that the controller could also operate in standalone mode if the connection to blink would go down.
Would this be possible and also would it be possible to save for example a few days worth of sensor data on the cc3200 in a csv file and upload it when connection to blink is succesful.
{
GET TEMP(int = temp)
GET HUMIDITY(int = hum)
GET SOIL(int = soil)
GET TIME(int = time)
READ CSV()
{Parse CSV(pid1,pin1,pid2,pin2,pid3,pin3,on,off,on1,off1)
PID LOOP1() { }
PID LOOP2() { }
RELAY(on,off,pin)
{ GET TIME()
If time = on Set Pin2 on
Else if time = off Set Pin2 off
}
RELAY1(on1,off1,pin1)
{
GET TIME()
If time = on1 Set Pin1 on
Else if time = off1 Set Pin1 off
}
}
Connect to blink
{
if connection = True
GET PID VALUES(int = setpoint1,setpoint2)
GET RELAY(on,off)
GET RELAY1(on1,off1)
Write to CSV
Publish (temp,hum,soil)
If connetion = false (Reconnect in time 30s)
Dont write to csv.
}