In this Project raspberry pi and Arduino UNO are Used. Raspberry Pi is used for sending control signals to Arduino and controlling all the activity of Arduino meanwhile the Arduino is used for sensing the o/p of LM 35 and all the other sensors which is connected with it.
For this I used the Raspbian ROM for raspberry. I installed pyserial into it and Arduino IDE for communicating with Arduino UNO. I’ve made connection between the Raspberry Pi and Arduino UNO with USB cable, and uploaded the scratch into Arduino named “temp.ino”. The circuit diagram of connection of LM35 and relay with Ardunio is shown in the file named “circuit connection”.
Now I have three ways to monitor the data in real time :
1) Sensing the data serially and the temperature is continuously shown on screen, temperature is updated every second. For this I’ve used following code given in the file named “dataLogger.py” .this code is in python language. For running this code through terminal, type the path where this code has been saved and then following command :
Sudo python dataLogger.py
This command will show the temperature in realtime and also generate one “.dat” file named “tempLog.dat” file.
2) Plotting the data which is stored in the “dataLogger.dat” file we have to first install the “gnuplot ” application into Raspbian using following command:
Sudo apt-get installgnuplot
Now the code for plotting the data using the “dataLogger.dat” is given in the file named “plotData.plt”
For plotting data using this code type following code in terminal :
This command will generate the PNG file showing the plot of sensed data.
3) For plotting the sensed data in real time or for monitoring the data in realtime I have the third method. The code file for it is named “real_time_plot.py” and for use it type following command in terminal
Sudo python real_time_plot.py
This will continuously show the plot of real time sensing temperature.
The working of this project is such that whenever the temperature goes beyond the limit of 50 degree then the alarm LED will glow and the fan starts for cooling down the temperature and when the temperature is less than 40 degrees then the green LD shows the normal situation.
There are many ways to setup the RaspberryPi, depending on your needs and the peripherals you wish to use. The set up process can be completed in five basic steps as shown.
Hardware features of Raspberry Pi
Basic Equipment required for general Setup :
1. Micro USB Charger (rated at 5V 700mA minimum), plus micro USB cable if needed.
2. SD Card (2Gb up to SDHC 32Gb), plus suitable card reader.
3. HDMI Cable/RCA cable for display
4. Compatible Mouse/Keyboard
5. Powered USB Hub (required for high powered USB devices)
6. Network Cable (Ethernet)
Quick Start :
• Unzip the file that you just compiled in Ubuntu:
a) Right click on the file and choose .Extract all.
b) Follow the instructions.you will end up with a file ending in .img
This .img file can only be written to your SD card by special disk imaging software, so.
• Download the Win32DiskImager software:
a) Download win32diskimager-binary.zip (currently version 0.6)
b) Unzip it in the same way you did the Raspbian .zip file
c) You now have a new folder called win32diskimager-binary
You are now ready to write the Raspbian image to your SD card.
• Writing Raspbian to the SD card:
a) Plug your SD card into your PC
b) In the folder you made in step 3(b), run the file named Win32DiskImager.exe
If the SD card you are using isn't found automatically then click on the drop down box and select it. Then click Write. After a few minutes you will have an SD card that you can use in your Raspberry Pi.
• Booting for the first time:
a) At Raspberry pi login screen type “pi” and you will be asked for password which is "raspberry".
b) When you see the prompt: pi@raspberry ~ $ type "startx" for a graphical environment.
Screenshot of booting and login