วันศุกร์ที่ 5 พฤษภาคม พ.ศ. 2560
Software Serial Communication (rx,tx) Between Two arduinos uno (Sending ...
Software Serial Communication (rx,tx) Between Two arduinos uno (Sending and Receiving)
Working:
when pressed a tact switch on the sender board(uno) ,then send data to the receiver board(uno) which via the Software serial (tx,rx) communication.
the receiver board(uno) will display the receivered data on the LCD.
Arudino uno
sender ----- receiver
tx3 ----- rx2
rx2 ----- tx3
GND -------- GND ***
*Related clip
- Hardware Serial Communication (rx,tx) Between Two arduinos uno (Sending and Receiving)
https://youtu.be/q0By7XtOcQo
- Software Serial Communication (rx,tx) Between Two arduinos uno (Sending and Receiving)
https://youtu.be/ktNI-Cs0ZTk
-download arduino sketch ,image
https://drive.google.com/open?id=0BzjoxIwEMrM-aUtCS3JCMGItdjg
credit
http://www.kevindarrah.com/?page_id=1357
วันพฤหัสบดีที่ 4 พฤษภาคม พ.ศ. 2560
Hardware Serial Communication (rx,tx) Between Two arduinos uno (Sending ...
Hardware Serial Communication (rx,tx) Between Two arduinos uno (Sending and Receiving)
Working:
when pressed 'reset' button on the sender board(uno) ,then send data to the receiver board(uno) which via the hardware serial (tx,rx) communication.
the receiver board(uno) will display the receivered data on the LCD.
Arudino uno
sender ----- receiver
tx ----- rx
rx ----- tx
GND -------- GND ***
Call many topic:
-Arduino to Arduino Serial Communication
-2 arduino communication tx rx
-Arduino Serial Communication
-2 Arduinos Talking How-To Hardware Serial
-Serial Communication Between Two arduinos
-two arduinos serial
-download arduino sketch ,image
https://drive.google.com/open?id=0BzjoxIwEMrM-VU5BQjkyOEMtTFk
credit
http://www.kevindarrah.com/?page_id=1357
วันพุธที่ 26 เมษายน พ.ศ. 2560
ทำให้ humax vdsl2+ ของทรู use humax router , working in forward port (assign at virtual server)
/*-----------------------------------------
how toforward port of humax router
forware port ของ humax ให้เลือก ปรับ interface แบบ vdsl ก่อน จะได้ ip อีกชุด เช่น จากเดิม
adsl interface (ip 47.145.145.145) เมื่อเลือก เป็น vdsl interfaceจะได้ (ip 124.120.186.252) ทำให้ ใช้งานผ่าน virtual server mode ได้
เมื่อทำการเซต forward port เรียบร้อย ไม่จำเป็นต้อง restart router ก็ได้
ตอนนี้ จะสามารถเข้าถึง server ของเราในเครือข่ายได้ จากที่ไหนก็ตามผ่าน internet โดยใช้ public ip ดูจาก myipaddress
http://www.myipaddress.com/show-my-ip-address/
เช่น http://124.120.186.252:32000 หรือดูจาก router ของเราเอง เมื่อใช้งานเสร็จอย่าลืมปิดของเราด้วยนะคับ หลังเลิกใช้งาน
/*--------------------------------------
how toforward port of humax router
Model Name | HV100-02 |
Modem Vendor | Humax |
forware port ของ humax ให้เลือก ปรับ interface แบบ vdsl ก่อน จะได้ ip อีกชุด เช่น จากเดิม
adsl interface (ip 47.145.145.145) เมื่อเลือก เป็น vdsl interfaceจะได้ (ip 124.120.186.252) ทำให้ ใช้งานผ่าน virtual server mode ได้
![]() |
select vdsl |
![]() |
set forward port 32000 |
ตอนนี้ จะสามารถเข้าถึง server ของเราในเครือข่ายได้ จากที่ไหนก็ตามผ่าน internet โดยใช้ public ip ดูจาก myipaddress
http://www.myipaddress.com/show-my-ip-address/
เช่น http://124.120.186.252:32000 หรือดูจาก router ของเราเอง เมื่อใช้งานเสร็จอย่าลืมปิดของเราด้วยนะคับ หลังเลิกใช้งาน
/*--------------------------------------
ป้ายกำกับ:
esp8266,
forward port,
humax,
hv100,
nodemcu,
true,
vdsl2,
virtual server
วันพฤหัสบดีที่ 13 เมษายน พ.ศ. 2560
Temperature control system of thermo pot w/ an Arduino and NTC Thermist...
Create a temperature control system of thermo pot with an Arduino and NTC Thermister (alike a Thermostat )
***sorry, for cc(closed cation) is coming as soon.
Temperature control system of Automatic Electric Pots w/ an Arduino, NTC Thermister (ควบคุมอุณหภูมิกระติกน้ำร้อนไฟฟ้า)
-สร้างระบบควบคุมอุณหภูมิของกระติกน้ำร้อนไฟฟ้าโดยใช้ Arduino nano และ NTC Thermister 10K( -40 - 125 C)
****สาเหตุที่ทำโปรเจคนี้ เนื่องจาก ตัว thermostat มีปัญหา พอน้ำร้อนเดือดไม่ตัดไฟ ทำให้มันต้มน้ำตลอด และไม่เข้าสู่สถานะ warm จะเห็นได้จากไฟ LED keep warm ไม่สว่างและไฟสถานะ LED boil ยังคงสว่าง ก็เลยทำโปรเจคควบคุมอุณหภูมิของกระติกน้ำร้อนมาใช้งานแทน( แต่แนะนำว่า ควรหาซื้อ thermostat ตัวใหม่มาใส่ )
***การทำงาน NTC thermister อ่านค่าอุณหภูมิ ในหน่วยองศา C ส่งไปยัง Arduino เพื่อทำการประมวลผล ถ้าหาก T ต่ำกว่า 68.00 องศา เข้าสู่โหมดการทำความร้อนหรือต้มน้ำ และหากอุณหภูมิสูงกว่าค่าที่ตั้งไว้ คือ 90.00 องศา จะทำให้ ระบบเข้าสู่โหมด Warm หรืออุ่นน้ำนั่นเอง และรีเลย์จะตัดไฟ (นำ รีเลย์ 5VDC (220VAC 20A) มาใช้เพื่อทำการตัดและจ่ายไฟ 220VAC แทน Thermostat ที่มีปัญหา)
Making a temperature control system of thermo pot with an Arduino and NTC Thermister (alike a Thermostat ) , Because of my thermostat is not working as it should be, it will work continuously without cut off the power even if a water tempature is high. and the boil indicator is still lit.
For working, theNTC thermister 10K send a temperature value to an Arduino Nano.
In processing, if temperature value is below the preset value is 68C ,then system goes into boil mode.
if temp value from NTC is higher than the cut-off value is 90C , then system goes into warm mode.(in warm mode , Relays will be deactivated).
***Download related file for this clip: ino file, library, ntc pdf, image and etc
https://drive.google.com/drive/folders/0BzjoxIwEMrM-UkwySnU0UFBlcVk?usp=sharing
***Description
Specification:NTC
1m NTC Thermistor accuracy temperature sensor 10K 1% 3950 Waterproof Probe
Stainless steel sheath and waterproof
Measurement range: -20 to 105 ?C
Length of wire: 1 meter
Size of probe: 5 x 25 mm
Output: 2 wires
Type: NTC 10k?1% 3950
measure environmental temperatures using arduino ADC and this 10k NTC LINK
Resistance to temperature conversion table LINK
B-constant : 3380K -/+ 1%
Typical Dissipation Constant 5mW/ ?C
Probe insulation: gt 100MOhm
Peak Voltage sustain time: 2 seconds, AC1800V 1mA 2 seconds
Stress sustain: 9.8N (1kgF) for 1 minute no deformation
or
Stainless steel sheath and waterproof.(do not suggest used in water for a long time)
Measurement range: -40 to 120 ?C
Length of wire: 1 meter
Size of probe: 4 x 25 mm
Type: NTC 10k?1%
Measure environmental temperatures using arduino ADC and this 10k NTC LINK
B-constant : 3435K -/+ 1%
Typical Dissipation Constant 5mW/ ?C
Probe insulation: gt 100MOhm
***Credit:
https://www.youtube.com/watch?v=4yAcck3Qk2Y
http://www.vishay.com/docs/29053/ntcintro.pdf
http://www.learningaboutelectronics.com/Articles/Simple-thermistor-circuits.php#NTC
http://playground.arduino.cc/ComponentLib/Thermistor2
https://en.wikipedia.org/wiki/Thermistor //Steinhart–Hart equation
http://www.eidusa.com/Electronics_Kits_TEMP_THERMISTOR_1.htm
https://www.arduino.cc/en/Math/H //log x == natural logarithm of x
https://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
https://www.mikrocontroller.net/topic/79630 //graph ntc
http://www.vishay.com/docs/29053/ntcintro.pdf
http://www.vishay.com/thermistors/curve-computation-list/
https://en.wikipedia.org/wiki/Two%27s_complement
https://en.wikipedia.org/wiki/Voltage_divider
http://www.neutron.rmutphysics.com/science-news/index.php?option=com_content&task=view&id=2748&Itemid=4
![]() |
http://www.neutron.rmutphysics.com/science-news/index.php?option=com_content&task=view&id=2748&Itemid=4 |
วันศุกร์ที่ 7 เมษายน พ.ศ. 2560
Timer system with nodeMCU (Turn on/off the power by setting the timer) ,...
Timer system with nodeMCU (Turn on/off the power by setting the timer) , 2 periods timer / an relay (1 period = timer_on and timer_off).
The main devices used in the project.
-NodeMCU v2, DS3231, OLED 0.96"
-Relay 2ch opto, Keypad4x4
-PCF8574AT x 2
ชุดควบคุมการเปิดปิดอุปกรณ์โดยการตั้งเวลาเปิดปิด(Timer system)
-ตั้งวันที่และเวลา และ กำหนดเวลาการทำงาน เปิด/ปิด ของอุปกรณ์ไฟฟ้า(โหลด)ที่ต่ออยู่กับ รีเลย์
-ข้อมูลไม่สูญหายเมื่อไม่มีไฟฟ้า(ข้อมูลจัดเก็บไว้ที่ eeprom ของ ds3231)
-1 รีเลย์ ตั้งได้ 2 คาบเวลา (1 คาบเวลา จะมี เวลาเปิด(timer on) และ เวลาปิดtimer off) ในโปรเจคนี้จะแสดงการงานใช้เพียง 2รีเลย์
-สามารถเพิ่มจำนวนรีเลย์ได้ภายหลัง (ขึ้นอยู่กับ pcf8574 module ที่มีในระบบ 1 module เพิ่ม 8 ขา(8 รีเลย์))
-ตั้งค่าเวลาเปิดปิดรีเลย์(โหลด) ผ่านหน้าจอ เมนูได้โดยง่าย
-สามารถควบคุมรีเลย์(รีเลย์เชื่อมอยู่บนขาของ PCF8574AT)แต่ละตัวได้โดยตรงและอิสระ(ด้วยการทำงานของโปรแกรมควบคุม)
-แสดงอุณหภูมิห้องในหน่วย C ได้
-สามารถนำไปประยุกต์กับโครงงานอื่นๆได้
Specification
-Set Date and Time manualy with the date/time menu page.
-The data is not lost when there is no power supply.
-Set up 2 periods for each relays. (Increase the number of relays later with just only copy code.)
( 1 periods = timer on and timer off, the timer can be canceled. )
PS. this project will demonstrate with 2 relays.
-Relays can be added with inferface on pcf8574 io pin.
-Setting timer from a menu page,easily.
-Can control each of relay by directly and independently with working of aruduino code .
(Relays connected on the pcf8574 pin)
-Show Temparature in C degree.
-Can be applied with other project.
Download Related files ,the follow link
-https://drive.google.com/drive/folders/0BzjoxIwEMrM-ZnRIb25KME56LW8?usp=sharing
Related Clip
-Arduino+ pcf8574at +keypad+4relay , Read/Write set bit to control independently of each other relay.
https://youtu.be/4xicGKsr4p0
-nodeMCU v2 +Keypad 4x4 + PCF8574AT( io expender), use 2 wires only.
https://youtu.be/lDhUqzp4410
ป้ายกำกับ:
alarm timer,
DS3231,
Keypad4x4,
nodemcu,
OLED,
PCF8574AT,
relay,
timer,
timer system
วันอังคารที่ 4 เมษายน พ.ศ. 2560
arduino knowledge technic 2
Bits | Unsigned value | Two's complement value |
---|---|---|
011 | 3 | 3 |
010 | 2 | 2 |
001 | 1 | 1 |
000 | 0 | 0 |
111 | 7 | −1 |
110 | 6 | −2 |
101 | 5 | −3 |
100 | 4 | −4 |
Bits | Unsigned value | Two's complement value |
---|---|---|
0111 1111 | 127 | 127 |
0111 1110 | 126 | 126 |
0000 0010 | 2 | 2 |
0000 0001 | 1 | 1 |
0000 0000 | 0 | 0 |
1111 1111 | 255 | −1 |
1111 1110 | 254 | −2 |
1000 0010 | 130 | −126 |
1000 0001 | 129 | −127 |
1000 0000 | 128 | −128 |
/*--------------------------------
double log (double __x) // natural logarithm of x
double log10 (double __x) // logarithm of x to base 10.
/*-----------------------------------------------
lcd.print("TEMP " + (String)(int)Temp_start + "," + (String)(int)Temp_cut );
/*-------------------------------
By-pass and de-coupling capacitors
are commonly used to control the voltage on the VCC pin,
- using a larger capacitor to provide additional power in the event of a short power supply glitch
- and a smaller capacitor to filter out high-frequency ripple.
/*--------------------------------
credit: https://forum.arduino.cc/index.php?topic=372547.0
INSTRUCTIONS:
/*------------------------------------
set bit ตามตำแหน่งที่ต้องการ
/*-----------------------
/*-----------------------------------------------
Wrote a test for floats to check for special values. NAN and INFINITY and isnan(), isinf() and isfinite() are defined in math.h.
int testFloat(float f)
{
if (f == 1/0L) Serial.println("NaN divide by 0L");
if (f == 1/0UL) Serial.println("NaN divide by 0UL");
if (f == NAN) Serial.println("NaN");
if (f == INFINITY) Serial.println("INFINITY");
if (-f == INFINITY)Serial.println("-INFINITY");
if (isnan(f)) Serial.println("isnan");
if (isinf(f)) Serial.println("isinf");
if (isfinite(f)) Serial.println("isfinite = OK");
return 0;
}
lcd.print("TEMP " + (String)(int)Temp_start + "," + (String)(int)Temp_cut );
/*-------------------------------
By-pass and de-coupling capacitors
are commonly used to control the voltage on the VCC pin,
- using a larger capacitor to provide additional power in the event of a short power supply glitch
- and a smaller capacitor to filter out high-frequency ripple.
/*--------------------------------
credit: https://forum.arduino.cc/index.php?topic=372547.0
The first thing to do is ensure you have your relay module connected properly and adequately powered. This example shows how to make use of the optic isolation feature.
INSTRUCTIONS:
- Remove blue jumper
- Connect JD-VCC and GND from the Relay Module to a Separate 5VDC Supply (1Amp or greater)
- Connect VCC from the Relay Module to 5V on your Arduino
- Connect required control signals as shown
- Note: DO NOT connect GND from the Relay Module to your Arduino
/*------------------------------------
set bit ตามตำแหน่งที่ต้องการ
Use the bitwise
or
and and
operators. To set a bit:
เซต bit=1 ที่ตำแหน่ง pos
my_byte = my_byte | (1 << pos);
To un-set a bit:
เซต bit=0 ที่ตำแหน่ง pos
my_byte = my_byte & ~(1 << pos);
credit http://stackoverflow.com/questions/4674006/set-specific-bit-in-byte/*-----------------------
difference between ESP.reset() and ESP.restart()?
- Created: Tuesday, 19 April 2016 08:02
What´s the difference between ESP.reset() and ESP.restart()?
Both work, but sometimes the ESP does not start again.
Answer:
ESP.reset()
is a hard reset and can leave some of the registers in the old state which can lead to problems, its more or less like the reset button on the PC.ESP.restart()
tells the SDK to reboot, so its a more clean reboot, use this one if possible.
the
if you do one manual reboot by power or RST pin all will work more info see: #1017
boot mode:(1,7)
problem is known and only happens at the first restart after serial flashing.if you do one manual reboot by power or RST pin all will work more info see: #1017
/*-----------------------------------------------
Wrote a test for floats to check for special values. NAN and INFINITY and isnan(), isinf() and isfinite() are defined in math.h.
int testFloat(float f)
{
if (f == 1/0L) Serial.println("NaN divide by 0L");
if (f == 1/0UL) Serial.println("NaN divide by 0UL");
if (f == NAN) Serial.println("NaN");
if (f == INFINITY) Serial.println("INFINITY");
if (-f == INFINITY)Serial.println("-INFINITY");
if (isnan(f)) Serial.println("isnan");
if (isinf(f)) Serial.println("isinf");
if (isfinite(f)) Serial.println("isfinite = OK");
return 0;
}
สมัครสมาชิก:
บทความ (Atom)