Chapter 5: System Specifications and Implementation
5.1 Specification: Analysis and Design
5.1.2 System hardware connections and setting up
In this section, the hardware connections will be set up and make sure the requirements are met. To demonstrate the connections between components, let’s break it into 2 parts, the remote site (Arduino Micro/Nano) and the base station (Arduino UNO). Hence, a list of required components are shown:
Remote Site
- Arduino Micro/Nano
- 433MHz RF Transmitter Module (with antenna: wire) - HC-SR04/US-015 Ultrasonic Sensor
- 433MHz RF Receiver Module (with antenna: wire) - 3 x 220 Ohm resistors
- 1 x USB Cable for Arduino UNO - RGB Led
First, the setup of remote site (Arduino Micro/Nano) will be discussed and explained. In remote site, the microcontroller need to be small and fit the size in the garbage bin cap.
Hence, Arduino Micro/Nano is used, not only due to this reason, both of these microcontrollers can save more energy last longer as compared to those bigger microcontroller, such as Arduino UNO, MEGA, etc, which are very power consuming.
With Arduino Micro/Nano, the simple data collecting can then be performed. First, the setting up of 433MHz RF Transmitter Module will be discussed.
433MHz RF Transmitter Module
Figure 5.5: Physical connection of RF Transmitter to Arduino Nano
The 433MHz RF Transmitter is setup as shown in above. The 433MHz RF Transmitter is used to transmit the data from Arduino Micro/Nano (remote site) to Arduino Uno (base station). As shown in the figure above, the Data (in) pin of transmitter is connected to the output pin 12 of Arduino Micro/Nano. The Arduino Micro/Nano will send its data to pin 12 so that the transmitter can get the data from Arduino Micro/Nano and forward the data to the base station’s RF Receiver Module. It is worth to mention that the 433MHz RF Transmitter will only work properly with the voltage supply of 5 V, otherwise, the data may be corrupted. An antenna wire will need to be inserted to the RF Transmitter Module to improve its maximum transferring range, as the range of the ordinally 433MHz RF Transmitter is quite short (≤ 3 - 4 m).
HC-SR04/US-015 Ultrasonic Sensor
Figure 5.6: Physical connection of Ultrasonic sensor to Arduino Nano
Ultrasonic Sensor is used to measure the level of garbage in the garbage bin. It will burst a microwave using trig pin and obtain the distance from echo pin. The general connection of Ultrasonic sensor is as shown in figure. From the figure, can observe that the Ultrasonic requires 5 v in order to operate properly. If the voltage is not high enough, the measured value will be rather inaccurate. Notice that the ultrasonic sensor do not need any resistor in between the power source and input pin. The Trig pin of Ultrasonic sensor is connected directly to the Pin A0 of Arduino Micro/Nano, pin A0 will be set as output pin to send the signal to Trig. The echo pin is connected to Pin A1 of Arduino Micro/Nano. Pin A1 will served as an input pin to receive the reflected distance. One can obtain the measured distance from pin A1 (input) of the Arduino Micro/Nano and perform some calculation and conversion to change the raw data into a more readable data.
Tilt Switch
Figure 5.7: Physical connection of Tilt sensor to Arduino Nano
Tilt sensor is used to detect whether the garbage bin has been collapsed or not. The connection above shows that the tilt sensor is connected to Arduino Micro/Nano. In order to make the tilt sensor work, the power supply 5v and GND is necessary. As shown in the figure above, the data will be either ‘0’ or ‘1’. By observing the state of the tilt sensor, one can know that whether the garbage bin is standing still or has been collapsed.
Battery Level
Figure 5.8: Battery level detection using voltage divider
In order to detect the battery level of the remote site, the voltage divider shall be applied to the system. This voltage divider used 2 x 10 K Ohm resistors to divide the 9 volts into 4.5 volts. The reason being is that the A2 analog input pin cannot withstand with volt that is bigger than 5v, hence, a voltage divider will be needed. The voltage divider is as shown as above.
The whole setup of remote site
Figure 5.8: The whole setup of the Arduino Micro/Nano is remote site
The graph above shows the whole connections for remote site Arduino Micro/Nano, after integrating all the components into a single module. It is notable to mention that there are more remote sites to be added to the system, the same methodology and setup applied to all the other addons (Arduino Micro/Nano).
The next part to discuss is on the base station. The main purpose of base station is to collect all the sensor data from various remote sites, and then process them before sending to Raspberry Pi. Arduino UNO act as a middle man between sensors and
Raspberry Pi, this is necessary because Arduino UNO and Arduino Ethernet Shield has a capability to access internet. First the setup of Arduino Ethernet Shield will be discussed.
Ethernet Shield
Figure 5.9: Arduino Ethernet Shield on top of Arduino UNO
From the image above, one can observe that the Ethernet Shield work together with Arduino UNO by just putting the Ethernet Shield on top of the Arduino UNO. This will add the ethernet capability to the Arduino UNO as it provides an ethernet port as shown in the image. This ethernet port will enable the Arduino UNO to have access to internet, hence, the data collected from Arduino UNO can be send to the Raspberry Pi via internet.
The ethernet port needs to have an ethernet cable RJ45 to connect either to a router, or to bridged network from pc/laptop, by doing this, the Arduino UNO will get its ip address and be able to access the internet for doing the rest of the processing, namely sending data to RPi.
433MHz RF Receiver Module
Figure 5.10: 433Mhz RF Receiver on base station (Arduino UNO)
433Mhz RF Receiver Module is used to receive data from 433MHz RF transmitter module. Receiver will receive the data via DATA pin as shown in the figure. The DATA pin is then forward the received data to Arduino Uno. The voltage requirement of RF Receiver is smaller which is 3.3V. If 5V is applied to the receiver, the data will sometime be lost and unstable. Hence, 3.3V is most suitable for RF receiver. Notice that an antenna (wire) is added to the RF Receiver Module, the purpose of doing so is to extend the receiving range of the receiver. If both ends (transmitter and receiver) applied with antenna, the data transmitting and receiving range will be greatly improved.
RGB led and the whole system
Figure 5.11: RGB Led with Arduino UNO for status monitoring
The image above shows the whole module of base station, which consists of Arduino UNO, Arduino Ethernet Shield, 433MHz RF Receiver module and RGB led. An RGB Led has been added to the system to act as a monitoring tool. When the led light is in blue color, it means that the module is searching for any available data from remote site. Vice versa, when the led light is in green color, it means that the module has successfully get the data from one of the remote sites. Hence, this will act as an signalling led to show whether the station is receiving any data.