Automatic Medicine Box with Pinoo
Purpose of the Project: To make a system that warns and automatically opens the cover of the relevant drug by using a Pinoo control card, servo motor, buzzer module and LCD display module.
Duration: 2 lessons
Pinoo Set: Maker Set, Full Set.
Age Group: 7 years and over
• Learns to code Pinoo control card.
• Learns to use an LCD screen.
• Learns to use buzzer module.
• Learns to use servo motor.
• Improves the skill of setting up algorithms.
• Improves coding skill.
Materials to be used: Mblock 3 program, Pinoo control card, servo motor, buzzer module, lcd display module, connection cables.
Materials required for design: 3D printouts, silicone gun and silicone.
For our project, we will integrate our servo motor first.
We fix our servo motor to the body of our medicine box, which we designed, with a silicone gun.
Then, after adjusting the angle of our pharmaceutical servo motor, we fix the cover and servo motor brush with the help of a silicone gun.
Then we fix our ramp, where we will place our LCD display module and buzzer module, with the medicine box.
We fix our LCD display module to our ramp with a silicone gun as in the picture.
After fixing our buzzer module under our LCD display module, we make the Pinoo control card connections. We connect our LCD display module to door number 10, our buzzer module to door number 2, and our servo motor to door number 1. In this way, we finish our design part.
2.Adding Pinoo extension:
From the ‘’Extensions’’ tab, we click on the "Manage Extensions" option.
In the window that opens, we type "Pinoo" into the search engine and simply say download to the result.
It was installed on our computer.
- Connecting the Pinoo sensor board to the computer:
In Mblock 3, we click on the "Connect" tab on the upper left.
We click on the "Serial Port" section from the window that opens and select the "COM6" option from the page that opens.
NOTE: Since the port entries of each computer are different, the numbers next to the COM text may change.
We click on the Cards tab.
We select the "Arduino Nano" card option used by the Pinoo sensor card from the window that opens.
We click on the ‘’Extensions’’ tab.
In the window that opens, we select the extension "Pinoo" of the sensor card we use.
We click on the ‘’Connect’’ tab.
We click on "Firmware Update" from the window that opens.
- Coding part:
First, we place our LCD screen identification code under the "Pinoo Program" code to check if our LCD display module is working. Then, we place the 'Pinoo LCD Print' code and upload it to arduino. After the installation, we see the text "Hello World!" on our LCD screen. In this way, we check the working status of our LCD screen.
When the green flag is clicked, we control our buzzer module by running it with a sound code under its code.
In order to keep our time data, we create a variable from the Data & Block section and call "time" in the name of our variable.
At the beginning of our codes, we set our sure variable to 0. Then we introduce our LCD display module. Then, at the beginning of the program, we added our write code to write the text "Drug Box" on our LCD screen module and changed the column part to 3 to write it in the middle of our screen. We have made this article stay on the screen for 5 seconds.
Later, we had to increase our duration variable by 1 continuously.
If we use the condition block to check our time variable. If our duration variable is equal to 10, we delete the texts written on our LCD display module. Then, we print the "08:00 am" text and give a warning for 1 second with our buzzer module and deactivate our buzzer module. After it became passive, we made a 1 second waiting process for the codes we created to work properly, we cleaned our screen again and kept it for 1 second. Here, our goal of keeping it for 1 second is to make our text "08.00 o'clock" blink. We continue by adding our code to write the text we want to flash. After adding the "08.00 o'clock" text code, we are adding our buzzer sound code because we want it to give an audible warning again. In fact, we are adding the above code because we want it to repeat the same code we have added into our block.
Since we cannot fit the text "Take the drug with number 1." On a single line, we print the word "buy" on the screen with the command write on the second line. Again, with the buzzer module, we make a sound warning, add the angle code so that the lid of our servo motor is at the number 1, we wait for 5 seconds, we clean our screen. We print the "Medicine Box" text on our screen until the next medication time.
(COMPLETE CODE PAGE)
(ZOOMED IN. FIRST PART)
(ZOOMED IN. SECOND PART)
(ZOOMED IN. THIRD PART )
We add our other if block to alert at the next hour. If our duration variable is equal to 20 (we have done to see the duration values here in a short time, different values can be entered.) We added our code. There are 3 differences from our codes in the 1. if block. First, we changed the text of "08:00 am" to "13:00 am". Second, we changed the text "Take the drug number 1" to "Take the drug number 2". Third, we changed our servo motor angle to 100 degrees.
Likewise, if our time variable is equal to 30, we encode the condition block for the part of the day for the evening drug. There are 4 differences from other condition blocks this time. We change the 3 changes in the same way. Our fourth change is to reset our time change because the day is over. In this way, we also finish our coding.
We right click on the "Pinoo Program" command and select the "Upload to Arduino" option in the window that opens.
On the page that opens, we click on the "Upload to Arduino" button selected in red.
Our codes are uploaded to our Pinoo control card.
we click on the "Close" button after the "Download Finished" text appears.
After the installation is finished, the battery compartment is inserted and the project is run.
- Working Status of the Project:
With our practice, we have built a system that will alert us to take the necessary medicines when our medication time comes and return to that compartment whenever needed.