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”.
May 17, 2011 at 6:11 am
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 ?
May 17, 2011 at 7:04 am
Hey !
Adding to my previous query, did you use IAR or CCS for development ?
May 17, 2011 at 10:57 am
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.
May 18, 2011 at 12:41 am
Thanks a lot for your help. Your work is highly appreciated.
July 5, 2012 at 8:11 am
hey,.
sir,. can you give me the complete schematic of your wireless weather station?
please sir..
May 20, 2011 at 12:40 am
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 ) ?
May 20, 2011 at 9:12 pm
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.
May 20, 2011 at 5:01 am
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.
May 20, 2011 at 9:57 pm
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.
May 26, 2011 at 7:22 pm
Where is send_data.c please? I can only find receive_data.c
June 10, 2011 at 10:18 pm
Sorry, the new zip has it included.
May 28, 2011 at 5:18 am
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
May 28, 2011 at 3:30 pm
Hi Aman
Do u have the send_data.c file please? because in the zip file, this file seems to be missing
May 28, 2011 at 3:33 pm
Also, can you get the data transfer to the computer and get it display please?
May 28, 2011 at 3:39 pm
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.
June 10, 2011 at 10:19 pm
Are you still having issues?
June 11, 2011 at 3:27 am
yes, and I built the the code using CCS, NOT IAR
August 31, 2012 at 10:05 am
How you solve problem of fatal error????
June 10, 2011 at 10:20 pm
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.
June 24, 2011 at 12:35 pm
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?
June 24, 2011 at 2:00 pm
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.
June 24, 2011 at 3:36 pm
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;
}
June 27, 2011 at 8:38 pm
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.
July 5, 2011 at 11:33 pm
Hi,
Can you pls send me which temperature sensor and light sensor you used in this project
July 5, 2011 at 11:52 pm
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
July 6, 2011 at 6:40 am
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?
July 6, 2011 at 6:46 am
does every msp430 have in built temp sensor?if so which family of msp430 you have used?
July 6, 2011 at 2:05 pm
Yes I believe they do. I used this because it’s an eval system with a built in RF chip.
July 6, 2011 at 8:57 am
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.
July 6, 2011 at 2:05 pm
Glad I can help. Please share your project when it’s done!
July 18, 2011 at 10:08 pm
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!
July 24, 2011 at 4:10 pm
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!
August 25, 2011 at 1:31 am
Good work Jeremy and Matt!
I never knew that processing could be so useful!
Thanks for posting your project report and your work.
December 4, 2011 at 10:16 am
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
January 2, 2012 at 6:42 pm
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?
January 30, 2012 at 10:41 am
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. . .
March 27, 2012 at 7:05 am
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.
April 26, 2012 at 9:39 am
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?
July 5, 2012 at 1:37 pm
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.
July 5, 2012 at 8:16 am
hey,.
sir,. can you give me the complete schematics for this project?
please sir..
July 5, 2012 at 1:38 pm
The schematics are available for download in the post above: “Download the MSP430 Weather Station Code and Schematics”
October 9, 2012 at 2:39 pm
Thanks.
Please Tell me verity of sensors can be used for humidity and moisture measurement compatible with ez430rf2500 kit
November 4, 2012 at 12:45 am
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…
December 18, 2012 at 4:34 pm
Apologies, but I’ve never done multihop mode…
March 26, 2013 at 4:25 pm
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
May 1, 2013 at 1:34 am
Hi Jared,
Did you solve your problem? Still I’m not able to compile with CCS.
Thanks
April 26, 2013 at 1:36 am
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
April 26, 2013 at 2:23 am
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?
May 2, 2013 at 12:21 am
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?
June 19, 2013 at 5:07 pm
Did you follow all the environmental variable settings that I specified in the post above?
December 4, 2013 at 7:58 am
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???
December 26, 2013 at 9:39 am
You should be able to send data in both directions.
January 10, 2014 at 2:06 am
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!!
February 19, 2014 at 7:48 am
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
February 20, 2014 at 5:05 am
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
February 20, 2014 at 5:24 am
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.
February 21, 2014 at 6:35 am
Has anyone found a solution to these missing .out files ?
Thanks in advance
April 17, 2014 at 6:13 am
Sir, Can you please tell me the graph units. As i need the units to my final year project.
December 3, 2014 at 3:01 pm
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
July 11, 2015 at 12:17 am
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
May 10, 2016 at 9:06 am
Elaborate Article,Thanks
August 11, 2016 at 5:52 pm
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.