środa, 1 października 2014

DIY Weather Station

Intro

This short article describes a weather station prototype that I've built based on MSP430F5529 USB LaunchPad Evaluation Kit. I made it for the local paragliding association; we needed accurate and up-to-date weather information especially when choosing the right site to launch from.

The project is strictly a hobby challenge and looks like one. It's a prototype.

Deployed and operatign weather station
The weather station is powered with a 5W/12V solar cell that charges a 6V 4Ah sealead lead-acid battery via DC-DC regulator.
It reports the following environmental parameters: wind speed, wind direction, air temperature, relative humidity, air pressure, solar cell and battery voltages.

The device utilizes a Davis 6410 anemometer, Bosch BMP085 pressure sensor and DHT22 relative humidity sensor. The last two serve as temperature sensors as well.
For communication with the web server an uBlox Leon G100 GPRS modem is used. The weather station can be remotely configured (for basic parameters like for instance measurement intervals per day and night, modem power down toggle between sessions to save energy etc.) as well as fully reprogrammed with a custom bootloader (that I published at https://bitbucket.org/eltomek/msp430bootloader). That's pretty much all.

Ready for final mounting. Polycarbonate boxes are weather-proof.
You can see the realtime data reported by the weather station at http://meteojs.lab42.pl/ (this is the temporary URL and site layout).

What is inside the boxes?

I designed the electronic schema and PCB with a great open-source KiCAD suite. It requires some time to get familiarized with but after a few hours everything goes smoothly.


The board is done a TI BoosterPack-way, I initially started designing the board with a microcontroller onboard but luckily quite shortly I realized that LaunchPad hardware does the majority of the job for me, most importantly it correctly implements a microcontroller with all decoupling capacitors, crystals and a debugging interface, including LEDs that are great for debugging purposes :D. Besides, the microcontroller platform can be replaced quick and easy if needed.
Ok, so the board apart from the LaunchPad pins consists mainly of the GPRS modem with a SIM card reader and sensor access pins. Plus an SMA connector for the antenna.

The most important part of the board is the main power section. It's based on ST1S10 PWM step-down regulator and drops the voltage from a 6V battery to 3.8V.


Then, the 3.8V supplies the GPRS modem (it's quite demanding) and a next level power supply for the microcontroller (3.3V).

Power supply section
Even though I used the examples provided by uBlox as a reference it seems that some more capacitors could be used; when the modem performs network registration there are current spikes of up to 1.2A at 6.5V, This is ok for the battery but if you want to use it with a power supply it must be really efficient.



The mainboard with LaunchPad put onto.

Findings and lessons learned

As a prototype this project has quite a few design issues and some bad decisions being made. Some of them result from the fact that the project was taking too long and I had to come up with something working that would satisfy the target audience needs (they were pretty simply defined). But some were due to lack of experience and this was where this project made the biggest sense for me.

First, spending too much time on the hobby project will never make your family happier.

The second one is separating the charging circuit from the main board. As a result there are some wire connections inside the box that could be avoided. The same goes for voltage dividers that go from battery and solar cell to MCU's ADC.

Inside the box: you can see that the box is almost empty... And these ugly wires...
The RESET_N line of the modem is a bi-directional line that can be used to determine if the modem is powered up or down. That's a valuable info as you don't have to wait for a fixed amount of time for the modem's system to power up or down. (update: it's not that useful in fact...)
Unfortunately I missed a very important fact written in the System Integration Manual that the line's output voltage is 1.88V and is not enough to drive the high logic state on the MCU input. It could be probed at ADC but the GPIO pin I assigned it to is not an analog input. As a result the power up/down functions wait for a fixed time of 5 seconds after the operation is triggered, and that is not a smart way to handle this. Rewiring the board would be a better choice.

I found balancing between DIY and out-of-the-box solutions a tough task. I initially chose a Phocos CA06 as a charging controller (it made my box really huge for it) but even though it had enough current capability (6A) it was reporting overload and cut off the power supply for the main board for some time due to high current spikes when registering to GSM network. You never know. So I went for a simple and cheap $2 DC-DC regulator, and ...

...finally, chosing a cheap $2 DC-DC regulator as a battery charging/power supply controller that the whole device depends on is wrong for at least 2 reasons: it's unreliable and ..... it's unreliable. And I realized it once the station has been deployed with no easy access to it (unless you are good at tree climbing).
Besides, it does not control the charging process at all, which was obvious by the time I was picking it.

Testing...

Next steps and improvements:
  • battery charging circuit based on TI's bq24450 IC
  • battery over-discharge protection based on TC54
  • camera (still photo) support
  • probably switching to ARM (TI Tiva C)
  • add support for SD/MMC (for storing weather data, photos and flash images)
  • fix problem for the RESET_N line of the GPRS modem
  • main power section improvements (add more low-ESR capacitors before and after the step-down)
  • put as much as possible and reasonable of components on the board (e.g the voltage dividers for voltage measurements)
I will probably release a software for public but there are still parts of it that I'm not proud of. Workarounds make some issues gone quite well....

About me

I am IT project manager but after work I like to do some engineering and technical stuff. Apart from programming that I did for living before I'm interested in electronics but I am quite a newbie in that area, I learned a lot by doing this project but still have even more to learn.

Brak komentarzy:

Prześlij komentarz