Docs Save

This commit is contained in:
Warky 2024-08-26 21:43:52 +02:00
parent 376fa23cc6
commit 0202b2a893
4 changed files with 137 additions and 2 deletions

30
LICENSE Normal file
View File

@ -0,0 +1,30 @@
Copyright (c) 2024 Warky Devs Pty Ltd. All rights reserved.
The code and materials in this repository are the exclusive property of Warky Devs Pty Ltd and are protected by copyright law. Please refer to the license details below.
## MIT License with No-Use Clause
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use the Software for non-commercial purposes only and under the following conditions:
1. You must obtain explicit permission from the original author or copyright holder before using the Software for any purpose, including but not limited to commercial use.
2. Redistributions of the Software, with or without modification, are permitted for non-commercial purposes only, provided that the above conditions are met.
3. You may not use the Software in any way that violates the laws and regulations of the jurisdiction in which you operate.
4. You may not use the names, trademarks, service marks, or any other identifiers of the original author or copyright holder to endorse or promote products derived from the Software without specific prior written permission.
5. Any derivative works created using the Software must not be used for commercial purposes without obtaining explicit permission from the original author or copyright holder.
6. Redistributions of the Software, with or without modification, must not imply endorsement of any kind by the original author or copyright holder.
7. THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8. You are granted permission to view and review the code for the purpose of understanding and collaborating with Warky Devs Pty Ltd. However, no other rights, expressed or implied, are provided for the use of this code without explicit written permission from Warky Devs Pty Ltd.
9. AI Scanning and Scraping Prohibition:
This code is not licensed or intended for use in any AI scanning, automated data extraction, web scraping, or similar activities without prior written consent from Warky Devs Pty Ltd. Unauthorized use of AI or scraping technologies to access, extract, or analyze the contents of this code is strictly prohibited.
This license applies to the original Software and any derivative works, and it extends to any person who receives the Software from you.
For inquiries regarding licensing, use, or other questions, please contact Warky Devs Pty Ltd.

109
README.md
View File

@ -1,3 +1,108 @@
# arduino # Modbus Project for Vivarox EMS
Arduino Projects Modbus Project for Vivarox EMS
This is a specification and estimation of the required hardware and costs.
More detail will be added and real time testing is required.
## Arduino Option:
To connect to Modbus and read information onto an SD card using an Arduino.
### Hardware needed:
1. Arduino Board
Recommended: Arduino MEGA 2560 (for more memory and I/O pins) or Arduino UNO (for simpler).
- [Arduino MEGA @ R377.20](https://www.robotics.org.za/MEGA-16U2?search=Arduino%20MEGA%202560)
- [UNO R3 with 16U2 USB Interface @ R151.00](https://www.robotics.org.za/UNOR3-16U2?search=%20Arduino%20UNO)
2. RS485 to TTL Module
Allows communication between the Arduino and Modbus devices using the RS485 protocol.
- [RS485 Module (TTL -> RS485) @ R25.30](https://www.robotics.org.za/RS485-MOD)
- [MAX485 Bus Transceiver (4 Pack) @ R16.00](https://www.robotics.org.za/MAX485-DIP?search=MAX485)
3. SD Card Module
Allows the Arduino to read from and write data to an SD card.
Standard SD card module that interfaces via SPI (Serial Peripheral Interface).
- [Micro SD Card Module @ R25.00](https://www.diyelectronics.co.za/store/memory/512-micro-sd-card-module.html?srsltid=AfmBOoptww8c6kx53xbZWiP2_C_qOE3r9xinyoCO-AZHrZkNQiyxU17c)
4. RTC Module
To keep track of the current date and time, even when the Arduino is powered off. This will allow your Arduino to timestamp the data it reads from Modbus and writes to the SD card.
- [DS3231 Real Time Clock Module @ R55.20](https://www.robotics.org.za/DS3231-MOD?search=DS3231)
5. Power Supply / Batteries
To power the Arduino and connected peripherals (RS485 module and SD card module).
- [AC Adapter 9V with barrel jack @ R60](https://www.robotics.org.za/AC-9V-2A-2155?search=%20Power%20Supply)
- [Panasonic CR2032 3V 225mAh Coin Cell Battery (5 Pack) @ R43.00](https://www.robotics.org.za/CR2032)
### Wiring
#### RS485 Module to Arduino:
1. RO (Receiver Output) to Arduino RX
2. DI (Driver Input) to Arduino TX
3. DE (Driver Enable) & RE (Receiver Enable) to an Arduino digital pin (control this pin in the code to switch between sending and receiving).
4. VCC to 5V on Arduino
5. GND to GND on Arduino
6. A & B (RS485 differential pair) to Modbus device.
#### SD Card Module to Arduino:
1. VCC to 5V on Arduino
2. GND to GND on Arduino
3. MOSI to MOSI (pin 51 on MEGA, pin 11 on UNO)
4. MISO to MISO (pin 50 on MEGA, pin 12 on UNO)
5. SCK to SCK (pin 52 on MEGA, pin 13 on UNO)
6. CS (Chip Select) to any available digital pin (e.g., pin 4).
#### Wiring the RTC Module
1. VCC to 5V on the Arduino.
2. GND to GND on the Arduino.
3. SDA to SDA (pin 20 on MEGA, pin A4 on UNO).
4. SCL to SCL (pin 21 on MEGA, pin A5 on UNO).
### Software
- Modbus Library: SimpleModbus or ModbusMaster.
- SD Library: The Arduino IDE comes with an SD library for interfacing with the SD card.
- RTC Library: Use the RTClib by Adafruit, which is compatible with both DS3231 and DS1307 modules.
#### Programming Workflow
- Initialize Modbus Communication:
- Initialize RTC Module: Set up the RTC to ensure it has the correct time.
- Use the Modbus library to set up communication parameters (e.g., baud rate, parity).
- Read Data from Modbus:
- Use the Modbus library to read the required data from the Modbus registers (e.g., meters, input registers).
- Get the Current Time from the RTC: Get the current date and time for logging.
- Write Data to SD Card:
- Use the SD library to open a file on the SD card, write the Modbus data, and then close the file.
#### Arduino Source Examples
[Example Arduino Prototype](https://git.warky.dev/wdevs/vivarox-ems-modbus/src/branch/main/Arduino/basic_read.cpp)
#### Addition Software Notes
- Ability to reset and write logs to newly inserted SD card.
- Writing to files stamped by day.
## Costs
This estimated cost of the hardware from supplier like Micro Robotics, excluding the labour to assemble:
R617.00 per unit using the Arduino MEGA
R374,5 per unit using the Arduino UNO
## Raspberry Pi Option:
[Check this page for the Raspberry PI option](https://git.warky.dev/wdevs/vivarox-ems-modbus/src/branch/main/raspberry-pi-option.md)

Binary file not shown.