Dear audience, everyone is good at midnight in the morning, welcome to watch the TV station weather forecast show, the main content of today's weather forecast is: teaching everyone DIY weather monitor ...
After a hero-made non-eighth, another DIY tutorial is coming, today's tutorial is indeed a weather monitor, this homemade monitor can monitor the current weather conditions, carbon emissions, noise and pollution levels you are in your location. Wait for data, you can also publish these data to Twitter, share the weather conditions of your location.
This monitors are called Twist (Tweeting Weather Ioot Station Aka Twist), which is a DIY Internet of Things object, the processor uses Intel Edison's development board, which can be compatible with multiple sensors, all code and design files are open source. This means that anyone can add different sensors to the same sensor to transform a more powerful instrument by sharing code and schematic diagram.
Ok, there is not much nonsense, start the tutorial.
Step 1: Prepare components
Intel Edison Development Board with Arduino Interface
MQ-2 sensor (for induction combustible gas and smoke)
YL-83 sensor (rainfall sensor)
SL-HS-220 sensor (monitoring temperature and humidity)
32K and 4.7K resistance
Plate wood
3 × 1 "long screw with nut
Step 2: Circuit Design
A circuit diagram is provided here for your reference
electricity supply
The entire system is powered by a 5V 1A power supply. The power of the sensor is approximately 200 mA. The EDISON development board takes 500 mA, and since the total current is less than 1A, the power supply of 1A should make the entire system work very well. The green LEDs such as the EDISON development board can display the connection of the power supply.
Treatment board
The processor running on Twist is an edison development board that borrows the Arduino interface, which makes it easier to read the number of sensors and analog signals, and Edison has a WiFi connection, which can be directly connected to the Twitter server, no additional extra hardware.
sensor
The most basic setting of this system has four sensors: temperature, humidity, smoke, flammable gas, which can be connected directly to EDISON, alternatively, for additional wind, noise and other sensors, each sensor is directly powered by the power supply. These sensors are relatively sensitive sensors.
Specific installation circuit diagram refer to this circuit diagram.
Step 3: Design
The outer shell of the Twist is made of two wooden boards. We use 1/4 "plywood here to ensure that the nut connecting parts of the two plates are very energetically, and the connection of the sensor needs to punch on the plate. So we recommend that if there is conditional, the fabrication of the outer casing uses laser cutting, attached to the laser cutting machine's control file.
Step 4: Installation assembly
Find the sensor matched holes and cuts on the wooden board, and secure them with screws or glue.
At the other side fixed Edison, connect to the rainwater sensor if the solar input port or buzzer can also be installed on this board.
Step 5: Connections for sensors and control boards
First above:
Connect all sensor lines on the two panels to EDISON as shown in the analog circuit diagram.
Step 6: Twitter configuration
Want to connect the weather monitor and twitter, you need to get the Twitter certification token, you can get the Twitter's developer web page, today's tutorial uses NeoCat settings, click on the connection, enter the site, and get it according to the tutorial above Twitter Access the authentication token.
However, it should be noted that the Twitter set in NeoCat can't be sent too frequent. If you need frequent transmission weather conditions, you need to create a server yourself.
Attachment:
Twitter Token
Arduino Tweet Library
Step 7: Software and configuration
Next, you need to enter some Arduino code in the development board.
Set the send Twitter interval, send a split every three hours:
TweetMessage ();
DELAY (10800000);
Most of the data read from the sensor is 'int' and 'float' type, if you want to send them with Twitter, you need to convert them to 'string', the code is as follows:
Char * DTOSTRF (Double Val, Signed Char Width, Unsigned Char PREC, CHAR * SOUT) {
Char FMT [100];
Sprintf (FMT, "%%% D.% DF", Width, PREC);
Sprintf (Sout, FMT, VAL);
Return Sout;
}
Twitter authentication token settings, you need to innovate Twitter authentication on the Neocat website, you need to enter the token code into it:
Void TweetMessage () {
Twitter Twitter ("Enter Twitter Token Here";
The value monitored in the pusher to send the sensor:
Humidity ();
Float humid;
// Twitter Message
String stringmsg = "humidity:";
Char TMP [10];
DTOSTRF (Humid, 1, 2, TMP);
Stringmsg + = TMP;
Stringmsg + = "% rh";
The location and tag of the weather station, displays local locations or labels on Twitter, such as #iotweatherstn:
Stringmsg + = "# Mumbai #bandra #iotweatherstn";
140 words restrictions on pusions:
Char msg [140];
Stringmsg.tochararray (MSG, 140);
Message and connection troubleshooting, this code can monitor the operation of the text to help users check the status of data and pusher:
// Tweet That SUCKER!
IF (Twitter.Post (MSG))
{
Int status = twitter.wait ();
IF (status == 200)
{
Serial.Println ("OK.");
Serial.Println ("Message Tweeted");
}
Else
{// connection test
Serial.Print ("Failed: Code");
Serial.Println ("Message Not Tweeted");
Serial.Println (Status);
}
}
Else
{Serial.println ("Connection Failed.");
Serial.Println ("Message Not Tweeted");
}
All data in the code requires converting the analog signals of the sensor to digital signals, which can also be downloaded in the repository, click on the link.
Step 8: Check the sensor using the code monitoring sensor in the above library, is highly gone. Using this, you can open a boring marketing number specifically to tell the weather, but how can Twitter can study it.
WeChat public account search "Love Board Network" plus attention, daily update development board, intelligent hardware, open source hardware, activities, etc., you can make you full. Recommended attention!
[WeChat scanning picture can be directly paid]
Temperature recommended:
Award-winning topic participates in -dialog acquisition atmel, do you look good or see?
Break through the technical limit of wearable health care equipment, this complete solution cannot be collected
Adi internal information, the simulation engineers must know those who must know
DAC interface design book, the most complete history
Is it not enough to see? Here has an ADI simulation design collection full version download
Temperates, N simulation reference design circuit package download, the models are classics that cannot be missed
One day, the motor control system is designed from the entrance to advance, precious design information free delivery
The most authoritative solution of the gain specification asymmetric problem
Several words to understand high-speed ADC key indicators - error conversion rate
Our other product: