Contrary to popular belief, Arduino is not the only microcontroller I use for projects. I often program Atmega 8-bit CPUs in C for my research, I’ve played with PICs at various jobs, and I’ve also worked with Parallax Basic Stamp and Propeller chips. This semester, I added the TI MSP430 to my CPU repertoire, thanks to Cornell’s Embedded Systems course. I really enjoyed working with the MSP430, and got to implement some interesting, though very difficult, things on it, including parallel process execution and real time process schedulers. For our final project, my lab partner and I put together a wireless weather station using the MSP430 EZ430-RF2500 Demo Kit. I also developed a Processing application to gather the data via USB and display it graphically on a computer. The station gathers light, temperature, and humidity info and sends it wirelessly to a USB receiver where the data is displayed on a computer. Check out the video below and download the source code and schematics as well. Enjoy!
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Download the MSP430 Weather Station Code and Schematics
The folders contain all the driver files in the root. “receive_data.c” and “send_data.c” contain the main functionality. The code is intended to be compiled in Code Composer studio. To be sure it compiles, right-click on the project and go to “build properties”. On the “Tools Settings” page under “MSP430 Compiler > Include Options”, change “CCE_INSTALL_ROOT” to “CCS_INSTALL_ROOT”. Under “MSP430 Linker > File Search Path” change “CCE_INSTALL_ROOT” to “CCS_INSTALL_ROOT”. On the “Build Settings” page uncheck “Use Default Command” and change “CCE_INSTALL_ROOT” to “CCS_INSTALL_ROOT”.
62 comments
Hey Jeremy !
Awesome work on the weather station. Can you tell me what humidity sensor did you use for your project ? Will really appreciate if you can send me the schematic of your project. Also how did you transfer data between the 2 target boards ?
Hey !
Adding to my previous query, did you use IAR or CCS for development ?
There’s a link to download the code and schematics in the post above. That should show how we used the radios. The humidity sensor is this one: http://www.sparkfun.com/products/9569
I used CCS for development.
Thanks a lot for your help. Your work is highly appreciated.
hey,.
sir,. can you give me the complete schematic of your wireless weather station?
please sir..
Hey Jeremy !
I went through your code. I had a doubt in lines 39 and 40 of send_data.c
P2SEL = 0x04; // Pin Select
ADC10AE0 = 0x04; // ADC Low Bit (A2)
Is the first statement necessary ? Would just enabling pin A2 of the ADC suffice in taking the data from P2.2 ( to which it is connected, as per the datasheet ) ?
You might be right – I’m not certain. If you try it, let me know. It’s certainly not hurting anything, but it could be extraneous.
Hi,
I downloaded your code and schematics and was testing it. I could not find the MRFI and BSP header files . I am getting the error “could not find mrfi.h” during debugging. Can you please guide me out.
Aman,
Sorry about the problem. Please re-download the zip above, and follow the instructions that I’ve added below the download link. That should hopefully fix your problem.
Where is send_data.c please? I can only find receive_data.c
Sorry, the new zip has it included.
Hey Jeremy !
Sorry to disturb you in you holidays. Can you just briefly explain how you decided the value of the resistors used as voltage dividers.
Cheers !
Aman
Hi Aman
Do u have the send_data.c file please? because in the zip file, this file seems to be missing
Also, can you get the data transfer to the computer and get it display please?
actually I can’t build the file, even though I had done the what’s told to change, the errors I got are all the same type, but with different files, e.g:
“C:/Program Files/Texas Instruments/ccsv4/msp430/include/msp430.h”, line 1019: fatal error: #error “Failed to match a default include file”
1 fatal error detected in the compilation of “../receive_data.c”.
Compilation terminated.
Are you still having issues?
yes, and I built the the code using CCS, NOT IAR
How you solve problem of fatal error????
I wanted an output range around 0-2.5V since that’s what the MSP ADC works at. So I chose values that would give me that based on the full scale values of the sensors.
Hi
what is your percentage of packet loss?? because I don;t think I can receive 100% of the packet sent.
Is there a mechanism to increase the minimize the loss of packet? How to do this please?
With wireless communication, some packet loss is pretty common. You can add a checksum to identify packet drops, but it’s not really necessary in this implementation, since one missed value update won’t even be noticeable on the interface.
but I dont think I receive anything in fact, I put a statement to flash the LED, e.g. P1OUT ^=0x01; and it just went blink once……
here is my receiver side code
void MRFI_RxCompleteISR()
{
mrfiPacket_t packet;
MRFI_Receive(&packet);
P1OUT ^= 0x01;
}
Can you confirm that the remote station is transmitting? It should blink on each transmission. If it is, but you aren’t receiving anything, it seems like your interrupt might be incorrectly configured.
Hi,
Can you pls send me which temperature sensor and light sensor you used in this project
I used the temp sensor that is built into the MSP430. The light sensor is an ordinary photoresistor. Here’s one: http://www.sparkfun.com/products/9088
hi,
can you tell me how packet transmission takes place?what is the role of msp430 here?what is the advantage of using msp430 other than low power application?
does every msp430 have in built temp sensor?if so which family of msp430 you have used?
Yes I believe they do. I used this because it’s an eval system with a built in RF chip.
Thanks for posting this project! I’ve been working on an incubator monitoring system and your processing code will help my get my computer’s display going quickly.
Glad I can help. Please share your project when it’s done!
You do Awesome stuff! And thanks for introducing me to element 14.
This project is exactly what I been wanting to do as a milestone in my beginning in elementary electronics journey. I like how you have full integration into processing with the charting. Would you be willing to do one of your awesome full demo tutorials repeating this project but with arduino’s and zigbee’s (or other cheap transmitter, or both). I would also like to see the processing charting expanded, such as the ability to export data, which I suppose could be done by the output of the serial log instead. Or maybe take a step into python to do some really cool data capture and processing.
Eventually I would like to build multiple weather stations from different points in my house, yard, and garage, all sending back to a central display (added bonus as a weather ad-on for XBMC.)
Any case, just some thoughts. If you have a donate button anywhere, I would certainly donate for even a transfer of this project into arduio and some sort of inexpensive wireless.
Thanks again for all you do. You are a great instructor, even for us mid-career hobby tinkerers just starting to look into electronics on the weekends. Good luck!
Actually, the MSP430 is a lot cheaper than an Arduino and XBees – just something to consider…
I don’t have the time to translate this project to arduino, but you should be able to do it pretty easily if you watch my XBee Tutorial. If you want to expand on this project, please do, and send me details on how it turns out!
Good work Jeremy and Matt!
I never knew that processing could be so useful!
Thanks for posting your project report and your work.
Hi
I am doing a project similar to yours. To first understand the rx tx piece, I wrote a program to press the button in one of the devices RF2500 boards and toggle an LED in the second RF2500 board.
The problem I am having is that the code never enters MRFI_RxComplete(). Where in the code is the interrupt for RxComplete getting enabled ? I know that the receiver has received some data because it enters the following ISR
BSP_ISR_FUNCTION( BSP_GpioPort1Isr, PORT2_VECTOR )
and I just toggle the LED inside that ISR. But now when I want to look at the packet in that ISR, it is empty. Any help you provide is much appreciated.
Also what kind of debugging tools do you use ? i.e do you use any packet sniffer ?
Thank You
I used the built in debugging capabilities of Code Composer, and found them very useful. Is the packet being discarded as soon as it is read?
i want a c-program for wireless weather station using rf signal.. . . . . with two sensors ic IM-35,two converters adc.this is a fine combination of analog and digital electronics..
Hardware used for the project:
• Microcontrollers
• HT648l
• HT640
• STR 433
• STT 433
plzzzz send me. . .
i compiled your project. After compiling it shows an Error that “source code could not find msp_spi.h”
please tell me that how to overcome it.
I appreciate that you’ve shared this project. I’m working on research to determine the footprint created by projects like this. I’m trying to compile this with CCS, and I’m getting a build error – Exec error: Launching Failed. Has anybody ran into this problem before?
Unfortunately, CCS is a bit of a crapshoot, hence why my embedded processor of choice is the ATMega, not the MSP430. I’m not familiar with that particular error, though I do know that all the code I uploaded is sufficient for getting this project compiled.
hey,.
sir,. can you give me the complete schematics for this project?
please sir..
The schematics are available for download in the post above: “Download the MSP430 Weather Station Code and Schematics”
Thanks.
Please Tell me verity of sensors can be used for humidity and moisture measurement compatible with ez430rf2500 kit
Hey jeremy
I want to sense temperature and humidity and to communicate sensed data using ez430RF2500 for large distance i try to multihop the node.. But I found some problem.It is not working properly
I will be happy if you suggest code for multihop and also suggest low cost sensors i have mentioned earlier…
Thanks…
Apologies, but I’ve never done multihop mode…
Jeremy I’m getting this error in CCS when trying to run the code:
“MSP430: GEL: Encountered a problem loading file: C:Documents and Settingsservolabworkspace_v5_3TransceiverDebugTransceiver.out Could not open file”
How can I fix this?
Thanks,
Jared
Hi Jared,
Did you solve your problem? Still I’m not able to compile with CCS.
Thanks
Jeremy,
Thanks for your posting, but I’m in trouble with compiling your code. Definitely it’s because CCS environment issue.
In your source, you don’t have the sub-folder even your source have them.
#include “bsp_external/mrfi_board_defs.h”
#include “../common/mrfi_f1f2.h”
Can you share how you did set up the environment of CCS?
Thanks in advance,
Doug
What I meant is that your source does not have any files that should be in the folder of “simpliciti” from original TI source such as nwk files, so I have not been able to compile successfully.
Is there anybody here have this issue?
Anyone who visits this blog,
Is there anybody who can compile Jeremy’s codes successfully with CCS v5.3.0 that has c/c++ compiler version 4.1.2?
Did you follow all the environmental variable settings that I specified in the post above?
HI,
I am working on a similar project wherein i have to gather sensor data from the end device,process it in labview and send control signals to the end device which has to display data according to the user’s needs.Is it possible to send data from pc to the debugger which in turn will send it to the access point,again which in turn will send it to the end device??Can data be sent both ways or is it unidirectional i.e from access point to pc???
You should be able to send data in both directions.
hi jeremy,
im on the same project ! Can you send me the receiver code and the sender please. I can’t read it in the download link. I love your blog!!
Hey I downloaded the zip and tried debugging the station folder and during the debugging it comes up with an error that the send.out file is missing. Has anyone else encountered this issue ?
Thanks in advance,
Patrick
hai,
we tried executing the programs in ccs v5.we got the following errors:
C:\Documents and Settings\Administrator\workspace_v5_8\Transceiver\Debug\Transceiver.out Could not open file
C:\Documents and Settings\Administrator\workspace_v5_8\Station\Debug\Station.out Could not open file
Please help us fix these issues,it’s very urgent.
Instead of the humidity sensor you have used, can we use ubi sense humidity sensor???
will it work properly?
Thanks in advance
I got the same error, I made a thread on TI forums so if I get a solution from there I will post it back here, same if you find a solution to the problem post it back here.
Has anyone found a solution to these missing .out files ?
Thanks in advance
Sir, Can you please tell me the graph units. As i need the units to my final year project.
hi jb
firstly; i wanna thank you for sharing your job. i have a project only temperature and humidity not light sensor. which part of codes i have to cut? can you help? one more thing whats the difference internal and external temprerature? if ı gonna internal temperature like you do is it enough? is there need external temperature measurement??
thanks
I am getting the same error ” Encountered a problem loading file: C:\Users\Student Login\workspace_v6_1\Transceiver\Debug\Transceiver.out Could not open file”!! Please if anyone has a solution post it here
Elaborate Article,Thanks
Invaluable commentary – Just to add my thoughts , if your business has been looking for a IRS W-3 , my family edited a fillable version here http://goo.gl/65hntU.