Ultracapacitor capacity verification over time

A few years ago I installed a wireless, self-powered light sensor in my garden to determine when it is time to close down our electric blinds. It uses ultracapacitors to store energy during the day to be able to continue transmitting sensor status at night.

I monitored the capacitor voltage to be able to track the performance of the ultracap over time. The question was how it would behave during cold winter nights and hot summer days, and also if and how much the capacity of the component would be influenced by aging.

The first months the system worked fine, the ultracap got charged by the solar panel when the sun was shining, and the sensor node would happily bridge the night until sunrise, with even some juice left in the ultracap (the capacitor voltage never went below 3V). Over the time of a few months, the voltage was dropping further and further every night. A sign that the capacity of the ultracap was decreasing, as I assumed that the power consumption of the electronics would not change (the electronics are mounted in a water/airtight enclosure and were not touched).

After a year, I decided to add a second ultracap to help bridging nights. This helped temporarily, but after a few months the system voltage reached the minimum working voltage (2.5V) again every night.

After three years and after posting a message on jeelabs.org on the influence of aging on an ultracapacitor, I decided to dismantle the sensor node to actually measure the remaining capacitance of the ultracap.

Continue reading Ultracapacitor capacity verification over time

PSOC Designer 5.0 code porting

Cypress switched back to the ImageCraft compiler, and now we’re left with the task of fixing our existing codebase that was developed with the HiTech compiler.

Not too problematic. The only thing that bothers me a bit is the lack of good/up-to-date documentation. I spent an hour to figure our how to get the printf’s that I used in my code compiling again. Once you know how to do it, it is simple…

Example code:


printf("Test printf without parameters\n");

Compiling your HiTech code with the ImageCraft compiler, the printf fails with the following error:


type error in argument 1 to `printf'; found `pointer to __flash char' expected `pointer to char'

Seems that in for ImageCraft you need to use another printf function if the strings are in ROM. And this function is called… tada: cprintf.

Replace the existing printf with cprintf and you’re up and running again. I guess it would have need nice if this info was added to the ‘migrating from HiTech to ImageCraft’ document that is bundled with PSOC Designer. Maybe eventually, it will be…

Also notice: to get the ImageCraft printf functions working, you need to replace the ‘putch’ helper function for printf by:

// Helper function for the printf function.
int putchar(char c) {
 // Send characters to the Lantronix interface
 LTRX_PutChar(c);
 return 1;
}

Finally, if you fancy some more advanced printf functionality like modifiers, or support for long/float, you’ll need to update your ‘local.mk’ (‘Project’ -> open local.mk) and add the option

CODECOMPRESSOR:=$(CODECOMPRESSOR) -lfpm8c // For floating

CODECOMPRESSOR:=$(CODECOMPRESSOR) -llpm8c // For long support

Hope this helps you saving some time until the documentation gets updated!

xPL enabled utility meter monitor

When built our house, we took measures to ensure that we would consume little energy to keep our place to live warm and cosy. For this, we added extra insulation, we kept the number of air leaks as small as possible, and added a ventilation system that recycles the energy from the extracted air into the fresh air that is brought into our home.
Continue reading xPL enabled utility meter monitor

Self-powered wireless ambient light sensor

Since some time, the window blinds in our home are automatically controlled. When the sun rises they go up, at sunset they are closed.

To determine the correct time for the blind commands, I’ve written a mix of Perl scripts. There exists a handy Perl module to calculate sunrise/sunset based on the date and your location on earth. After some fiddling with the parameters, I have a setup that works rather good. However, the Perl module does not take into account the weather. On bright and cloudless days, the blinds can stay open a bit longer. When we’re on the other hand experiencing our typical North Sea autumn weather, they can safely be closed a bit earlier.

Enter some electronics 😉

Continue reading Self-powered wireless ambient light sensor

DCF controlled time switch

I needed a way to automatically control the main heating of my parents house. The basic idea is to start the heating at a certain time in the morning, and to switch it off at night. The switching points are different on various weekdays.

Of course, I could have bought a time switch. However, those things alway tend to have too much or too little switching points, an inaccurate clock, or they are just too complicated to be programmed (ok, this is relative, but you’ll agree with me that time switches with an RS232 port for programming are not really common ;-).

One of the first things I planned to make once I learned working with microcontrollers was a DCF77 time decoder. I never found the time to actually start building one, so this was the perfect excuse. I decided to make a PIC-controlled time switch that gets its time updated through the DCF77 radio signal.
Continue reading DCF controlled time switch