Skip to content

7. Input & Output device

Arduino

  • Arduino IDE Software is used for coding. i downloaded the software from the website

To Connect The MKR WiFi 1010

  • After downloading and opening the software, i connencted the MKR Wifi 1010 by clicking on tools > Board > Board manager.then i wrote the name of the chip and installed the board.

Sensor Types

1. Digital

simplest one, is basically a contact that can be open and closed at will by some mechanical action. A pushbutton, a microswitch, a magnetic reed are examples of such sensor and they can all be read by Arduino using the digitalRead() function.

2. Analog

The analog sensors offer a continuous range of values in an interval depending on their type. If it is a voltage that is the consequence of a resistance of some passive component (soil moisture, photoresistor…) we need to consider that the voltage read is proportional to the current that flows into the resistor.

Liquid Level Indicator

Water Level Detection

Is masuring the level of liquid in deep tanks or water in reservoirs is done in order to control the depth of water and prevent it from the overflow in industry. it can be used to determine the level of liquid at any moment and do the required operation accordingly.

a. Code

Code File

b. Result

Comment

  • the sensor did not give a very accurate results

Servo Motor

Sweep Circuit

  • connect the servo motor to +5V, GND and pin 9

Code

Code File

  • I also tried to change the delay to 10 seconds, where it waits 10ms for the servo to reach the position

Result

RGB Full Color LED SMD Module

Code

Code File

Result

Linking Output With An Input

  • Code

  • Code File

  • The RGB should give a red color output when the water sensor touches the water and blue when the water sensor is dry.

  • When it touches the water

  • When its Dry

Comments

  • I did find it a little difficult to do the circuit of connecting both input and output devices, However, i managed to do it at the end.

Last update: September 9, 2022