For my new home I design distributed inputs for simplify installation. With this design I have 20 modules aggregating around 100 signals with only 120m of cable in 120m2 home.
Due to the scattering of modules, I decided to add an environmental conditions sensor.
Design assumptions:
-size allow to put in electric box (in my case cylinder with diameter of 67mm)
-wide range of power supply (possible voltage drops with long cables)
-6 inputs
-CAN bus communication
-PIC18F25K80 MCU (I used it in a past, and have good experience)
-BME280 environmental sensor
-One LED diode for error signalization or highlights (like in server equipment)
Hardware was design. I order 30 assembled boards in china.
For now priority is software. Right now all hardware is tested:
LED is blinking
BME communication is working
All inputs can be read
CAN bus send and receive frames
Right now I work on application, as a main board I use Olimex ESP32-EVB-EA-IND and finally I want to have all data from modules accessible by HTML or MQTT.
Second small improvement will be designing small board with connectors which allows easier connector cables to the board.
If you have any idea of connector type which suits here... let me know.
Board was design in KiCad. Schematic and board below:
Design is quite ordinary without any fancy solutions.
Optocuplers on the inputs are on the same ground as rest of the circuit, but it is much easier, cheaper and smaller solution then resistor divider and protection circuit.
A little problematic was connection between BME280(3,3V) and PIC(5V), but fortunately microchip have bulid-in SMBus hardware support which allows to work without any additional hardware.
Talking about BME280: small gap in ground was made for thermal isolation (we will see how it works in future). Second future are three holes near BME. I made them for future, because I plan to play with pressure measurement and it allows to connect some small manifold.