The Blog

How much computing power is enough?

Computing power has increased exponentially over the last decades. You now have more processing power in your pocket calculator than in the first rocket to the moon! And yet we are always looking to the newer faster model that will make our tasks just a little bit easier. Ironically, along with increased speed comes applications with more sophisticated user interfaces and bloated feature sets, with a net gain in increased performance of nearly zero.

Typically when worked in an embedded environment, processing power, memory and storage are finite and tend to be on the low side. In recent years however, with the advent of low power micro computers such as the raspberry pi the line between computer and embedded device has become more blurred.

Answering the question "is this enough power for my needs?" obviously depends on the type of service you plan to offer - if its an embedded HD video solution chances are more is better. But if you need to build a home automation controller, data logger or other device that does not require high processing power then you are left with a choice of plenty of low to mid range MCUs that fit the description nicely. Using a non-Linux custom operating system does not mean your device can't have all the bells and whistles of a more powerful one - it may just do the same thing a little more slowly. A web interface with embedded scripting language may produce a page in 1 second rather than in 20ms on a raspberry pi, but if this is a task that is performed intermittently such as checking a graph or logging in once a day, it may not justify the complexity and resources of a higher power processor.

As an example of what can be achieved with limited resources, the Wattmon device runs on a pic32mx processor with 512k of Flash and 128k of RAM. This executes a customised FreeRTOS based system with Ethernet, USB host support for 3G data cards, microSD storage, and a PHP compatible scripting language. The embedded web server can handle up to 7 concurrent connections, and the scripting engine can run several scripts simultaneously in a preemptive multitasking environment. Does it work as quickly as a Linux based processor with 1GB of RAM? No. But it does work well and serves up web pages at a very decent speed, has real computing power, and runs on less than two watts including the Ethernet hardware, making it a low cost computing platform for remote monitoring and control.

This is just one example of many that can be found on the Internet that push the limits of embedded platform and show what can be done with limited resources. So next time you ask yourself whether bigger and faster is better, remember that sometimes it just isn't necessary.

Comment (0) Hits: 2636

Remote Monitoring

Remote monitoring allows you to track important changes to your hardware without requiring a field visit, thus saving time and money. India and much of Africa has many off grid installations with battery storage and some form of renewable source such as solar or wind. Usually, qualified service technicians need to travel long distances to reach these installations whenever there is a problem. Using Wattmon and a USB dongle, technicians can access the sites over GPRS or 3G if available and can troubleshoot the likely cause before travelling. Typically, problems are associated with incorrect charging or discharging of battery packs, and this data is not known before installing a data logger and understanding the charge and discharge profiles.

We have installed a prototype wind/solar hybrid setup where Wattmon controls the charging by switching on a dump load when the battery is full, and switches off the load when the battery is empty. We monitor this setup remotely and can inform the client exactly what the problem is when the system goes out by checking the graphs. We also tweaked the charge algorithm remotely. This type of control over a data connection means that we only visit a site once for the setup but we can continue to provide support remotely.

Comment (0) Hits: 2702

An Embedded Device for the Internet of Things

The Internet of things is a buzzword today. More and more platforms and solutions exist with different levels of complexity. In its essence a device needs to have an Internet connection and be able to receive and respond to commands in some predefined protocol.

The Wattmon device has everything required to get started with your Internet of things project. An integrated file manager, code editor and simple php compatible language makes it the ideal tool for beginners, but powerful enough to be useful for real world projectsas well.

The microchip, a pic32 chip, is an amazing little device that has 128k of RAM and 512k of flash, enough to fit the Wattmon kernel and interpreter. About 64k of ram is available to run applications once all core buffers and tasks have been allocated.

Wattmon runs on a FreeRTOS kernel and modified microchip stack. Background tasks take care of the various IO operations such as serial, modbus polling and Ethernet. A web server task handles incoming requests and spawns Interpreter tasks that produce the actual content. The uPHP interpreter was written from scratch and is designed to run with minimal RAM. It compiles code into tokens which it then writes back into a separate file on the sd card. This happens only when it detects a newer date on the original .cgi file and therefore the overhead is minimal and every task has a small token buffer making it possible to run scripts that are larger than what fit into RAM.

In addition to the web interface, a task scheduler lets you run scripts at predefined times defined in a crontab style file but with an accuracy of 1 second. Inter process communication can be achieved using the $_GLOBALS array. Multiple tasks can run in parallel and memory is automatically managed to ensure that when resources run low some scripts are paused until others complete. A script can be executed at startup to initialise the system and can either terminate or run continuously in the background.

A telnet interface allows you to log in remotely and execute scripts from the shell. Scripts run via a shell take their input from the keyboard and send their output back to the terminal allowing you to develop sophisticated applications such as a file editor similar to vi.

And that is just the core set of features. An action manager lets you configure triggers that will perform an action based on a set of conditions that can involve system variables, device variables and global variables and can even be enabled only during a certain time of the day! These triggers can then automatically perform actions such as switching on or off relay devices, setting global variables, sending an email or accessing a web page, or executing a script without writing a single line of code. The action processor runs from within the kernel, ensuring a minimal latency of up to 100ms to process.

This combination of features makes Wattmon a powerful yet easy to use multi-purpose embedded computer that I developed with purpose of managing DC energy but which has turned out to be so much more. Wattmon is more than capable of taking on the Internet of things!

Comment (0) Hits: 2731

Energy Monitoring Devices

Energy metering and data logging with remote access are nothing new, the Internet of Things is here and such devices are becoming more commonplace every day. So what makes Wattmon stand apart when compared to other similar devices?

The foremost two things that most people seem to like are the flexibility and the interoperability, so I will focus a little on these two topics.

Flexibility

Bringing flexibility to an embedded device is challenging for any developer - it helps a lot when product specifications are clearly defined beforehand, especially when working with limited resources and processing power such as the Microchip PIC32 processor used in the Wattmon. Even before beginning work on this project I could imagine many different scenarios where the device could be used, such as for home automation, data logging solar charging, battery management, pump control, weather stations... And more!

Wattmon separates the firmware kernel and operating system from the application - the firmware resides in internal flash and implements the uPHP (micro-PHP) scripting language with a subset of PHP's functionality. The application - or package as I refer to it - is a set of scripts that run off the microsd card and perform any function required. The wattmonsolar package handles data logging and battery management for solar setups, and the wattmon water setup handles a 3 phase bore well pump and several booster pumps, making it the perfect tool to manage remote water tank setups.

All these scripts are open source, and anyone can extend and modify them to suit their requirements - this is nothing new either since Linux is open source too, but the combination of a small embedded device capable of running custom scripts with ready made open source packages for energy monitoring is less common. The raspberry pi brings flexibility and power, but it is still not easy for a layman to manage, and it isn't packaged into a final product.

Interoperability

Many larger solar companies have some form of data logging or computer connector on their devices. Charge controllers may have information about the state of charge and voltage, as well as kWh generated. Inverters may have some outputs about load or performance. All of these usually connect to a proprietary software or hardware device from the same brand.

Consolidating this data together is not easy, and usually requires an expensive add on device. Wattmon simply plugs into your cable network and doesn't care which brand is managing your energy generation or load, as long as it has the full picture of all energy flowing through the battery. This means it is no problem to change brand, and you can save money on those expensive monitors!

Comment (0) Hits: 2761