Saturday, 16 February 2013

Mid semester break

Although it is semester break, I still attempting to test the pulse-width modulation (PWM) function of Arduino. This part is needed to move the fan with a variable speed in my project. After I search the internet, I found the simple code to test PWM with a DC motor. The DC motor speed can be manipulated with the variable resistor. This is the code:


int motor = 9;
int potenciometer = 5;

void setup(){
  pinMode(9,OUTPUT);
  pinMode(5,INPUT);

  Serial.begin(9600);
}

void loop(){
  int value = analogRead(potenciometer);
                     //read input value: range between (0,1023)
  int motor_speed = value/4;
                    //PWM can only ouput 255 different values

  analogWrite(motor,motor_speed);

  Serial.println(motor_speed);//for testing purposes
}


This is the connection I use to construct on breadboard.

Fortunately, the code works when I tested on breadboard and the results were true as what was expected.
This is before I tune the variable resistor. As you can see, the motor doesn't move.

In this picture, the motor move after I tune the variable resistor. If I tune it all the way, the motor will move to its maximum speed.

For this testing, I used the components DC motor 3V, Variable Resistor 10kΩ, Transistor TIP120, Diode 1N4001, resistor 330Ω and the Arduino microcontroller.

Sunday, 10 February 2013

FYP 2 Week 4

Now that I learned about the temperature sensor LM 35, it's time to test it on breadboard.  Since I use Arduino microcontroller, I learn how to use LM 35 with Arduino from the internet so that I can understand how does it function. To test it, we also need LCD display to show the temperature values. Below is the connection of Arduino and temperature sensor and the code I used to test the temperature sensor


This is on my own breadboard. It seems the temperature sensor functions as supposed to be.


Saturday, 2 February 2013

FYP 2 Week 3

LM 35 Temperature Sensor



The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature (in oC)


  • Why Use LM35s To Measure Temperature?
    • You can measure temperature more accurately than a using a thermistor.
    • The sensor circuitry is sealed and not subject to oxidation, etc.
    • The LM35 generates a higher output voltage than thermocouples and may not require that the output voltage be amplified.
Below is the typical performance characteristics of LM35 Temperature Sensor:


So based on the performance characteristic of this temperature sensor, I am confident to choose it since it has good sensitivity and it is also very affordable.

Sunday, 27 January 2013

FYP 2 Week 2

This week I was testing how to use LCD with the Arduino microcontroller. I just learn it from the Arduino website. I'm using the standard 16x2 LCD display. It's easy to display anything you want on the LCD display with Arduino. You just have to understand how to put what you want to display on LCD into your Arduino source code.


This is the connection of Arduino to LCD

The standard coding for LCD is like this:



/*
LiquidCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD
and shows the time.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/




// include the library code:

#include <LiquidCrystal.h>




// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);




void setup() {

// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

// Print a message to the LCD.

lcd.print("hello, world!");

}




void loop() {

// set the cursor to column 0, line 1

// (note: line 1 is the second row, since counting begins with 0):

lcd.setCursor(0, 1);

// print the number of seconds since reset:

lcd.print(millis()/1000);

}

Tuesday, 15 January 2013

FYP 2 Week 1

This is the first week of FYP 2. So far I have only bought the components for my project but I haven't started the project. I also met my supervisor, Sir Halim to ask him about how to proceed with FYP in this semester.

For my project, I plan on using temperature sensor, 16x2 LCD display to display the temperature, DC fan that will spin according to the temperature and the Arduino microcontroller.

Monday, 12 November 2012

Week 14 (4 to 10/11/2012)

I finally finished all the proposal and progress report of my project. I need a whole week to do it all since the progress report needs the draft of chapter 1, 2, 3 of the project report too. Alhamdulillah, I still managed to finish my work in time. I submitted my proposal and progress report on the first day of week 15 which is on Monday, 12 November 2012. I hope I can complete my project successfully and on time for the next semester.

Sunday, 4 November 2012

Week 13 (28/10/2012 to 3/11/2012)

In this week, I tried to do the progress report for my proposal. This is how to do the progress report:

- Introduction/Purpose

Purpose of the report: Very briefly explain the project.
Briefly explain what this progress report is for.
Time period covered for the Progress report.

- Work completed during this time period. (dates)


Explain what you have accomplished. Provide details.
Project Staffing. How much effort has been used to date?
Project Deliverables. Have they met the quality targets set?
- Work you need to complete before you finish the project.


What is the next step?
When do you expect to complete the next step?
What do you still need to do?
When do you expect to complete the project?
- Problems encountered.


Explain any unexpected developments.
Explain what you plan to do to correct these problems.
State whether the project is on schedule.
If not, why not?
How do you plan to correct these problems?
When will you be back on schedule?
- Conclusions

Besides progress report, we also have to do the draft of the chapter 1, 2 and 3 of our final year project report. This task will take a lot of time since I haven't done any of the chapters yet. I hope I can finish it soon.