Wifi for picoos-net & uIP

Picoos-net library has been lacking support for Wifi networks and I have been trying to figure out how to implement it.

I would like to run the network stack on the microcontroller along with my application so I could keep on using APIs I’m familiar with. This rules out modules that have built-in tcp/ip networking. However, writing whole Wifi stack would be a huge task and resulting library might be too big for some microcontrollers I have been using. So this rules out cheap usb-stick style approach.

hlk-rm04Microchip has a nice Wifi module, but documentation for it is not publicly available and their own network stack is limited (by license) for use with their own microcontrollers only.

Broadcom seems to have nice modules also (Wiced) and they seem to provide some kind of SDK, which might make integration of modules easier.

Continue reading “Wifi for picoos-net & uIP”

EnergyMicro Cortex-M3 + pico]OS

EnergyMicroI just received my new EnergyMicro Cortex-M3 header board (Olimex EM-32G210F128-H). My cmsis-ports collection now has Energy Micro support and blink-test project has a small test program for this board.

Board has only SWD debugging support, so I wasn’t able to use OpenOCD + Olimex JTAG, but it works fine with Segger J-Link.

Next project is to attach MOD-ENC28J60 to UEXT connector and see if I can get IPv6 stack running with this.

Wireless KWh meter

After creating wireless compost monitor I was wondering what else could be done with the same card. I then saw a commercial about a gadget which displays house electricity usage in real time. The idea of the device is to help saving of energy. The gadget had a small box that apparently monitors how frequently the led on KWH-meter blinks (on our meter, it blinks once per 1 Wh) and sends that information to indoor visual display unit, which converts it into kilowatts.

Schematic for KWH meter monitor

The commercial gadget looks really nice, but of course I had to make my own. The MOD-CCRF card is just perfect for system like this. I just added a phototransistor with pull-up resistor to keep on eye on the blinking led. After checking that my “eye” was really able to see the blinking led I added some code to existing wireless monitor application to calculate house electrical power from blink count. The monitor unit sends the data then to same wireless access point as the compost unit for saving results in database.

Monitoring unit attached to KWH meter. Box contains the MOD-CCRF card with phototransitor circuit and two AA sized batteries.

Our KWH meter is in a small ‘closet’ which has a transparent plastic door. By attaching velcro strips to the door and back of the monitor box I was able to position the unit exactly over the blinking led.

I also created a simple chart to monitor results (last trend at bottom of page).

Source code is available at Github in sensor-node project.

Wireless compost monitoring

Biolan composting unit in our backyard.

Every family produces some waste that is suitable for composting. Our family uses a Biolan fast composting unit to convert that stuff eventually to soil. This is very easy to do during summertime, but in winter when the temperature drops below -15 °C it becomes a much harder job. Too many times have I found myself witnessing the unit in condition where inside temperature is near zero or even below it. After that it is very hard to get it working again before warm spring days come to fix the situation.

To provide some tools to avoid this I figured that it might be a good idea to put a temperature monitoring device into the composting unit. Ideally this would be a small device with radio, batteries and temperature sensor in waterproof box that I could throw into unit. Based on these requirements, Texas Instruments MSP430 CPU seemed like an obvious choice.

I really didn’t have much knowledge about MSP430 before this project so I ordered ez430-RF2500 development kit, which contains two MSP430F2270 boards with 2.4Ghz radio and internal temperature sensor. I used these boards to develop a port of Pico]OS for MSP430 and to test Simpliciti (a Texas Instruments radio stack). Creating Pico]OS port for the cpu was remarkably easy as the architecture is not at all too complex. Simpliciti stack required some work, because I had chosen a free mspgcc (Gnu GCC port for this cpu) as my compiler. Luckily there were some patches floating around in the net for this. Continue reading “Wireless compost monitoring”