Microcontroller Weather Station

Discussion in 'Embedded Systems and Microcontrollers' started by gorillawarfare, Oct 31, 2008.

  1. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
    Hi, wondering if anyone could give me any advice for a project I'm doing. It's early stages at the moment, but the basic idea is: get a few IC sensors for various atmospheric conditions (temperature, humidity, air pressure etc), connect them all to a microcontroller, then have the controller log data from all the sensors for about a week or so. Then, I can go in, plug into a computer, and retrieve all the data from memory.

    So far, I've got a few sensors that look like they'll do the job (National Semiconductor LM335 for temperature, Freescale Semiconductor MPX5100 for air pressure), but my main concern right now is picking a microcontroller. I really don't know much about them, what kind of things should I be looking for, in terms of processing power, memory, I/O slots, other things?
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    What programmer do you have? The most popular companies for microcontrollers are Atmel (AVR's) and Microchip (PIC's). I have worked with PIC's and they have built-in code (protocol) for RS232 port and for usb port, thus it will be easier for you to communicate with a PC. I dont know about AVR's. You can look at www.atmel.com and www.microchip.com for more information.
    Also, you have to calculate how many bytes of memory (EEPROM built-in the microcontroller) you require to store the measurements for a week, how many analogue inputs you will need and how many digital I/O. About the performance you dont need a very fast microcontroller, so the 8-bit series of both companies would be fine.
     
  3. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
    thanks mik, thats helpful, I'm looking at Microchip's PIC16F870 controller at the moment, still not sure but its less confusing now.

    I've also been looking at sensors that I can buy, and while there are several options for temperature, humidity and air pressure, I would like to measure other conditions (wind speed, hours of sunlight, rainfall), and there seem to be less solutions for these - at least none that are small, integrated devices like the others. Anyone have any suggestions for these?

    (Do they make very small anemometers that can just be integrated directly into the circuit? Or could I do it some other way, like have the spinner connected to a little generator in the circuit, and detect changes in the current produced?)
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I cant help you about the various kinds of weather sensors exist because i have never got interested in them. As, for the anemometer you can build a small windmill and place a sensor which detects when it makes a full rotation. Then the microcontroller will measure the time interval a full rotation needs and with relation to some mechanical formulas, which relate the wind speed with the windmill speed, it will calculate the wind speed. For better accuracy you can make it to sense each half rotation and make the appropriate calculation. The more positions it senses the better the accuracy.
     
  5. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    You might be able to cobble together a small anemometer by using a mouse wheel (quadrature encoding). Hours of sunlight can be handled with a photosensor. Measuring rainfall requires a collector - no way to miniaturize a rain collector.
     
  6. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
    Ok, most of the sensors are now sorted, thanks guys, just the microcontroller now. Assuming I go with a Microchip one (eg PIC16F870), how would I go about interfacing with it? I know Microchip offers MPlab for programming and debugging, but do I need a separate development kit as well?

    Also, I calculated that I need about 128kB for logging sensor data over a period of a week, this seems like a lot more than most microcontrollers offer....am i reading this wrong? Or do I need to buy a separate memory module to attach?

    Thanks
     
  7. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    What programming language are you using?

    Also, you need the appropriate software which can control your programmer if it is not supported by MPLAB.

    Yes, you will an external EEPROM if you cant find a uC which suits your needs.
     
  8. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
    I was planning to use C, since I have some experience in that
     
  9. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Then you will need the GCC compiler linked into MPLAB (i used it) or use the Hi-Tech software to compile a C code for a uC.
     
  10. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
  11. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If you have a programmer device for uC's which supports the uC you are going to use then you can use it. Otherwise you have to buy one. Search in ebay for them, you will find some good deals but take care that it can program your uC.
     
  12. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
  13. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    You need to buy a software which controls the ICD programmer unless it can be controlled by Wiz C
     
  14. gorillawarfare

    Thread Starter New Member

    Oct 31, 2008
    7
    0
  15. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    You can use multiplexers/demultiplexers to reduce the pins needed from the microcontroller.
     
  16. John Luciani

    Active Member

    Apr 3, 2007
    477
    0
    Do you need SRAM or can you get along with flash? There are a lot of I2C flash
    chips that could save you a lot of lines.

    (* jcl *)
     
    Last edited: Jan 4, 2009
Loading...