Wednesday, 30 October 2013

Amazing happens

Today, I tried to use program to control feeder which is connected with the Raspberry Pi, however, amazing happens.

First, I tried to connected motor to 3.3V output pin (pin 1) in Raspberry Pi, the motor rotates normally as shown in Figure 1.
Figure 1: Schematic diagram for connecting motor to pin 1

However, when I program it and change pin 1 to pin 11, the diagram is shown in follows:
Figure 2: Schematic diagram for connecting motor to pin 11


However, the motor stopped all the time, but when I change motor to LED, the light will be turned on. 

So I measured the voltage of pin 11, it is 3.3V, voltage of pin 1 is also 3.3V, so I do not know why. It is amazing I am so confused. I think that there is no problem in pin 11, motor or cables. Therefore, I need to test it and find a problem. I think maybe the terminal of cable which is connected to pin 11. maybe loose or connect to other pins. I will give an answer in the future. 


Monday, 28 October 2013

Use remote desktop to control Raspberry Pi

I will introduce how to use remote to control raspberry pi using remote desktop. Firstly, install xrdp in Raspberry Pi directly or using SSH. The command is following:
$sudo apt-get install xrdp
And then install the Remote Desktop Connection in your computer. Next, find your Raspberry Pi's IP address using command.
$ifconfig
Input this IP address in the blank as shown in Figure 1:
Figure 1: Input IP for  remote connection

After that click connect, the interface is like Figure 2:
Figure 2: Input username and password for you Pi

Ok, we can connect our Raspberry Pi successfully like Figure 3:

If you can look this familiar desktop, you can control your Raspberry Pi from remote desktop.


Saturday, 26 October 2013

Use SSH to control Raspberry Pi

OK, let's think how to control your Raspberry Pi using your computer. Therefore, you do not need to connect keyboards and mice to your Raspberry Pi, you only need to control it using your laptop. I use my mac to control it, if you use Windows, the method is little different.

So the first thing is opening your Raspberry Pi and then open LXTerminal to input the following command:
$ifconfig
The following information will be shown as Figure 1, this information is related to the network of your Raspberry Pi. For SSH, the IP address is important. 

Figure 1: Display IP address in Raspberry Pi 

OK, now I know my IP address in Raspberry Pi, and then open your mac Terminal to input the following command.
$ ssh pi@Raspberry-Pi-Address

Notice: pi is the user default user name for your Raspberry Pi, if you have changed your user name, please replace it. And replace the Raspberry-Pi-Address to your IP address in Raspberry Pi as shown in Figure 2.


Figure 2: SSH interface 

OK, you can control your Raspberry Pi with using your laptop now, for example, control GPIO pins as shown in Figure 3:

Figure 3: Input command to control GPIO

OK, we can control it successfully, the result are shown in following figures:
Figure 4: LED is turned on

Figure 5: LED is turned off

OK, we have controlled Raspberry Pi successfully so far, and next I will shown how to control Raspberry Pi through remote desk.


Sunday, 20 October 2013

Python programming for controlling GPIO pins

Raspberry Pi has 26 GPIO pins, and GPIO is general purpose input/output. So if I can control the GPIO in raspberry pi, I will use raspberry pi control the devices. In this project, I chose Python to control Raspberry Pi.

There is a library can be imported to control the GPIO pins called RPI.GPIO  or another one is wiringPi. In my project, I will use RPI.GPIO. 

For testing the output GPIO pins, first of all I will use LED to test it. If LED is turned on, it means high voltage, otherwise, low voltage. So I wrote a small program for testing the output of pins as follows (save as Led_py.py):

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.OUT)
while True:
           GPIO.output(11,True)
           time.sleep(1)
           GPIO.output(11,False)
           time.sleep(1)

After that, when I run this program, the command is like this:
$ sudo python Led_py.py
Notice: We cannot run this program directly because we are not root, so we must use "sudo" like root.

The results are in the following video.
Video1: How to control Raspberry Pi

The LED will be turned on for 1 second, and then turned off for 1 second, so the program will run all the time expect I stop it.


Tuesday, 15 October 2013

Connect the Raspberry Pi to wireless network "eduroam" in University

My project is related to the wireless control with using Raspberry Pi, so connecting Wifi in university is an important step in my project. It is easy to connect my Pi to normal Wifi because I know the name of Wifi, so I only need to provide the password. However, the Wifi is a little different in the university because I not only need to provide the password but also need to provide the account. 

Therefore, I decide to use WiFi Config (Figure 1) in desktop to connect the Wifi.
Figure 1: WiFi Config Logo

Next, download the certificate from the university website and save it in the desktop. Then copy it to the file /etc/wpa_supplicant, but you cannot use right click to copy if you don't log in as root, so I suggest use "sudo" command.
$ sudo cp /home/pi/the_name_of_certificate /etc/wpa_supplicant

And then open the WiFi Config in the desktop and set it using the same way in website of university.
Figure 2: The way to set WiFi "endroam"

Therefore, I can connect the WiFi to the wireless network in the university, if you cannot, try to reboot it.

Friday, 11 October 2013

Cool Style, Cool Webcam

This is a new cool style to write bloggers, I use the iPad and Apple wireless keyboard to write blogger. It is so interesting as shown in the following picture.

              Figure1: New style to write bloggers

So this really fun, and the most funny thing is that my webcam is arrived last Friday. This is special webcam board for Raspberry Pi as shown in following:

             Figure2: Webcam board for Raspberry Pi

I will upload the test results later with using this webcam, so I hope you can wait.


Wednesday, 2 October 2013

About this Project

This is my Final Year Project in University of Liverpool, I always want to do the project related to the hardware and software at the same time. Yeah, this is my desired project. I hope that I can enjoy it in my final year.


This project will use Raspberry Pi with wireless to control device to feed the fish and camera to monitor them separately. Furthermore, Raspberry Pi may measure the temperature in water and control the heater to keep warm for fish.



I think when I finished this project, I can achieve the following basic function:

  • Use Raspberry Pi to control fish feeder automatically, for example, feed fish every 12 hours.
  • Use website to control Raspberry Pi (wireless) to feed the fish.
  • Raspberry Pi can monitor the fish and upload the video to the server, and then use website to receive this signal to observe how fish is fine.
  • Feed fish intelligently, the feeder will feed fish automatically if the webcam detects the fish.