As a final wrap up, demo day has ended. Some problems we face included the robot's soldering breaking, so the group which we shared the robot with went to repair the soldering on the robot. Other than some last minute problems, the whole project worked smoothly other than the whole setup being quite bulky. However, as the project was more about getting the signal to the robot rather than the movement of the robot, it worked well.
The following file is a video clip showing the motion of the robot
Lastly, a final system diagram of the project
0 Comments
This week, we aimed to finish up our testing for our program. With all our other components tested, the last thing we had to test was the interactivity between the Telegram bot and the Python robot. Also, we had to individually connect our GPIO pins instead of to the breadboard as the connection of the breadboard would be too bulky which would cause the robot's movement to be very cumbersome
We managed to successfully test our code by inserting the code into the Telegram bot's function. The bot can also activated via external device with Telegram such as a mobile phone and therefore, we do not need to run Telegram on the Pi. For this week we tested the interactivity between Raspberry Pi's GPIO pins and the telegram bot that was made the week before. We also tried using Wi-Fi instead of Wired Internet, however it didn't appear to work so for Demo Day, we will need to be using Wired Internet in the Pi. Otherwise, we managed to successfully test the Telegram Bot activating the GPIO pins of Raspberry Pi as well as test the dust detection, LCD display and LED alerts for the Raspberry Pi. Now, the final thing to do is to use Telegram to activate the Python robot that we are sharing with another team to simulate the robot being activated remotely via the Telegram Bot.
This week we tested our code on the Raspberry PI. To test if the bot can interact with the Telegram API, we tried to download Telegram on the Raspberry PI. However, the Telegram executables don't run on Raspberry PI so we attempted to use external libraries to install Telegram. In the process of installing, one of the command caused the operating system to malfunction and our P1 tutor had to restore the operating system the following day.
Once we had the PI working again, we were able to test the Telegram bot which managed to successfully work on the system. Due to the technical difficulties, we lost some productivity this week. In the following week, we hope to be able to start testing using the Python robot that we are sharing with another team. This week, I started to delve into implementing the triggers for IFTTT to link up Telegram. Our P1 tutor also provided our team with a Python robot as my Samsung Cleaning Robot was too old and could not interface with the internet. However, more problems arose as IFTTT can only interact with web services and could not interact with the Python robot remotely. Afterwards, our tutor told us a Telegram bot could help run the Python code. For example, the user could message a key phrase or a command to activate the robot when receiving the Pushbullet notification about high dust levels. The Telegram bot, which I would have to learn how to program, would then fire up the robot. To create the bot, you would have to message another Telegram bot, known as BotFather. The process goes like this. 1. Input /newbot in the chat to create a new bot. 2. Input a username for the bot 3. Receive a token for the HTTP API Once I have received the API token, I can use Python to interface with the bot. The code goes as follows:
from telegram.ext import Updater #This imports the updater module to interact with the bot updater = Updater(token='525791259:AAE6IYhacb9Qy1et53LdVO2Nm5vO2u6OiTY') #This is the bot's token, telling Telegram to update this bot dispatcher = updater.dispatcher #Same for the dispatcher def start(bot, update): #This function is what happens when the command /start is input to the bot's chat bot.sendMessage(chat_id=update.message.chat_id, text="I'm a bot, please talk to me!") #print message into bot chat import testfile #prints hi in python shell from telegram.ext import CommandHandler start_handler = CommandHandler('start', start)#Assigns the /start command to the function start dispatcher.add_handler(start_handler)#Add name to bot updater.start_polling() #Updates bot With a simple Telegram bot that can receive a command to run code, next week, we will concentrate on programming the code for the robot. For our Portfolio assignment, we decided to do the topic of home and environment using dust sensors placed around the area of a house. Once dust levels exceeded a certain level, a notification will be sent through the PushBullet application which can prompt the user to activate the robot. My partner and I thought of this idea by thinking that smoke sensors could measured dust levels and we thought of hooking it up to a robot which would otherwise have to be activated manually. Currently, we want to use PushBullet to activate the robot through a software called IFTTT which allows us to interact with the robot. However, if PushBullet does the work we will use Telegram, which can interface with IFTTT. We will also have to check if the Samsung robot(shown below) I have in my home is able to interact with IFTTT. If not, we will simulate the whole process in Raspberry PI. As for the dust sensors, our P1 teacher said he would see if he could get some for us. Otherwise, we will have to get sensors on our own by buying them online. |
Tristan Cheah
Portfolio 1 Blog
|