Hi,
I need some help deciding on which way to go. I am currently automating some stuff on my aquariums like measuring water values, water flows, controlling the heating, pumps, light, semi-automatic water exchenge, carbon dioxide injection, some weight measurements and stuff like that. There should also be some logging of measurements. Main controller will be a Teensy 3.2. Currently I am working on getting the individual functions to work on the mechanics/eletronics side. Programming will be one of the next steps. There will be some space in between the individual parts of the system. I expect 2m to 6m distance from the main controller to the individual parts of the system. The signals are mainly digital signals switching a valve or something similar. Some are PWM signals (LEDs for lighting and pump control). A few are analog for measurements. Most functions are not very time critical (accuracy of 1s is definitely ok) but some like dosing fertilizer needs to be more accurate (~0.1s accuracy).
My problem is the question how to interface the remote functions. There are two main ideas:
Thanks
Daniel
I need some help deciding on which way to go. I am currently automating some stuff on my aquariums like measuring water values, water flows, controlling the heating, pumps, light, semi-automatic water exchenge, carbon dioxide injection, some weight measurements and stuff like that. There should also be some logging of measurements. Main controller will be a Teensy 3.2. Currently I am working on getting the individual functions to work on the mechanics/eletronics side. Programming will be one of the next steps. There will be some space in between the individual parts of the system. I expect 2m to 6m distance from the main controller to the individual parts of the system. The signals are mainly digital signals switching a valve or something similar. Some are PWM signals (LEDs for lighting and pump control). A few are analog for measurements. Most functions are not very time critical (accuracy of 1s is definitely ok) but some like dosing fertilizer needs to be more accurate (~0.1s accuracy).
My problem is the question how to interface the remote functions. There are two main ideas:
- Bus system: I could use some sort of bus system (CAN bus or RS485 or?) and remote logic (either some cheap AVR chip or another Teensy 3.2 or a Teensy LC). The advantage would be that most functions would be implemented in the remote logic and these functions are limited (easier to maintain and verify). Time critical functions could be controlled easily and high frequency signals only have to reach a short way. The system would also be better scalable (maybe even up to controlling 2 aquariums from one main controller). The communciation would be very limited as the main controller only would need to initiate a function not to monitor it closely. Therefore something like 125kbaud would be ok for sure. But it is a lot of effort to have "intelligence" in every part and it might be expansive. Additonally I never did something like this before (but I guess I could manage that).
- Port expanders: The Teensy coould control everything directly. In order to have enough I/O pins I would need some port expanders. As I can't stop everything else for time critical functions the tradeoff between different functions might be difficult and risky. There are also very many function interfering with each other which I fear will give me some nightmares. The PWM signals will also have some high frequency component. For the LED lighting I wan't to use no less then 1kHz of PWM frequency (i like to take photos of my fish and slow PWM is a nightmare for that) with no less then 12bits of PWM resolution (=4096 levels of intensity) and the signal needs to be quiet clean in order to work properly.
Thanks
Daniel