This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:iot-open:remotelab:itt:relay [2018/11/15 06:21] – created rim.puks | en:iot-open:remotelab:itt:relay [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Relay module ===== | + | ===== ITT Relay module ===== |
| - | //Give an information, | + | This laboratory is located |
| ==== Introduction | ==== Introduction | ||
| - | //Here provide some general idea of the laboratory. Do not use very complicated phrases. It is to be understood by people with limited understanding of the technology. Photos, schematic and drawings may be attached | + | This laboratory |
| - | Write objectives for the laboratory i.e. "its purpose is to model ...." or " | + | |
| + | {{: | ||
| ==== Prerequisites ==== | ==== Prerequisites ==== | ||
| - | //Describe prerequisite readings, software, hardware (if any) - note - only those that apply to ALL scenarios, knowledge necessary to understand. I case single scenario requires some extra knowledge/ | + | For this laboratory, the student should understand basic MQTT concepts like topics, broker, subscribing and publishing. Also the basics of relays and where they can be used. |
| ==== Technical details ==== | ==== Technical details ==== | ||
| - | //Provide technical details on the construction | + | This laboratory consists of a relay module attached to the ITT IoT controller module. The relay module is an electrically operated switch |
| === Sensors === | === Sensors === | ||
| - | //Describe sensors (if any). Provide details on measured values, connection details, accuracy, protocols, its relation to the physical/ | + | This laboratory |
| - | === Actuators | + | === Specifications |
| - | //Describe actuators, their impact on the physical/mechanical part of the laboratory device, limits, connections, | + | * 5V 1-Channel Relay interface board |
| + | * Relay: SRD-05VDC-SL-C (AC 250V 10A, DC 30V 10A NO/NC) | ||
| + | |||
| + | === Electrical connection === | ||
| + | |||
| + | The signal lead of the servo is connected | ||
| === Software, libraries and externals === | === Software, libraries and externals === | ||
| - | //Provide a list of software, software libraries and external resources (i.e. files) necessary during code development. Please note, write here only common for all hands-on-labs scenarios (there is a relevant section in scenario template. Remove this section if empty.// | + | * ITTIoT libary |
| === Communication === | === Communication === | ||
| - | //Describe communication if it is implemented | + | The user can connect |
| === Limits === | === Limits === | ||
| - | //Provide information about limits on usage, i.e. need for maintenance/ | + | At the same time, only one user can program the controller. But all users connected to the Distancelab MQTT broker can subscribe and publish to topics specified. |
| ==== Hands-on labs ==== | ==== Hands-on labs ==== | ||
| - | //List study scenarios | + | |
| - | | + | === Example code === |
| - | | + | |
| - | | + | <code c> |
| - | | + | |
| - | Note, assume that more professional group automatically contains less professional ones. Note - use language and as appropriate to the target group, i.e.:// | + | #include < |
| - | < | + | #include < |
| - | | + | |
| - | | + | #define RELAY_PIN 5 |
| - | | + | |
| + | // If the message received switch relay | ||
| + | void iot_received(String topic, String msg) | ||
| + | { | ||
| + | Serial.print(" | ||
| + | Serial.print(topic); | ||
| + | Serial.print(" | ||
| + | | ||
| + | | ||
| + | | ||
| + | digitalWrite(RELAY_PIN, | ||
| + | | ||
| + | |||
| + | if(msg == " | ||
| + | { | ||
| + | digitalWrite(RELAY_PIN, LOW); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void iot_connected() | ||
| + | { | ||
| + | Serial.println(" | ||
| + | iot.subscribe(" | ||
| + | iot.log(" | ||
| + | } | ||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | iot.setup(); | ||
| + | pinMode(RELAY_PIN, | ||
| + | } | ||
| + | |||
| + | void loop() | ||
| + | { | ||
| + | iot.handle(); | ||
| + | delay(200); | ||
| + | } | ||
| + | |||
| </ | </ | ||
| + | |||
| ==== Support ==== | ==== Support ==== | ||
| - | //Give some information on how to access help, how to get support in case of the trouble etc.// | + | info@ittgroup.ee |