Introduction: PLANT ROBOT
Everyone enjoys having plants at home, but sometimes with our busy lives we don't find the time to take well care of them. From this problem we came up with an idea: Why not building a robot that would take care of it for us ?
This project consists of a plant-robot that takes care of itself. The plant is integrated in the robot and will be able to water itself and find light while avoiding obstacles. This has been possible by using several sensors on the robot and the plant. This Instructable aims to guide you through the process of creating a plant robot so you don't have to worry about your plants every day !
This project is part of Bruface Mechatronics and has been realized by:
Mercedes Arévalo Suárez
Daniel Blanquez
Baudouin Cornelis
Kaat Leemans
Marcos Martínez Jiménez
Basile Thisse
(Group 4)
Step 1: SHOPPING LIST
Here is a list of every product you will need in order to build this robot. For every piece underlined a link is available:
3D printed Motors support X1 (copy in 3D)
3D printed Wheels + wheel-motor connection X2 (copy in 3D)
AA Nimh batteries X8
Arduino Mega X1
Breadboard to solder X1
Hinges X2
Hygrometer X1
Male-male & male-female jumpers
Motor shield X1
Plant X1 (this is up to you)
Plant pot X1
Plant support X1 (3D printed)
Plastic tube X1
Resistors of different values
Scratch paper X1
Screws
Sharp sensors X3 (GP2Y0A21YK0F 10-80 cm)
Switch X1
Water pump X1
Water reservoir tank (small Tupperware) X1
Wires
Please note that these choices are a result of time and budget constraints (3 months and 200€). Other choices can be made at your own discretion.
EXPLANATION OF THE DIFFERENT CHOICES
Arduino Mega over Arduino Uno: Firstly, we should as well explain the reason why we have used Arduino at all. Arduino is an open-source electronic prototyping platform that enables users to create interactive electronic objects. It is very popular between both experts and novices, which contributes to find a lot of information about it on the Internet. This can come in handy when having a problem with your project.
We chose an Arduino Mega over an Uno because it has more pins. In fact, for the number of sensors we use an Uno didn't offer enough pins. A Mega is also more powerful and could be helpful if we add some improvements like a WIFI module.
Nimh batteries: A first idea was to use LiPo batteries like in a lot of robotic projects. LiPo have a good discharge rate and are easily rechargeable. But we soon realized that LiPo and charger where too expensive. The only other batteries suitable for this project where the Nimh. Indeed they are cheap, rechargeable and light. In order to power the motor we will need 8 of them to achieve a supply voltage from 9.6V (discharged) to 12V (fully charged).
DC motors with encoders: Considering the main goal of this actuator, provide rotational energy to the wheels, we chose two DC Motors rather than Servo Motors which have limitation in the angle of rotation and are designed for more specific tasks where position needs to be defined accurately. The fact of having encoders also adds the possibility of having higher precision if needed. Note that we finally didn't use the encoders because we realized that the motors where pretty similar and we didn't needed the robot to precisely follow a straight line.
There are a lot of DC motors on the market and we were looking for one that fits our budget and robot. In order to satisfies these constraints two important parameters helped us to choose the motor: the torque needed to move the robot and the velocity of the robot (to find the rpm needed).
1) Calculate the rpm
This robot will not need to break the sound barrier. In order to follow the light or to follow someone in a house a speed of 1 m/s or 3.6 km/h seems reasonable. To translate it into rpm we use the diameter of the wheels: 9cm. The rpm are given by : rpm = (60*speed(m/s))/(2*pi*r) = (60*1)/(2*pi*0.045) = 212 rpm.
2) Calculate the maximum torque needed
Since this robot will evolve in a flat environment the maximum torque needed is the one to start the robot moving. If we consider that the weight of the robot with the plant and every component is around 3 kilos and using the friction forces between the wheels and the ground we can easily find the torque. Considering a friction coefficient of 1 between the ground and the wheels: Friction forces (Fr)= friction coeff. * N (where N is the weight of the robot) this gives us Fr = 1 * 3 * 10 = 30 N. The torque for each motor can be found as follow: T = (Fr * r)/2 where r is the radius of the wheels so T = (30*0.045)/2 = 0.675 N.m = 6.88 kg cm.
These are the characteristics of the motor we chose: at 6V 175 rpm and 4 kg cm at 12V 350 rpm and 8 kg cm. Knowing that it will be powered between 9.6 and 12V in by doing a linear interpolation it clearly appears that the above constraints will be met.
Light sensors: We chose light dependent resistors (LDR) because their resistance vary rapidly with light and the voltage on the the LDR can be easily measured by applying a constant voltage on a voltage divider containing the LDR.
Sharp sensors: They are used to avoid obstacles. Sharp distance sensors are inexpensive and easy to use, making them a popular choice for object detection and ranging. They typically have higher update rates and shorter maximum detection ranges than sonar range finders. A lot of different models are available on the market with different operating ranges. Because they are used to detect obstacles in this project we chose the one with an operating range of 10-80 cm.
Water pump: The water pump is a simple light and not too powerfull pump compatible with the range of voltage of the motors to use the same alimentation for both. Another solution to feed the plant with water was to have a water base separated from the robot but it is much more simple to have one on the robot.
Hygrometer: An hygrometer is a humidity sensor to be putted in the ground. It is necessary since the robot needs to know when the pot is dry to send water to it.
Step 2: MECHANICAL DESIGN
Basically, the design of the robot will consists of a rectangular box, with three wheels on the bottom side and a lid that opens on the upper side. The plant will be placed on top with the water reservoir. The plant pot is placed in the plant pot fixation that is screwed on the upper plank of the robot. The water reservoir is a little Tupperware scratched on the upper plank of the robot and the water pump is also scratched in the bottom of the water reservoir so everything can be easily removed when refilling the Tupperware with water. A small hole is made in the lid of the reservoir because of the tube of water going into the plant pot and the alimentation of the pump going in the box. A hole is thus made in the upper plank of the box and cables of the hygrometer are also passing through this hole.
Firstly, we wanted the robot to have an attractive design that is why we decided to hide the electronic part inside a box, leaving just outside the plant and the water. This is important since plants are a part of the decoration of the house and should not affect the space visually. The components in the box will be easily accessible through a lid on the upper side, and the side covers will have the necessary holes so that it is easy, for example, to turn on the robot or connect the Arduino to a laptop if we want to program it again.
The components in the box are : the Arduino, the motor controller, the motors, the LDR, the piles holders, the breadboard and the hinges. The Arduino is mounted on little pillars so its bottom is not damaged and the motor controller is mounted on top of the Arduino. The motors are screwed to the motor fixations and the motors fixations are then screwed to the bottom plank of the box. The LDR are soldered on a little piece of breadboard. Mini woods planks are glued to this breadboard in order to screw it to the lateral faces of the robot. There is one LDR in front, one on the left side and one on the right side so the robot can know the direction with the highest amount of light. The piles holders are scratched to the bottom face of the box in order to remove them easily and change the piles or recharge them. Then the breadboard are screwed to the bottom plank with little triangular shaped pillars having holes of the shape of the corner of the breadboard to support it. Finally the hinges are screwed on the back face and the top face.
On the front face, three sharps will be directly screwed in order to detect and avoid obstacles as good as possible.
Although the physical design is important we cannot forget about the technical part, we are building a robot and it should be practical and as far as possible we should optimise the space. This is the reason to go for a rectangular shape, it was the best way found to arrange all the components.
Finally, for the movement, the device will have three wheels: two standard motorized ones at the back and one ball caster in the front. They are displayed in a tri-cycle drive, configuration, front steering and rear driving.
Step 3: MANUFACTURING PARTS
The physical appearance of the robot can be changed based on your interest. Technical drawings are provided, what may work as a good grounding when designing your own.
Laser cutted parts:
All six parts that make up the case of the robot have been laser cutted. The material used for this has been recycled wood. This box could also be made out of Plexiglas which is a little more expensive.
3D printed parts:
The two standard wheels that are placed at the back of the robot have been 3D printed in PLA. The reason is that the only way to find wheels that met all the needs (fit in the DC motors, size, weight…) was to design them ourselves. The motor fixation were also 3D printed for budget reasons. Then the plant pot support, the pillars supporting the Arduino and the corners supporting the breadboard were also 3D printed because we needed a particular shape fitting in our robot.
Step 4: ELECTRONICS
Sharp sensors : The sharp sensors have three pins. Two of them are for alimentation (Vcc and Ground) and the last one is the measured signal (Vo). For alimentation we have the positive voltage that can be between 4.5 and 5.5 V so we will use the 5V from the Arduino. Vo will be connected to one of the analog pins of the Arduino.
Light sensors: The light sensors need a little circuit to be able to work. The LDR is putted in series with a 900 kOhm resistor to create a voltage divider. The ground is connected at the pin of the resistor not connected to the LDR and the 5V of the Arduino is connected to the pin of the LDR not connected to the resistor. The pin of the resistor and the LDR connected to each other is wired to an analog pin of the Arduino in order to measure this voltage. This voltage will vary between 0 and 5V with 5V corresponding to full light and close to zero corresponding to dark. Then the whole circuit will be soldered on a little piece of breadboard that can fit in the lateral planks of the robot.
Batteries : The batteries are made of 4 piles between 1.2 and 1.5 V each so between 4.8 and 6V. By putting two piles holders in series we have between 9.6 and 12 V.
Water pump: The water pump has a connection (power jack) of the same type as the alimentation of the Arduino. The first step is to cut the connection and denude the wire in order to have the wire for ground and the wire for positive voltage. As we want to control the pump, we will put it in series with a current controllable transistor used as a switch. Then a diode will be put in parallel with the pump to prevent backward currents. The lower leg of the transistor is connected to the common ground of Arduino/batteries, the middle one to a digital pin of the Arduino with a 1kOhm resistor in series to transform voltage of the Arduino into current and the upper leg to the black cable of the pump. Then the red cable of the pump is connected to positive voltage of the batteries.
Motors and shield : The shield needs to be soldered, it is shipped non soldered. Once this is done it is placed on the Arduino by clipping all the headers of the shield in the pins of the Arduino. The shield will be powered with the batteries and it will then power the Arduino if a jumper is on (orange pins in the figure). Be careful not to put the jumper when the Arduino is powered by another mean than the shield since the Arduino would then power the shield and it could burn the connection.
Breadboard : All components will now be soldered on the breadboard. The ground of one pile holder, the Arduino, the motor controller and of all sensors will be soldered on a same row (on our breadboard rows have same potential). Then the black cable of the second pile holder will be soldered on the same row as the red of the first pile holder whose ground is already soldered. A cable will then be soldered on the same row as the red cable of the second pile holder corresponding to the two in series. This cable will be connected to one end of the switch and the other end will be connected with a wire soldered on the breadboard on a free row. The red cable of the pump and the alimentation of the motor controller will be soldered to this row (the switch is not represented on the figure). Then the 5V of the Arduino will be soldered on another row and alimentation voltage of every sensor will be solderer on the same row. Try to solder a jumper on the breadboard and a jumper on the component when it is possible so you can easily disconnect them and the assembly of electric components will be easier.
Step 5: PROGRAMMING
Program flowchart:
The program has been kept rather simple using the notion of state variables. As you can see in the flowchart, these states also induce a notion of priority. The robot will verify the conditions in this order:
1) In state 2: Does the plant have enough water with the function moisture_level? If the moisture level measured by the hygrometer is below 500, the pump will be operated untill the moisture level goes above 500. When the plant has enough water the robot goes to state 3.
2) In state 3 : Find the direction with most light. In this state the plant has enough water and needs to follow the direction with most light while avoiding obstacles. The function light_direction gives the direction of the three light sensors that is receiving the most light. The robot will then operate the motors to follow that direction with the function follow_light. If the light level is above a certain threshold (enough_light) the robot stops to follow light since it has enough at this position (stop_motors). In order to avoid obstacles under 15 cm while following light, a function obstacle has been implemented to return the direction of the obstacle. In order to properly avoid obstacles the function avoid_obstacle has been implemented. This function operates the motor knowing where the obstacle is.
Attachments
Step 6: ASSEMBLY
The assembly of this robot is actually pretty easy. Most of the components are screwed to the box to assure they keep their place. Then the piles holder, the water reservoir and the pump are scratched.
Step 7: EXPERIMENTS
Usually, when building a robot things do not go smoothly. A lot of tests, with following changes, are needed to get the perfect result. Here is an exhibit of the process of the plant robot!
The first step was to mount the robot with motors, Arduino, motor controller and light sensors with a prototyping breadboard. The robot is just going in the direction where he measured the most light. A threshold was decided in order to stop the robot if he has enough light. As the robot was slipping on the floor we added abrasive paper on the wheels to simulate a tire.
Then the sharp sensors were added to the structure to try to avoid obstacles. Initially two sensors were placed on the front face but a third one was added in the middle because the sharp sensors have a very limited angle of detection. Finally, we have two sensors at the extremities of the robot detecting obstacles left or right and one in the middle to detect if there is an obstacle in front. The obstacles are detected when the voltage on the sharp goes above a certain value corresponding to a distance of 15cm to the robot. When the obstacle is on a side the robot avoid it and when an obstacle is in the middle the robot stops. Please note that obstacles below the sharps are not detectable so obstacles need to have a certain height to be avoided.
After that, the pump and the hygrometer were tested. The pump is sending water as long as the voltage of the hygrometer is below a certain value corresponding to a dry pot. This value was measured and determined experimentally by testing with dry and humid pot plants.
Finally everything was tested together. The plant checks first if it has enough water and then begins to follow the light while avoiding obstacles.
Step 8: FINAL TEST
Here are videos of how the robot finally works. Hope you enjoy it!
Step 9: WHAT HAVE WE LEARNT WITH THIS PROJECT?
Although the overall feedback of this project is great because we learned a lot, we have been quite stressed when building it due to the deadlines.
Problems encountered
In our case we had several issues during the process. Some of them were easy to solve, for example when the delivery of the components was delayed we just looked for shops in the city were we could buy them. Others require a bit more thinking.
Unfortunately, not every problem was solved. Our first idea was to combine the characteristics of pets and plants, getting the best of each. For the plants we could do it, with this robot we will be able to have a plant that decorates our houses and we won't have to take care of it. But for the pets, we did not figure out a way of simulating the company they make. We thought of different ways to get it follow people, and we started to implement one but we lacked time to finish it.
Further improvements
Although we would have loved to get everything we wanted, the learning with this project has been amazing. Maybe with more time we could get an even better robot. Here we suggest some ideas to improve our robot that maybe some of you want to try:
- Adding leds of different colors (red, green, ...) that tells the user when the robot should be charged. The measurement of the battery can be made with a voltage divider having a max voltage of 5V when the battery is fully charged in order to measure this voltage with an Arduino. Then the corresponding led is turned on.
- Adding a water sensor that tells the user when the water reservoir should be refilled (water height sensor).
- Creating an interface so that the robot could send messages to the user.
And obviously, we can't forget of the goal of getting it to follow people. Pets are one of the things people love the most, and it would be lovely if somebody could achieve that the robot simulates this behaviour. To facilitate it, here we are going to provide all we've got.
Step 10: How to Get the Robot to Follow People?
We figured out the best way to do it would be using three ultrasonic sensors, one emitter and two receiver.
Transmitter
For the transmitter, we would like to have a 50% duty cycle. In order to do this, you have to use a 555 timer, we had used the NE555N. In the picture, you can see how the circuit should be build. But you will have to add an extra capacitor at output 3, 1µF for example. The resistors and capacitors are calculated with following formulas: (pictures 1 & 2)
Because a 50% duty cycle is desirable, t1 and t2 will be equal to each other. So with a 40 kHz transmitter, t1 and t2 will be equal to 1.25*10-5 s. When you take C1 = C2 = 1 nF, R1 and R2 can be calculated. We took R1= 15 kΩ and R2= 6.8 kΩ, make sure that R1>2R2!
When we tested this in circuit on the oscilloscope, we got following signal. The scale is 5 µs/div so the frequency in reality will be around 43 kHz. (Picture 3)
Receiver
The input signal of the receiver will be too low to for the Arduino to process accurately, so the input signal need to be amplified. This will be done by making an inverting amplifier.
For the opamp, we used a LM318N, which we powered with 0 V and 5 V from the Arduino. In order to do this, we had to raise the voltage around the signal that oscillates. In this case it will be logical to raise it to 2.5 V. Because the supply voltage isn’t symmetrical, we also have to place a capacitor before the resistor. This way, we also have made a high-pass filter. With the values that we had used, the frequency needed to be higher than 23 kHz. When we used an amplification of A=56, the signal would go into saturation which is not good, so we used A=18 instead. This will still be sufficiant. (Picture 4)
Now that we have an amplified sinus wave, we need a constant value so the Arduino can measure it. A way to do it is to make a peak detector circuit. This way, we can see if the transmitter is further apart from the receiver or in a different angle than before by having a constant signal that is proportional to the intensity of the signal received. Because we need a precision peak detector, we put the diode, 1N4148, in the voltage follower. By doing so, we have no diode loss and we created an ideal diode. For the opamp, we used the same one as in the first part of the circuit and with the same power supply, 0 V and 5V.
The parallel capacitor needs to be a high value, so it will discharge very slow and we still see the kind of the same peak value as the real value. The resistor will also be placed in parallel and will not be too low, because otherwise the discharge will be larger. In this case, 1.5µF and 56 kΩ is enough. (Picture 5)
In the picture, the total circuit can be seen. Where out is the output, which is going to go into the Arduino. And the 40 kHz AC signal will be the receiver, where the other end of it will be connected to the ground. (Picture 6)
As we said previously, we couldn't integrate the sensors in the robot. But we provide the videos of the tests to show that the circuit works. In the first video, the amplification (after the first OpAmp) can be seen. There is already an offset of 2.5V on the oscilloscope so the signal is in the middle, the amplitude varies when the sensors changes direction. When the two sensors are facing each other, the amplitude of the sinus will be higher than when the sensors are have a larger an angle or distance between both. On the second video (the output of the circuit), the rectified signal can be seen. Again, the total voltage will be higher when the sensors are facing each other than when they aren't. The signal is not completely straight because of the discharge of the capacitor and because of the volts/div. We were able to measure a constant signal decreasing when the angle or the distance between the sensors was not optimum anymore.
The idea was then to make the robot have the receiver and the user the transmitter. The robot could do a turn on itself to detect in wich direction the intensity was the highest and could go in that direction. A better way could be to have two receivers and to follow the receiver that detect the highest voltage and an even better way is to put three receivers and placed them like the LDR to know in wich directions the signal of the user is emitted (straight, left or right).