For this part, our first goal was to equally distribute the weight of the entire suction mechanism and storage space on a wooden frame. To achieve this goal, we designed a wooden frame from a 5 mm teak plywood that supports the suction mechanism along with the storage space as shown in the image. The weight of the suction mechanism is distributed in such a way that it was considerably heavy on the side where motor and fan is situated. We added wooden sheets at the front and back of the base in order to balance the suction mechanism and avoid its toppling due to higher weight on one side.
To achieve our goal, we created a transmitter and receiver system which was capable of controlling the motion of the prototype as well as trigger the vacuum status by transmitting the input data to the receiver module.
The major challenges for us in this stage were:
1) To establish a SPI (Serial peripheral Interface) connection with the controller.
2) To establish a proper reliable connection between the two nRF modules (radio modules)
3) Simultaneous connection of motor shield and the nRF Module with the microcontroller.
4) To effectively control the state of the vacuum.
System Design Description
The system consists of two parts i.e. transmitter system and receiver system.
Transmitter System
The transmitter system consists of a joystick, an nRF module, Arduino UNO, and a 9V battery. The joystick has two potentiometers that will transmit values in the x and y direction respectively. It has one push button that will transmit value in z-direction. The x and y values indicate the motion of the vehicle. A positive x value indicates that the vehicle will move in the rightward direction and a negative x value indicates that the vehicle will move in the leftward direction. Similarly, a positive y value indicates forward motion and a negative y value indicates backward motion. The nRF24L01 is a wireless transceiver module, meaning each module can transmit as well as receive data. The nRF module will transmit joystick values and receive ‘data received’ confirmation. If the confirmation is not received , the same data will be transmitted repeatedly and the connection will not be successfully established. The Arduino UNO is a microcontroller that takes data from the joystick and feeds it to the nRF module.
Transmitter System Circuit
Code to implement the transmitter circuit
Receiver System
The receiver system consists of an nRF module, motor shield, a 5 volt relay module, Arduino MEGA, a 12 volt battery, and a 9V battery. The nRF module receives data and transmits a confirmation of the received data.The z value transmitted by the push button will trigger the on and off condition of the relay. Thereafter, the relay will transmit the on and off motion to the vacuum. Arduino MEGA receives and interprets data from the nrf module and it maps the 10-bit data into 8-bit data and feeds it to the motor. It also controls the state of the relay. Arduino MEGA cannot power 4 BO (Battery Operated) motors by itself. Therefore, we used the L293d motor shield that helps power and control the 4 BO motors by using a separate power source (12V battery). The L293d motor shield is capable of running four DC motors at the same time as well as the direction of the motors can be controlled independently and efficiently. We have used a 9V battery to power UNO as well as MEGA.
Circuit Diagram for Receiver System
Code to implement the receiver circuit
Shortcomings and Learnings while coding
Shortcoming in communication between arduinos:
We use nRF24L01 for communication between arduinos. The SPI (Serial peripheral Interface- used by microcontrollers to communicate with multiple peripheral devices (MISO,MOSI) quickly over short distances) communication pin on Arduino Mega actively uses Pin 8 for SS (slave select- pin on each device that the microcontroller can use to enable and disable specific devices ) which is further actively used by the Motor shield to operate one of the DC motor.
Learning
From researching, we found that instead of the slave select pin, the nRF24L01 uses the CE (chip enable) pin which can be any digital pin on the board. We kept the pin 30 for the CE pin.
Shortcoming for integer array transmission:
We faced serious difficulties in transmitting and receiving data in integer form as compared to character array transmission because we have to define the size of an integer array beforehand.
Learning
We overcome this problem by first passing the data in character form and then converting the data into integer form upon receiving.
Shortcoming in setting a threshold value for minimal movement of motor:
Even small movements in the joystick caused minimal movements in the motor.
Learning
We enabled a buffer zone through which the motor won’t move for small movements in x and y directions. Buffer zones act as a threshold value for minimal movement of the motor.
Shortcoming while changing state of z-axis variable permanently after one joystick click:
The value after one click will change its state from 1 to 0 and after a second click its state will change from 0 to 1. But in our case, when the z axis button was pressed, we were getting the value 0 for a brief moment and not a change in state
Learning
We created a logical code to change the state of a variable every time the z pin is pressed on the joystick.
Testing the circuit for vacuum status (Here, the tube-light is being controlled instead of the vacuum status)