Showing posts with label experiment kit. Show all posts
Showing posts with label experiment kit. Show all posts

Wednesday, October 21, 2015

Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal

Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal

In this project , we will measure surroundings temperature and it will be shown at MikroC USART Terminal . First of all we need to set up LM35  sensor with pic microcontroller and an ADC register will take data from the temperature sensor . After calculating the temperature in centigrade  it will be sent to  our computer's MikroC USART terminal through Bluetooth[HC-06] . That is the basic concepts of this project.

Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal
Bluetooth Based Temperature Meter Project using Microcontroller


We will need an ADC Converter so that microcontroller can read the temperature .

ADC [Analog to Digital Converter]:


Thief Detector using PIC Microcontroller & PIR Motion Sensor

Thief Detector using PIC Microcontroller & PIR Motion Sensor

Thief Detector using PIC Microcontroller & PIR Motion Sensor
ADCON1 Register
Basically ADC is like as voltage divider . According to voltage It produce output .
bit 5 : VCFG0: Voltage Reference Configuration bit (VREF- source)
1 = VREF- (AN2)
0 = VSS or 0 volt


bit 4 :VCFG0: Voltage Reference Configuration bit (VREF+ source)
1 = VREF+ (AN3)
0 = VDD or 5volt


We will set  VCFG0[bit 5]=0and VCFG0[bit4]=0 . So we will get highest value 5volt[1023] and lowest value 0volt[0].The ADCON1 is a 10 bit register that means  (2 to the power 10) is it's highest counting capacity and the result is 1024 . So this register can count from 0 to 1023 . When 0 volt , we get reading at RA0 pin  0 .When 5 volt , we get reading at RA0 pin 1023. It means 5volt equivalent to 1023 .
 If  1023 reading value    equal   to 5 volt.
So 1      reading value    equal   to  5/1023 volt
So 'read_val'  reading  value   equal  to (5/1023)*read_val .volt .
As we know LM35 reading can be changed  with  0.01 v per degree centigrade change , the temperature calculation should be like that :
    0.01 volt   for     1      degree centigrade Temperature
so  1     ,,       ,,  (1/0.01)   ,,         ,,              ,,
and (5/1023)*read_val    volt    for  [{(5/1023)*read_val }/0.01]  degree centigrade Temperature .


Mikro C Library Funtions :

UARTx_Init:  This function will initialize USART option of  Microcontroller with Baud rate . We will use baud rate 38400 . The code will be look like this :
 UART1_Init(38400);


UARTx_Data_Ready: This will check if it is available to read or transmit data .
UARTx_Read_Text: To read text data .Look at the example .
if (UART1_Data_Ready() == 1) {
UART1_Read_Text(  txt,  ")" , 13); }
This is checking if data is available to read . ")" means , txt car array variable will be being stored until the ")" will found . 13 means to try for 13 times . So , i think our text should not be longer than 11 character .
UARTx_Write_Text: This will send text data . Look at the example :

if (UART1_Tx_Idle() == 1) {// this will check , if the last data transmission is completed

 UART1_Write_Text("button2");
 }

Recommended: How to Interface Bluetooth Module (HC-06) with PIC Microcontroller [Step by Step Picture]




Circuit :



Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal
Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal

Source Code :


 char txt[8];  
 double chk;  
 int i=0,ckop=0;  
 void main() {  
 ADCON1=0x0E;         // Configure RE1 pin as input  
 CMCON=7;  
 for(i=0;i<16;i++){txt[i]=' ';}  
   TRISA.F3=1;  
    TRISA.F4=1;        // Initialize ADC  
 Adc_Init();  
   UART1_Init(38400);  
      delay_ms(200);            // Initialize LCD  
  while(1){  
  chk=Adc_Read(0);  
  chk=(chk*5)/1023;  
  chk=chk/0.01;  //10mV == 1 degree
  inttostr(chk,txt);  
  UART1_Write_Text(" Temperature:");  
  UART1_Write_Text(txt);  
  UART1_Write_Text(" \n");  
  delay_ms(6000);  
 }  
 }  

Result:


Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART TerminalBluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal

Bluetooth Based Temperature Meter Project using Microcontroller and MikroC USART Terminal




Download This Project

Thank You!

 

Friday, January 30, 2015

PIC Experiment Kit [for 28pin] with PCB Design




Today I will share an  Experiment Kit . Changing connections in breadboard is really disgusting and this problem can be solved by using this experiment kit.
This Experiment kit contains :
1. USB Connector
2. Serial Connector
3. 4 Push Button
4. LCD Display[16x2]
5. Female Connector for Bluetooth Device
One more thing , each pin of microcontroller is connected with female connector so that  each pin can be used  individually .We can provide power supply +5v  to breadboard from this kit .

 Required Parts List :

1. IC Base 28 pin
2.IC Base 16 pin
3. capacitor  22pf ceramic   qty=2 .
4. capacitor 220 nf  qty=2
5.capacitor  1uf 50v qty=5
6. Crystal 12MHz  qty=1
7. LM 35 [Temperature Sensor]
8. DC Socket qty=1
9.Resistor 10k ohm qty=4
10. Resistor 470 0hm qty=6
11.Variable Resistor 5kohm qty=1
12. LCD Display[16x2] qty=1
13. Seven Sigment Dispay qty=1
14.Push Button qty=4
15. USB Connector B-type qty=1
16. DB9F Connector  qty=1
17. IC-->  Max232 qty=1
18. IC-->  Pic 18f2550[or another PIC Microcontroller ,if you want]
19.Female Connector qty =3
20.L -Shaped Male Connector qty=1  & LED  qty=6 [Color depends on you] .
Those parts are required and if  you are in Bangladesh contact to TechShopBD.
  TechShopBD's Website ->> http://www.techshopbd.com/

Look at here :



Instructions are given on that picture। Position of 1uf capacitor & where to connect 470 ohm resistor etc. Be careful about that 1uf capacitor should be at least 20 volt and polar. During soldering you should be careful about [ +/- ] position .
The pcb design has been provided in the Download Link given below .






Next time in future i will show how to make PCB at home Inshaallah. Now I am describing about  how to use it.

PORT A:
Pin A0-> for LM35 [it is static and final, you cannot change it]
Pin A1->for  another adc input[]
From A2 to A5 for 4 push button , those will work with logical 0 .
[These pins are always remaining with +5v ]
nk
PORT B : B7 to B2  for LCD Display ।
LCD Configuration:

sbit LCD_RS at LATB7_bit;
sbit LCD_EN at LATB6_bit;
sbit LCD_D4 at LATB5_bit;
sbit LCD_D5 at LATB4_bit;
sbit LCD_D6 at LATB3_bit;
sbit LCD_D7 at LATB2_bit;
//////////////////////////////////////////////
Pin B1 and Pin B0 are connected with two LED .Where each led's +end is connected with  microcontroller.[If microcontroller provide '1' , Led will be ON and during 0 ,it will remain OFF]
You have to write code according to this configuration .

Experiment Kit
Experiment Kit 




One more thing,  here an option given for 7 Segment Display. But it has no connection with the microcontroller. Female Connectors have been given so that you can connect it manually.



Download Link(google drive) 

You can watch this experiment kit at Youtube. 

YouTube VideoLink 

 

Thank You!


Thursday, December 04, 2014

Create Blinking LED Project Using PIC Microcontroller [ PIC18F2550 ] [ step by step ]


Hi,
If you are a beginner  , it is perfect to start with blinking led .This is a very simple project and we need 7 LED and PIC 18F2550 microcontroller .In this project we will use MikroC compiler  to code.


Now we are going to Create this project  >>

Proteus Project  :



*Open Proteus and Create new project 

 You will see as below :
 

 After finishing those step ,You need to follow as below:



Pick all parts from library :

 


In  this way , pick from Library  "PIC 18F2550", "crystal" , " 22pf capacitor" , "green LED" ,"Power" and "Ground" .

 [ Note :If  you are absolutely a new with PIC 18f2550 microcontroller , you need to see Introduction with PIC 18f2550  to understand all ports and pin]
Create  Blinking LED Project Using PIC Microcontroller [ PIC18F2550 ]  [step by step ]
Create  Blinking LED Project Using PIC Microcontroller [ PIC18F2550 ]  [step by step ]



Now  we need the main hex file to operate .Here you need to take a look on here , we selected RB0-RB7 pins and made connection with GND port of  each LED .So if portB is 1 , those LED will be on .


MikroC Code :

Open MikroC and Create a new Project :








Now Write the source code given below :
Source Code
//////////////////////////////////////////////////////////////////////

void main(){
TRISB=0x00;
while(1){
 PORTB=0x01;
 delay_ms(400);
  PORTB=0x02;
 delay_ms(400);
   PORTB=0x04;
 delay_ms(400);
      PORTB=0x08;
 delay_ms(400);
      PORTB=0x10;
 delay_ms(400);
   PORTB=0x20;
 delay_ms(400);
    PORTB=0x40;
 delay_ms(400); 
 PORTB=0x80;
 delay_ms(400);
 }  }
////////////////////////////////////////////////////////////////////

TRISB is used for selecting PORTB as Input or Output . Here  1 for input and 0 for Output .
If we write TRISB=0xFF; and 0xFF will be in binary "11111111" .By applying this we get portb for input .
 If we write TRISB=0x00; and 0xFF will be in binary "00000000" .By applying this we get portb for output.  [if  you don't understand pinout of PIC 18f2550 please follow the link]
We used delay_ms(400) function .That means microcontroller stop for 400ms .
0x01 is hexadecimal number and in binary "00000001" .Means first pin or RB0 pin of  PORTB will be 1 .In this condition 1 means this pin gets +5v[VDD] and 0 means ground(GND) .It is said computer understand 0 and 1 .But it is just an electronic device which calculate something according to instruction.

So,
 0x00 <--------------> "all zero" <--------------> RB0,RB1,RB2,RB3,RB4,RB5,RB6,RB7 remain OFF
 0x01 <--------------> "00000001" <--------------> Only RB0 is +5v & allothers remain GND 
 0x02 <--------------> "00000010" <--------------> Only RB1 is +5v & all others remain GND  
 0x04 <--------------> "00000100" <--------------> Only RB2 is +5v &all others remain GND 
 0x08 <--------------> "00001000" <--------------> Only RB3 is +5v &all others remain GND  
 0x10 <--------------> "00010000" <--------------> Only RB4 is +5v &all others remain GND 
 0x20 <--------------> "00100000" <--------------> Only RB5 is +5v &all others remain GND 
 0x40 <--------------> "01000000" <--------------> Only RB2 is +5v &all others remain GND  
 0x80 <--------------> "10000000" <--------------> Only RB2 is +5v &all others remain GND 
Why  TRISB ?
Listen , A microcontroller can be used for many purposes and the specific purpose we need can be defined by the source code  . Basically in blinking led , each led will be on or off   in one after one way .That means each pin of PORTB will be on or off .For this purpose we need to initialize PORTB as output.
So we have to use TRISB to define PORTB as Input or Output .
When TRISB=0x00; all pins for OUTPUT.
When TRISB=0xFF; all pins for INPUT.
If in case PORTA , we will have to use TRISA .





Thank You!


Please Share and Bookmark posts.

Tags

: (1) 18F2550 (1) 36KHz (3) and (1) arduino (1) Based (1) battery (1) Bipolar (1) Blinking (1) blinks (1) Bluetooth (1) bluetooth device interfacing (1) bluetooth module (1) button (1) circuit (1) clock (1) control (1) crystal oscillator (3) Db9 (1) DC Motor (2) digital (2) Digital Voting Machine (1) digital voting machine using pic (1) display (2) DS1307 (1) electronic (1) embedded c programming tutorial (11) embedded c tutorial (11) experiment kit (4) external interrupt (4) flash (1) flashing (1) Gas Leakage detector (1) HC-06 (1) home (1) how (1) How to (10) i2c tutorial (1) in (1) indicator (1) infrared Connection (3) interface (8) interfacing (3) Interrupt (3) Introduction (1) IR Connection (3) IR Receiver (4) IR Transmitter (4) key pad (1) keyboard (1) keypad (1) lavel (1) Lcd 16x2 (2) lcd 2x16 (2) led (1) lm35 (2) LPG (1) machine (1) make (1) Make bootloader (1) making (1) matrix (1) max232 (1) membrane keyboard (2) meter (2) Micocontroller (1) microchip (4) microchip pic (2) microchips (3) microcontroller (9) microcontroller based (3) microcontroller programming (3) Microcontroller Project (4) Microcontroller Projects (1) microcontroller_project (2) microcontrollers (4) Microprocessor (2) mikroC (5) mikroc code to start and stopstart and stop dc motor (1) mikroc pro for pic (2) Motion detector (1) MQ-9 Gas Sensor (1) musical (1) NEC Protocol (4) pcb (5) PIC (3) pic controller (11) pic microcontroller (11) pic microcontroller tutorial (11) pic programming (1) pic programming in c (12) pic proteus (1) Pic Tutorial (12) pic18 (2) pic18f2550 (11) picmicrocontroller (4) picRFモジュール (1) PIR Motion Sensor (1) printed circuit board (1) proteus (6) pulse width modulation (1) push (1) push button (1) PWM (1) real (1) rf transmitter (3) Rs 232 (1) Rs232 (1) scroll (1) scrolling (1) Serial communication (1) Serial Connection (1) Serial Port (1) serial port rs232 (1) Servo Motembedded c programming tutorial (1) simulation (2) Soil Moisture Meter (1) speed control (1) step by step (7) step bystep (1) Stepper Motor (2) text (2) Thief Detector (1) time (1) timer (4) timer0 (4) tone (1) TSOP38236 Receiver (4) tutorial (2) Unipolar (1) USART Connection (1) USB (1) usb 1.0 (1) USB bootloadere (1) USB HID (1) using (9) voltmeter (1) voting (1) water level indicator (3) with (2) work (1)

Traffic Feed


Live Traffic Feed
Visitor Tracking

Leave Your Message Here

Name

Email *

Message *

Like on Facebook