Saturday, 31 March 2012

Week 10

After done with stand alone arduino circuit, i start to construct the reed switch sensor to Atmega 328 with LCD display. 


Part list
1. Stand alone arduino circuit from last week (Atmega 328)
2.2x16 LCD  ( refer week 8)
3. reed switch
4. resistor 10 kohm




First step, i sketch the schematic diagram by using fritzing software like figure below:


Full schematic diagram using fritzing
Second step, i construct the connection on the breadboard like figure below:




Full connection on Breadboard





Then, i  upload the programmed by Arduino board to Atmega328P-PU :



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




 */


// include the library code:
#include <LiquidCrystal.h>


// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);


int ledPin = 13;               // choose pin for the LED




void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
   pinMode(2,INPUT);
   pinMode(ledPin, OUTPUT);      // declare LED as output
 // Print a message to the LCD.
  lcd.print("    Welcome   ");
  lcd.setCursor(0, 1);
  lcd.print("  Mc-Ergocycle  ");  
}






void loop() {
   
   if ( digitalRead(2)== HIGH)             // == digunakan bagi declare condition
   {  digitalWrite(ledPin, HIGH);  // turn LED OFF
  } else {
    digitalWrite(ledPin, LOW); // turn LED ON
  } 
  
   }
   
  

After uploading the programmed, i has testing the circuit and get the result as show in figure below : 






Video for the testing :










Saturday, 24 March 2012

Week 9

During Arduino Workshop last week, sir Zulkifli has recommend us to build stand alone arduino rather than use Arduino board for fyp.For this week, by refer to Setting up an Arduino on a breadboard website, i start to sketch the stand alone arduino circuit by using fritzing software. Then, i start to construct on the breadboard. 


Atmega 328 & Arduino pin mapping
Stand alone arduino on Fritzing

Part list:
1) 2 capacitor 10uF 
2) 1 7805 voltage regulator
3) 2 Led
4) 2 resistor 220ohm
5) 1 resistor 10kohm
6) 1 push button switch
7) 1 clock crystal 16 MHz
8) 2 ceramic capacitor 22pF





Construct stand alone arduino on breadboard

Video below show the testing of stand alone arduino with Atmega328:





Monday, 19 March 2012

Arduino Workshop

On 17 March 2012, i had attended Arduino workshop that organised by Medical Electronic Club. This workshop has been held from 8.30 a.m to 5 p.m  at training room, Level 6 Unikl BMI.


Banner of Arduino Workshop
This workshop is conducted for the beginners like me and relayed by Sir Zulkifli who is known as a lecturer that really adept in Arduino field. The main objective for me to be participate in this workshop is to gain more knowledge about Arduino and to get some idea for my fyp. From this workshop, i have learn how to use Arduino, operation of Arduino, basic coding and the application that i can use for my fyp.



Arduino Workshop 

Friday, 16 March 2012

Week 8

After mid term break,i start to find component that i needed to construct a circuit.First, i sketch it like below:



I do not have chance to go to Jalan Pasar yet,but i have 16x2 LCD display in my toolbox, so i decided to construct circuit from Arduino to LCD display first.


LCD display is great way to display output from  arduino when it not connected to my computer. The common display used in arduino projects is 16×2 parallel LCD display which compatible with the Hitachi HD44780 driver. It can easily recognize with it 16 pin interface.


I try to print out text message “welcome mc-ergocycle” .


Parts List that i needed :


1) 1x 16×2 parallel LCD display
2)  Arduino board
3) 1x 10kΩ potentiometer
4) Jumper wire
5) Breadboard


Procedure:
1) I constructed a circuit as shown on below:
(refer from arduinoprojects101 )






2) The potentiometer use for adjusting the contrast of the LCD character.
3) Then i edit some part of code of 'hello world' then upload to my arduino as below:




4)As a result, i succeed to display welcoming message as shown below:


Friday, 2 March 2012

Week 7

This week is phase test week, i have problem to balance my time  between fyp and phase test. I am also did not get chance to go to see madam Naszariah. But, after my last paper on 29 march , i manage to go to Jalan Pasar with my friends to buy Arduino kit  as picture below:
Arduino Uno R3
I am also make some tutorial to test Arduino board that i have bought with led blinking as below:
First, before i start to test my arduino , i need to setup the connection between my PC and arduino board. I need arduino board and USB cable as below:




Arduino board
USB cable


 Arduino Environment Software  


Step to be done on my laptop:
1) Connected arduino board with USB cable and USB port at my laptop



2) Select my arduino board type: Tools>Boards>Arduino UNO


3) Select my serial port: Tools>Serial Port>COM 25. Serial Port selection is depending on what COM port is free during setup. 


4)Open sketch example, File>Examples>1.Basics>Blink









5) Click upload button to upload the code to
arduino. Wait until “Done Uploading” message status appear. 

6) This video show LED was blinking and i have succesfully install my arduino.