CÀI LẠI SAMSUNG GALAXY BỊ TREO LOGO KHÔNG KHỞI ĐỘNG DƯỢC
hôm nay mình hướng dẫn các bạn cài lại sam sunggalaxy j100h bị treo logo không khởi động dược
Đây là hình minh họa lúc bị treo logo như nầy đây
1-Đầu tiên ta tháo pin ra và gắn pin trở lại để cho điện thoại về trạng thái tắt nguồn
2-Vào đây DOWNLOAD file này về máy tính và cài đặt file vừa down về lên máy tính
3-Tiếp tục vào đây DOWNLOAD file này về máy tính và giải nén nó ra
4-Trong file vừa giải nén gồm có file :
SC02FOMUFNF7_SC02FDCMFNF7_SC02FOMUFNF7_HOME.tar
và file : Odin
5-Mở file Odin lên
6-Cắm cáp kết nối điện thoại với máy tính qua cổng USB
7-bấm nút nguồn điện thoại để mở nguồn,khi nguồn điện thoại được bật lên ta nhìn vào màn hình máy tính trong giao diện Odin có dạng như sau
Chú ý vào cái chỗ khoanh hình vuông màu đỏ mà giống như vậy là máy tính đã nhận diện được điện thoại của bạn rồi đó
8-Tiếp tục làm như hình dưới
Bấm vào cái ô có chữ PDA khoanh trong hình vuông màu đỏ đó và tìm đến cái file có tên :SC02FOMUFNF7_SC02FDCMFNF7_SC02FOMUFNF7_HOME.tar mà ta vừa giải nén lúc đầu đó
và chọn file đó xong ngồi chờ cho Odin xử lý một tí sau khi Odin xử lý xong thì nút start sẽ sáng lên và ta chỉ việc nhấn vào nút start
rồi ngồi chờ kết quả
khi nào bạn thấy chữ PASS hiện lên như này là đã thành công bạn chỉ việc chờ điện thoại của bạn khởi động lại và bạn đã tự tay cài lại phần mềm cho chiếc điện thoại yêu của mình rồi đó.
Chú ý :Các điện thoại samsung khác cũng làm giống vậy chỉ khác co chỗ là file nạp chính là linh hồn của mõi điện thoại mà thôi.Chúc các bạn thành công,lần sau mình sẽ chỉ các bạn cũng như up len đây những linh hồn của từng em nó để các bạn tiện khác phục chiếc diện thoại của mình khi cần thiết.Tạm biệt.
Ba tháng trước mình có nghe cô bạn dược sỹ bên China nói về cách uống nước, và giờ mới hiểu. Tim và Nước Bài 1: CÁCH UỐNG NƯỚC Khi cần uống hết 1 ly nước, chúng ta không nên đứng mà nên ngồi, và nên uống từng ngụm nhỏ; lượng nước uống vào sẽ được đưa đi khắp các cơ quan trong cơ thể. Khi ta đứng, cơ thể giữ nước ở phần dưới của cơ thể, khiến chân bạn sưng lên. Bài 2: UỐNG NƯỚC & TAI BIẾN MẠCH MÁU NÃO Rất Quan Trọng! Xin hãy ghi nhớ: – 2 ly nước sau khi thức dậy: giúp kích hoạt các cơ quan nội tạng. – 1 ly nước trước bữa ăn 30 phút: giúp tiêu hóa. – 1 ly nước trước khi tắm: giúp giảm huyết áp. – 1 ly nước trước khi đi ngủ: phòng ngừa bệnh đột quỵ, còn gọi là tai biến mạch máu não. Chú ý: Nên uống nước nguội hoặc hơi âm ấm, tránh uống nước lạnh hoặc nước nóng. Và nên áp dụng cách uống nước như ở bài trên. Trong thực tế, các trường hợp đột quỵ thường xảy ra vào sáng sớm. Sau một đêm dài cơ thể không được cung cấp nước, máu đặc lại, và đây là một trong những nguyên nhân dễ dẫn đến đột quỵ. Trong một ngày, có lúc máu đặc, có lúc máu loãng. Hiện tượng này tuân theo một chu trình nhất định: – Từ 4 giờ sáng đến 8 giờ sáng là lúc máu đặc nhất. – Sau đó dần dần loãng ra cho đến khoảng 12 giờ đêm, là thời điểm loãng nhất. – Rồi dần dần đặc lại cho tới buổi sáng hôm sau, và đặc nhất từ 4 giờ sáng đến 8 giờ sáng. Vì vậy, mỗi chúng ta, nhất là những người lớn tuổi, buổi tối trước khi đi ngủ nên uống khoảng 200 ml nước (cỡ chừng một ly), thì khi sáng ngủ dậy, máu không những không bị đặc mà còn loãng ra. Do đó các chuyên gia y học khuyên chúng ta nên uống nước buổi tối trước khi đi ngủ thì sẽ giúp cho máu loãng ra vào buổi sáng hôm sau, có lợi cho sự tuần hoàn của máu, và giúp phòng chống bệnh đột quỵ vào lúc sáng sớm. Có nhiều nguyên nhân dẫn đến bệnh đột quỵ. Việc máu đông đặc chỉ là một trong những nguyên nhân gây bệnh này. Tuy nhiên, có thể khẳng định thói quen uống nước trước khi đi ngủ có tác dụng hữu ích nhất định đối với việc phòng chống đột quỵ. Bài 3: LÀM SAO ĐỂ SỐNG SÓT QUA CƠN ĐAU TIM KHI BẠN Ở 1 MÌNH Người bệnh khi lên cơn đau tim thì tim họ sẽ đập yếu và loạn nhịp. Sau đó, họ cảm thấy choáng, uể oải. Khi bắt đầu cảm thấy như thế, thì chỉ trong 10 giây nữa là họ sẽ ngất. Tuy nhiên người bệnh có thể tự giúp mình bằng cách ngay lập tức ho rất mạnh, dài và sâu (giống như khạc đờm từ sâu trong cổ họng ra). Đồng thời, trước và sau khi ho, người bệnh phải hít 1 hơi thật sâu. Người bệnh cần liên tục hít sâu và ho mạnh xen kẽ nhau như thế cho đến khi cảm thấy tim đập trở lại bình thường hoặc nhận được sự trợ giúp y tế. Việc hít sâu giúp cho oxy vào phổi nhiều hơn bình thường, và việc ho dài, mạnh, giúp bóp mạnh quả tim làm cho máu lưu thông dễ hơn. P.S: Một bác sĩ tim mạch nói rằng, nếu mỗi người đọc được thông tin này mà chia sẻ cho 10 người khác được biết, thì chúng ta sẽ cứu được ít nhất 1 người. * Tôi đã làm tròn phận sự, giờ đến phiên bạn!
Điều khiển thiết bị bằng smart phone,bằng giọng nói,thông qua mạng wiifi or 3G, 4G
MUA HÀNGPhần mềm điều khiển cho android : DOWNLOAD
VIDEO HƯỚNG DẪN
ARDUINO CHẠY ĐA NHIỆM
Cách sử dụng FreeRTOS
Cài đặt thư viện FreeRTOS trên Arduino IDE
Để bắt đầu với FreeRTOS, chúng ta cần cài đặt thư viện của nó trên Arduino IDE đã:
Ở giao diện chính của Aruduino IDE, Sketch > Include Library > Manage Libraries. Search từ khóa FreeRTOS và cài đặt thư viện
Link down thư viện: DOWNLOAD
Link down phần mềm: DOWNLOAD
video hướng dẫn
Salient Eye, Home Security Camera
link down: DOWNLOAD
Smart iRemote
Dùng điện thoại để điều khiển android tivi box
Link down phần mềm: DOWNLOAD
Video hướng dẫn
Ứng dụng này để xâm nhập điện thoại khác qua wifi
Tải ứng dụng từ CHPLAY về máy tính
Vào trang này để tải: NHẤP VÀO ĐÂY
Inkwire Screen Share + Assist (Beta)
Link down: DOWNLOAD
dùng để chia sẻ hai màn hình điện thoại với nhau hoặc từ điện thoại lên máy tính android tivi box.
Arduino điều khiển nhiều đèn led bằng biến trở
CODE ARDUINO
const
int
analogPin
= A0; //
the pin that the potentiometer is attached to
const
int
ledCount
= 10; //
the number of LEDs in the bar graph
int
ledPins[]
= {
2,
3, 4, 5, 6, 7, 8, 9, 10, 11
};
//
an array of pin numbers to which LEDs are attached
void
setup()
{
//
loop over the pin array and set them all to output:
for
(int
thisLed
= 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed],
OUTPUT);
}
}
void
loop()
{
//
read the potentiometer:
int
sensorReading
= analogRead(analogPin);
//
map the result to a range from 0 to the number of LEDs:
int
ledLevel
= map(sensorReading,
0, 1023, 0, ledCount);
//
loop over the LED array:
for
(int
thisLed
= 0; thisLed < ledCount; thisLed++) {
//
if the array element's index is less than ledLevel,
//
turn the pin for this element on:
if
(thisLed
< ledLevel) {
digitalWrite(ledPins[thisLed],
HIGH);
}
//
turn off all pins higher than the ledLevel
HƯỚNG DẪN KẾT NỐI HMI SHISHLIN VỚI CÁC THIẾT BỊ
Link down tài liệu: DOWNLOAD
Arduino làm remote Tivi
Link down: DOWNLOAD
Video hướng dẫn
Step 1: Scan Raw Value HƯỚNG DẪN KẾT NỐI HMI SHISHLIN VỚI CÁC THIẾT BỊ
Link down tài liệu: DOWNLOAD
Arduino làm remote Tivi
Link down: DOWNLOAD
Video hướng dẫn
DÙNG REMOTE TIVI HOẶC REMOTE HỒNG NGOẠI BẤT KÌ ĐIỀU KHIỂN THIẾT BỊ
BƯỚC 1:
Danh sách các linh kiện cần có gồm:
1.Arduino Nano
2.Relay 5V
3.LED
4.Transistor BC548
5.Female header
6.5V charger/5V power supply
7.Srew terminal
8.IR receiver TSOP
9.PCB
10.Encloser
11.Copper PCB
Now its turns to choose any remote as you want for controlling purpose. And download Arduino IR libraryand past in Arduino library. And do not forgot to delete the library file of Robot_IRreceiver. Open Arduino IDE and click on File---Example---IRremote---IRrecvDemo.
Connect Arduino to PC and Select COM port and Type of Board in Tools. After selection both things Upload the sketch in Arduino. Connect IR receiver to Arduino Board. ( first see pins of your's TSOP IR receiver from data sheet)
Now press remote buttons, you receive some Hexadecimal value. Note down all values of remote transmit in front of buttons of remote in a list.
And this is code scan from remote:
/*
* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
int RECV_PIN = 2;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
delay(100);
}
và đây là thư viện Ir remote: DOWNLOAD
đây là kết quả Scan code remote
Step 2: Raw Value Put in Arduino Code
(copy và dán code của phím bấm mà ta muốn chọn để diều khiển vào vị trí mũi tên màu đỏ như trong hình)
Dưới đây full code và sơ đồ đầy đủ:
/* Home Automation system by Ashok Kumar Kumawat
* Thanks to Ken Shirriff (Arduino IR library)
*/
#include<EEPROM.h>
#include<IRremote.h>
int RECV_PIN = 11;
int relay_1 = 9;
int relay_2 = 8;
int relay_3 = 7;
int relay_state[] = {0,0,0,0};
int address = 0;
byte value1,value2,value3;
#define code1 0XFFC03F
#define code2 0XFF8A75
#define code3 0XFFA05F
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(relay_1,OUTPUT);
pinMode(relay_2,OUTPUT);
pinMode(relay_3,OUTPUT);
}
void loop(){
if(value1==1){
digitalWrite(relay_1,HIGH);
}
else{
digitalWrite(relay_1,LOW);
}
if(value2==1){
digitalWrite(relay_2,HIGH);
}
else{
digitalWrite(relay_2,LOW);
}
if(value3==1){
digitalWrite(relay_3,HIGH);
}
else{
digitalWrite(relay_3,LOW);
}
if(irrecv.decode(&results)){
unsigned int value = results.value;
switch(value){
case code1:{
if(relay_state[1] == 1){
Serial.println("Relay 1 = OFF");
relay_state[1] = 0;
}
else{
Serial.println("Relay 1 = ON");
relay_state[1] = 1;
}
EEPROM.write(0,relay_state[1]);
value1 = EEPROM.read(0);
Serial.print(value1, DEC);
Serial.println();
break;
}
case code2:{
if(relay_state[2] == 1){
Serial.println("Relay 2 = OFF");
relay_state[2] = 0;
}
else{
Serial.println("Relay 2 = ON");
relay_state[2] = 1;
}
EEPROM.write(1,relay_state[2]);
value2 = EEPROM.read(1);
Serial.print(value2, DEC);
Serial.println();
break;
}
case code3:{
if(relay_state[3] == 1){
Serial.println("Relay 3 = OFF");
relay_state[3] = 0;
}
else{
Serial.println("Relay 3 = ON");
relay_state[3] = 1;
}
EEPROM.write(2,relay_state[3]);
value3 = EEPROM.read(2);
Serial.print(value3, DEC);
Serial.println();
}
}
irrecv.resume();
}
}
Có thể tải đoạn code trên từ đây: DOWNLOAD
Còn đây là sơ đồ mạch:
Vậy là các bạn đã tự tay làm một bộ diều khiển từ xa bằng một remote hồng ngoại bất kì rồi đó thấy có thú vị không.tạm biệt các bạn
Bài này mình hướng dẫn các bạn dùng module cảm biến vật cản hồng ngoại để bật tắt đèn led hay thiết bị bằng arduino
xem qua đoạn video này và ta tiến hành làm theo nhé
Nhấp vào đây để xem: XEM
Nào bây giờ ta tiến hành làm thôi:
các bạn vào đây down code này về và dán vào trình soạn thảo arduino nhé sau đó nạp vào baord arduino nha: DOWNLOAD hoặc down ở đây : DOWNLOAD
Và đây là đoạn code của nó:
int analogInPin = A5; // Analog input pin that the potentiometer is attached to
int out =13;
int sensorValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(out, OUTPUT);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
Serial.print("sensor = " );
Serial.println(sensorValue);
delay(200);
if(sensorValue>800)
{
digitalWrite(out,1);
}
else
{
digitalWrite(out,0);
}
}
và đây là hình ảnh đấu nối dây :
xong rồi đó chúc các bạn thành công nhé.Tạm biệt.
Sau đây là bài Arduino và cảm biến nhiệt độ LM 35
mạch điện:
code Arduino:(chú ý:code này lưu với đuôi (.Pde)ví dụ : LM35_2.pde)
(vậy nên chú ý tới việc cài phiên bản phần mềm arduino cho tương thích với đuôi (.pde))
/*
Sensing the Temperature with the LM35
Fritzing.org
This script will output the sensed temperature of the LM35 from 20 to 32°C by LEDs.
inspired by
ladyada http://www.ladyada.net/learn/sensors/tmp36.html
pscmpf http://pscmpf.blogspot.com/2008/12/arduino-lm35-sensor.html
*/
float temperature; // stores the temperature
int sensorPin = 0; // pin where the sensor is connected to
int startTemp=20; // the start temperature > at this temperature, no LED will light up
void setup()
{
Serial.begin(9600); // initialisation of the serial connection
for (int i=2;i<8; i++){ // output channels from 2 to 7
pinMode(i,OUTPUT); // pin is a output
}
}
void loop()
{
temperature = analogRead(sensorPin); // reading analog sensor value
temperature = temperature*0.488; // correcting to °C
for (int i=0;i<8; i++){
if (temperature>((i*2)+startTemp)){ // switch LED on, if temperature is higher than starttemp + (LED number*2)
digitalWrite(i,HIGH);
}
else {
digitalWrite(i,LOW); // else, switch it off
}
}
Serial.print(temperature);Serial.println(" °C"); // send the temperarue to the serial monitor
delay(500); // just wait a little
}
Xem video thành phẩm:
Nhấp vào đây : XEM
Ví dụ 2 về cảm biến nhiệt độ LM 35
Code Arduino
The code:
//Declare the potencimeter and the temperature sensor pins
const int potenciometro= A1;
const int Temperatura= 0;
//declare each led pin
const int led1= 9;
const int led2= 8;
const int led3= 7;
const int led4= 6;
const int led5= 5;
const int led6= 4;
const int led7= 3;
const int led8= 2;
const int led9= 1;
const int led10= 0;
//Declare the variables for the temp regulation
int pot_regulador= 0;
int ajuste_de_temp= 0;
//declare leds as outputs
void setup() {
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);
pinMode(led7, OUTPUT);
pinMode(led8, OUTPUT);
pinMode(led9, OUTPUT);
pinMode(led10, OUTPUT);
}
//main program
void loop() {
//read voltage from the temp sensor and transform to celsius
int reading = analogRead(Temperatura);
float voltage = reading * 5.0;
voltage /= 1024.0;
float TemperaturaC = (voltage - 0.5) * 100 ;
//This part if for regulating the temperature
//in this program we divide the value of the potenciometer by 30 to have 30 degrees of regulation
//if you divide by 100 you have 10 degrees of regulation
// and divided by 50 you get 20 degrees of regulation
//the values are only aproximate they are not exact
pot_regulador=analogRead(potenciometro);
ajuste_de_temp=pot_regulador/30;
delay(50);
//the temperature is read and the leds light up for the temperature that is measuring
if(TemperaturaC<(10-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(20-ajuste_de_temp) && TemperaturaC>(10-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(30-ajuste_de_temp) && TemperaturaC>(20-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(40-ajuste_de_temp) && TemperaturaC>(30-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, LOW);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(50-ajuste_de_temp) && TemperaturaC>(40-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, LOW);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(60-ajuste_de_temp) && TemperaturaC>(50-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, LOW);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(70-ajuste_de_temp) && TemperaturaC>(60-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, LOW);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(80-ajuste_de_temp) && TemperaturaC>(70-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, HIGH);
digitalWrite(led9, LOW);
digitalWrite(led10, LOW);
}
else if(TemperaturaC<(90-ajuste_de_temp) && TemperaturaC>(80-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, HIGH);
digitalWrite(led9, HIGH);
digitalWrite(led10, LOW);
}
else if(TemperaturaC>(100-ajuste_de_temp)){
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
digitalWrite(led5, HIGH);
digitalWrite(led6, HIGH);
digitalWrite(led7, HIGH);
digitalWrite(led8, HIGH);
digitalWrite(led9, HIGH);
digitalWrite(led10, HIGH);
}
}
/*There are other ways to make this code but we made it like that to be easy to read and modify. If you have another way to making it, please share with all in here*/
Xem video:
Vidu 3 về lm35 và arduino
Và đây là code arduino:
const int hot = 87; //set hot parameter
const int cold = 75; //set cold parameter
void setup() {
pinMode(A2, INPUT); //sensor
pinMode(2, OUTPUT); //blue
pinMode(3, OUTPUT); //green
pinMode(4, OUTPUT); //red
Serial.begin(9600);
}
void loop() {
int sensor = analogRead(A2);
float voltage = (sensor / 1024.0) * 5.0;
float tempC = (voltage - .5) * 100;
float tempF = (tempC * 1.8) + 32;
Serial.print("temp: ");
Serial.print(tempF);
if (tempF < cold) { //cold
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
Serial.println(" It's Cold.");
}
else if (tempF >= hot) { //hot
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
Serial.println(" It's Hot.");
}
else { //fine
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
Serial.println(" It's Fine.");
}
delay(10);
}
ví dụ 4 (cảm biến nhiệt độ LM35 điều khiển tắt mở quạt theo nhiệt độ)
và đây là code:
int trans = 8; (ngỏ ra 8 của arduino nối đến cực B transistor)
int temp = 0;(chân Analog A0 của Arduino nối vào đầu ra của LM 35)
int temp_val;
void setup() {
pinMode(trans, OUTPUT);
Serial.begin(9600);
}
void loop() {
temp = analogRead(A0);
temp_val = temp * 0.48828125;
Serial.print("TEMPERATURE = ");
Serial.print(temp_val);
Serial.print("*C");
Serial.println();
if(temp_val > 30)
{
digitalWrite(trans,HIGH);
}
if(temp_val < 30 )
{
digitalWrite(trans,LOW);
}
delay(1000);
}
Đây là sơ đồ chân của LM 35
Ví dụ 5 về LM 35 và Arduino:
Đây là code Arduino:
//theorycircuit.com
//temperature sensor (LM35) controlled LED output with buzzer
int tempsensor = 0;
int firstled = 8;
int secondled = 9;
int thirdled = 10;
int fourthled = 11;
int fifthled = 12;
int buzzerpin = 7;
void setup()
{
Serial.begin(9600);
pinMode(firstled,OUTPUT);
pinMode(secondled,OUTPUT);
pinMode(thirdled,OUTPUT);
pinMode(fourthled,OUTPUT);
pinMode(fifthled,OUTPUT);
pinMode(buzzerpin,OUTPUT);
}
void loop()
{
tempsensor=analogRead(0);
if(tempsensor<=129)
{
digitalWrite(firstled,HIGH);
digitalWrite(secondled,LOW);
digitalWrite(thirdled,LOW);
digitalWrite(fourthled,LOW);
digitalWrite(fifthled,LOW);
digitalWrite(buzzerpin,LOW);
}
else if(tempsensor>=130&&tempsensor<155)
{
digitalWrite(firstled,LOW);
digitalWrite(secondled,HIGH);
digitalWrite(thirdled,LOW);
digitalWrite(fourthled,LOW);
digitalWrite(fifthled,LOW);
digitalWrite(buzzerpin,LOW);
}
else if(tempsensor>=155&&tempsensor<165)
{
digitalWrite(firstled,LOW);
digitalWrite(secondled,LOW);
digitalWrite(thirdled,HIGH);
digitalWrite(fourthled,LOW);
digitalWrite(fifthled,LOW);
digitalWrite(buzzerpin,LOW);
}
else if(tempsensor>=165&&tempsensor<180)
{
digitalWrite(firstled,LOW);
digitalWrite(secondled,LOW);
digitalWrite(thirdled,LOW);
digitalWrite(fourthled,HIGH);
digitalWrite(fifthled,LOW);
digitalWrite(buzzerpin,LOW);
}
else if(tempsensor>=180&&tempsensor<200)
{
digitalWrite(firstled,LOW);
digitalWrite(secondled,LOW);
digitalWrite(thirdled,LOW);
digitalWrite(fourthled,LOW);
digitalWrite(fifthled,HIGH);
digitalWrite(buzzerpin,LOW);
}
else if(tempsensor>200)
{
digitalWrite(firstled,HIGH);
digitalWrite(secondled,HIGH);
digitalWrite(thirdled,HIGH);
digitalWrite(fourthled,HIGH);
digitalWrite(fifthled,HIGH);
digitalWrite(buzzerpin,HIGH);
}
Serial.println(tempsensor);
delay(150);
}
TỰ TAY XÂY DỰNG MỘT ỨNG DỤNG ĐIỀU KHIỂN TỪ XA BẰNG BLUETOOTH CHO ANDROID:
Đầu tiên vào trang web này: NHẤP VÀO ĐÂY
xong rồi trong giao diện của MIT APP INVENTER đó ta nhấp nào menu Build sẽ hiện ra môt thư mục mới ta kéo xuống hàng thứ 2 chính là App (save .Apk to mycomputure )và nhấp vào đó để tải file apk mà ta vừa xây dựng xong về máy tính
Hoặc có thể down file apk trực tiếp ở đây: DOWNLOAD sau đó cài đặt file apk này vào điện thoại android
xem hình vẽ này và tiến hành làm theo:
sau khi cài vào điện thoại android và mở lên thì giao diện của nó như vậy
tiếp tục copy và dán đoạn code sau vào trình soạn thảo arduino và nạp vào board Arduino
Đây là đoạn code:
/*
* created by Rui Santos, http://randomnerdtutorials.com
* Control 2 DC motors with Smartphone via bluetooth
*/
int motor1Pin1 = 3; // pin 2 on L293D IC
int motor1Pin2 = 4; // pin 7 on L293D IC
int enable1Pin = 6; // pin 1 on L293D IC
int motor2Pin1 = 8; // pin 10 on L293D IC
int motor2Pin2 = 9; // pin 15 on L293D IC
int enable2Pin = 11; // pin 9 on L293D IC
int state;
int flag=0; //makes sure that the serial only prints once the state
int stateStop=0;
void setup() {
// sets the pins as outputs:
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
pinMode(enable1Pin, OUTPUT);
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
pinMode(enable2Pin, OUTPUT);
// sets enable1Pin and enable2Pin high so that motor can turn on:
digitalWrite(enable1Pin, HIGH);
digitalWrite(enable2Pin, HIGH);
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
//if some date is sent, reads it and saves in state
if(Serial.available() > 0){
state = Serial.read();
flag=0;
}
// if the state is 'F' the DC motor will go forward
if (state == 'F') {
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
if(flag == 0){
Serial.println("Go Forward!");
flag=1;
}
}
// if the state is 'R' the motor will turn left
else if (state == 'R') {
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
if(flag == 0){
Serial.println("Turn LEFT");
flag=1;
}
delay(1500);
state=3;
stateStop=1;
}
// if the state is 'S' the motor will Stop
else if (state == 'S' || stateStop == 1) {
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
if(flag == 0){
Serial.println("STOP!");
flag=1;
}
stateStop=0;
}
// if the state is 'L' the motor will turn right
else if (state == 'L') {
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, HIGH);
if(flag == 0){
Serial.println("Turn RIGHT");
flag=1;
}
delay(1500);
state=3;
stateStop=1;
}
// if the state is 'B' the motor will Reverse
else if (state == 'B') {
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, HIGH);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
if(flag == 0){
Serial.println("Reverse!");
flag=1;
}
}
//For debugging purpose
//Serial.println(state);
}
sau khi làm xong các bước trên ta kết nối bluetooth điện thoại mà ta vừa cài dặt file apk lúc nảy với board Arduino và tiến hành điều khiển từ xa.Đây chinh là ứng dụng vào xe điều khiển từ xa qua bluetooth từ điện thoại thông minh nha.Tạm biệt chúc vui vẻ,hẹn gặp lại ở bài kế tiếp.
Danh sách các linh kiện cho mạch điều khiển từ xa ở trên:
Linh kiện gồm có:
1-Arduino UNO – read Best Arduino Starter Kits(Arduino UNO R3)
2-Bluetooth module HC-04 or HC-05 or HC-06 (module bluetooth HC 06)
3-1x L293D IC(Đây là ic điều khiển Motor tren breakboard trong hình đó)
4-2x DC motors
5-Breadboard
6-Jumper wires
Xem video của mạch trên nhé:


































Không có nhận xét nào:
Đăng nhận xét