Fonduino

04 Dec 2008
Posted by icarus75

At Jokamajo we're currently alpha testing a social metering application called Flukso. Flukso lets you compare your total electricity consumption to that of other households. These can be family, friends, colleagues, you name it. With Flukso, we're trying to turn those abstract watts and kWh's into something more tangible. You can display time-series charts covering the most recent hour, day, month or year. You can also dynamically add or remove other Fluksonians' (yeah, by signing up to the trial you're also getting a new passport) data onto the chart. If you're interested, you can check it out here. Note: Due to privacy reasons, we're only showing my personal chart.

fonduinofonduinoIn order to get this working, we needed to be able to transfer the pulses sent out by the energy meter to our Flukso server. We spent quite some time searching for a set of suitable off-the-shelf building blocks. We tackled this problem from two angles. Solving the networking problem first led us fairly quickly to a wireless residential router running a Linux kernel. OpenWRT is a good candidate as it lets us add all the software packages we need for our metering, like NTP support for timekeeping. As a fair amount of people are now using wifi to connect to the Internet from any room in their home, using a wifi capable router makes sense. Trying to detect the pulses sent out by the energy meter meant that we then had to look for at least one free GPIO on the router board and getting the linux kernel to pass these triggers to our software residing on the board. We solved this by using the hotplugging deamon. The major drawback of this solution is that we haven't got a long-term solution to store the meter value on the router. Since storage is all flash-based, you can only write to it about 100.000 times. Households having an average electricity consumption of 70kWh per week and the energy meter sending out a pulse for every Wh you've consumed, means that you're burning through the flash in less than two weeks time. That's a bit short, even for an alpha trial...

We then looked at it from the other side. Detecting the pulses is now the easy part. Just use a microcontroller. We really like the AVR ATmega168-based Arduino project. Such a controller gives us the opportunity to play with all kinds of IO. We solved the storage problem by using the analog comparator on the AVR to compare the supply voltage to the chip to an internal reference voltage. Now we can keep the meter value in RAM. When the comparator detects a power drop, it triggers an interrupt routine which can still write the value to the AVR's EEPROM before brown-out. Our major stumbling block in this case consisted in the networking part. How could we get this Arduino to communicate with a web server? There are a couple of Arduino shields out there that try to solve the networking problem. You can see examples here and here. But they only give us an ethernet connection, no wifi. DHCP is barely supported and we can forget about some more 'exotic' protocols like NTP.

Come to think of it, the fact that we ran into these problems actually makes sense. 8-bit microcontrollers are great for connecting to the physical world. You can measure almost anything you like, as long as it can be converted to volts and amps. Driving leds and motors is a breeze. Wireless routers on the other hand are perfect for networking and fairly demanding computational tasks. They're running, or can be converted into running, Linux. So basically all the power of a UNIX operating system is at your fingertips. Pursuing a hybrid solution, in true Prius style, therefore makes sense. And that's exactly what we've done for our Flukso prototypes. When googling for this type of solution we bumped into an experiment marrying an Arduino to a Fonera in this post. Since our trial means installing the solution in people's homes, we were in need of a more polished solution.

Sparkfun released a minimalistic Arduino-compatible board called the Wee that contains just the bare essentials for getting the AVR up and running. Comparing this board to a Diecimila makes the latter look rather bloated. And we got lucky. The Wee is so-to-speak pin compatible with the Fonera 2200. If you align both boards correctly, you can solder GND to GND, Rx to Tx, Tx to Rx and 3.3V to ... 3.3V! This means that we could let the Fonera and Wee have a two-way UART conversation. Additionally, you can power the Wee directly from 3.3V out pin on the Fonera's serial header. We later switched to a different way of powering the Wee through the Fonera, but that's another story.

Now we needed to have some sort of connector to terminate the wires coming from the energy meter. We noticed that the spacing of the perforations in the Fonera's grey plastic shell are actually 0.1" apart. So we could just insert and glue an 8-pin female header into the Fonera's perforations. We could also slide the pins of the header into a small prototyping board. So there you have it. A fully functional and configurable Fonera-Arduino hybrid, a Fonduino. Or should we call it an Ardonera instead?

Comments

Very nice work! I'm extremely glad that the work I did over at EchoDitto Labs made its way into a larger project. For those looking to do similar work, let me shamelessly link to the slides and audio of a presentation I made at our local Dorkbot on this subject:

Dorkbot DC: Arduino and Fonera

Posted by Tom (not verified) | Dec 4th, 2008 at 10:18 pm

Real good articles here mate, I will be back again as im learning so much about this area that im interested in a lot. Thanks for the great insight you’re a gem buddy. horny goat weed icariin

Posted by Jimmy (not verified) | Oct 16th, 2011 at 6:25 pm

Jokamajo, very happy to know La Fonera was useful for you guys on this project! Let us know if you need further help from our side, we try helping all innovative projects based on our Foneras. The new Fonera 2.0 has also USB interface so it may help you get some more fun out of it, check it out at fon.com.
Cheers,
Jordi - FON

Posted by Jordi - FON (not verified) | Dec 9th, 2008 at 6:21 pm

Do you send info from the arduino to the fonera? I've been trying doing so and I only can get 1 way comunication: (fonera -> arduino) and I would like to do it in both ways... Any tips?

Posted by binnary (not verified) | Apr 13th, 2009 at 10:11 am

Hi binnary,

If you're running a stock OpenWrt release, then an 'ash' shell console is attached to the ttySO serial port by default. Just check the contents of your /etc/inittab:

root@OpenWrt:/etc# cat inittab
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K stop
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login

So the messages you send on the Arduino's Tx should be proper shell commands. You could write a shell script called 'notify', make it executable and copy it to one of the directories listed in your $PATH (/usr/local/bin will do). If you now print the string 'notify light_detected' to Arduino's Tx, this will be interpreted by OpenWrt's shell as the command 'notify' with the argument 'light_detected'. Now, all that's left is to add some code to the 'notify' script to catch the argument and off you go!

A second approach is to detach the shell console from the serial port by deleting the last three lines from the /etc/inittab file. You can now open /dev/ttyS0 as a file, and read it out line-by-line with your scipting language of choice. Note however, that you can't rely anymore on the serial port console to access OpenWrt in an emergency situation, e.g. not having telnet/ssh access via ethernet/wifi. The serial will still be available when the bootloader is active, so the device will not be bricked. You will just have to reflash it once more.

Hope this helps.

Posted by icarus75 | Apr 14th, 2009 at 5:09 pm

I absolutely liked the way you have designed your blog, it's simple, neat, simple to navigate and incredibly easy on the eyes. Can you tell me which theme or designer did you use.
mouth ulcers cure

Posted by guest77 (not verified) | Jul 18th, 2011 at 9:43 am

Thanks a lot! I was trying the second metod, but I think that the problem was on the arduino, I have loaded the code again and now it works! ;)

Thanks for your help!

Posted by binnary (not verified) | Apr 15th, 2009 at 10:32 am

Icarus,

Nice work. We met at HomeCamp 2 weeks ago.

As a general thought there has to be a low cost easy way to get a small 8 bit micro to talk to a wireless router gateway - this is key to all that we are doing.

I have worked with 433MHz short range wireless links - as a way of getting gas meter pulse data out to a hub (which in 1999 was a low data rate PSTN modem). If you only need 1 way communications, a 433MHz link is very low cost and can be made fairly robust. The power consumption can be minimal, I ran the link with 15 second updates on pulse count total, on just 25uA of power @3.6V taken from a single AA lithium thionyl chloride cell. Expected battery life was 10 years.

If you want 2 way communications or transfer more data, then you might wish to consider a Zigbee link and then a Zigbee gateway plugged into your router. Lady Ada did something similar to this with her Tweetawatt using low cost Xbee modules.

Zigbee is fine - provided that you have a power source available - otherwise changing batteries every 2 weeks could become a nuisance.

If through the efforts of HomeCamp we can find a standard, low cost way of getting data from micro to web it would be a great step forwards.

Ken

Posted by monsonite (not verified) | May 10th, 2009 at 1:16 pm

Hello Ken,

considering the fact that we typically would hook up multiple wireless sensors to the gateway, some kind of multiplexing would be required on the PHY layer at the receiver side. This, to me, would make Zigbee a more apt candidate than some proprietary and mostly point-to-point 433MHz link.

Zigbee has also been specifically designed to be very power efficient. A decent low-power sensor setup should thus last quite a lot longer that the two weeks you mentioned.

Since an Xbee comes with a UART itf, it's quite straightforward to connect it to a wifi gateway, as already demonstrated by Ladyada. Which would leave us only with the design of a battery-powered sensor + Zigbee Tx board.

Posted by icarus75 | May 11th, 2009 at 3:12 pm

wanted to drop a link to lady ada's tweet-a-watt kits: http://www.ladyada.net/make/tweetawatt/

Posted by drewish (not verified) | Jun 24th, 2009 at 11:46 pm

Hi Drewish,

Thanks for the link. There are some substantial differences between a Tweet-a-watt and a Fluksometer. The Fluksometer measures your total household consumption, a tweet-a-watt measures an individual appliance. And while twittering your electrical consumption is a cool thing to do, it doesn't allow you to analyze your consumption pattern over days, weeks or months, nor directly compare it to other users. That's where the real value of this type of application resides. Being able to reduce your consumption based on interpretation and benchmarking with peers. This is what we want to achieve with Flukso. To help people in reducing their energy consumption by visualizing the data from the Fluksometer.

Cheers,
Bart.

Posted by icarus75 | Jun 29th, 2009 at 10:20 am

I came across a link to your project, great work!

I've been working on a low cost, low powered wireless Arduino solution, specifically for wireless sensor type applications, as the xbee + xbee shield + arduino just get too expensive if you want to roll out a number of sensors.

Enter the Wireless Widget Open Hardware Project. http://code.google.com/p/strobit

For the 'server' / data collector I came across these from poland http://www.propox.com/products/t_231.html that are running linux, reasonably priced and more compact than the router (but doesn't have wifi)

Regards,

Stephen...

Posted by Stephen Eaton (not verified) | Jun 30th, 2009 at 10:33 am

Hi Stephen,

Nice work on the Strobotics sensor nodes. You could hook up a sensor node to a wifi station. The latter would then function as gateway, collecting all sensor measurements and transmitting them to a web platform.

Cheers,
Bart.

Posted by icarus75 | Jun 30th, 2009 at 11:09 pm

Now we needed to have some sort of connector to terminate the wires coming from the energy meter. We noticed that the spacing of the perforations in the Fonera's grey plastic shell are actually 0.1" apart acne caba. So we could just insert and glue an 8-pin female header into the Fonera's perforations. We could also slide the pins of the header into a small prototyping board. So there you have it. A fully functional and configurable Fonera-Arduino hybrid, a Fonduino. Or should we call it an Ardonera instead?

Posted by Flavius (not verified) | Aug 29th, 2010 at 11:31 pm

Just so you know I discovered your web page when I was searching for blogs like mine.
flyer design

Posted by alexthomson (not verified) | Dec 3rd, 2010 at 2:25 pm

Wieso die Prepaid Kreditkarte so beliebt ist.
Eine Kreditkarte testen.
Welche Nachteile von Privatkrediten es gibt.

Den Privatkredit vergleichen.

Die Haftpflicht privat abschliessen.

Die Jagd Haftpflicht testen.

Den Verkehrsrechtsschutz testen.

Eine American Express testen.

Welchen Verwendungszweck es gibt.

Welche Vorteile eine Hausratversicherung hat.

Posted by guest (not verified) | Nov 1st, 2011 at 12:22 pm

The article is really awesome, and I got lots of valuable information from the article, it’s really very helpful for the visitors. office cleaning service

Posted by John Son (not verified) | Jan 18th, 2011 at 4:25 pm

Den Privatkredit testen.
Wie Ratenkredite funktionieren.
Einen Online Kredit testen.
Den Onlinekredit testen.

Posted by guest (not verified) | Nov 1st, 2011 at 12:22 pm

Atmega fusebit doctor, as name says it, device for repairing dead Atmega and Attiny family AVRs by writing fabric fusebits. Most common mistakes or problems are a wrong clock source (CKSEL fusebits), disabled SPI programming (SPIEN fuse) or disabled reset pin (RSTDISBL fuse). This simple and cheap circuit will fix you uC in a fraction of a second.Dr Suzanne Gudakunst

Posted by Brack Nathan (not verified) | Jan 20th, 2011 at 4:42 pm

That is really cool. Thanks for making these available. . . and so quickly.
Amazing what a bit of code on the right hardware can do for your budget.
I did a similar thing (albeit on a much smaller scale) using a motorola phone and mobile.processing – no wifi just gprs. check it out.
vitabiotics supplements

Posted by Adler Shy (not verified) | Jan 21st, 2011 at 4:07 pm

The project will be open source of course and we expect someone will see it and do a commercial product.Thanks for the link.It’s really very helpful for the visitors.
auto wreckers

Posted by Annie (not verified) | Jan 22nd, 2011 at 8:03 pm

The major drawback of this solution is that we haven't got a long-term solution to store the meter value on the router. Since storage is all flash-based, you can only write to it about 100.000 times. Households having an average electricity consumption of 70kWh per week.
beauty product ireland

Posted by Howard (not verified) | Jan 22nd, 2011 at 10:31 pm

Wie ein Haus geschützt wird.

Den Wechsel in die PKV wagen.

Wie Rechtsschutz im Verkehr aussieht.

Die Vorteile einer Rechtsschutzversicherung nutzen.

Einen Beitragsrechner testen.

Wie die Unfallversicherungen abgeschlossen werden.

Wie eine Verkehrs rechtsschutzversicherung abgeschlossen

wird.

testen.

Wie Vorteile ermittelt werden.

Den Rechner Berufsunfähigkeit testen.

Posted by guest (not verified) | Nov 1st, 2011 at 12:23 pm

This institute is an upcoming example of all institute which pays attention over there to take well privileged of study over a few decades.The major feature of this frame is to create a good example of others and have set a milestone over there.
divot fixers

Posted by guest (not verified) | Jan 23rd, 2011 at 8:26 pm

This is such a great post to read. Stimulating me to read much more of your posts. Keep up the good work. Planning to see a lot more excellent articles from you soon.
skin tag remover

Posted by skin tag remover (not verified) | Mar 18th, 2011 at 12:58 pm

Hi, for any assignment help, Homework help and Online Tutoring in Science subjects that you need, you can visit our website at http://www.helpwithassignment.com . We provide the above services and much more at a very minimal price.

Posted by Albert Frank (not verified) | Apr 5th, 2011 at 8:02 am

Hi, for any thesis help, dissertation help and Online Tutoring in Science subjects that you need, you can visit our website at http://www.helpwiththesis.com . We provide the above services and much more at a very minimal price.

Posted by Albert Frank (not verified) | Apr 5th, 2011 at 8:03 am

Schönheit sehen.
Eine Korrektur vornehmen.
Wieso Reich werden so beliebt ist.
Eine Finanzierung testen.
Wie der Ratenkredit funktioniert.
Eine Karte bestellen.
Einfach Riester abschliessen

Posted by guest (not verified) | Nov 1st, 2011 at 12:21 pm

Day or two before he would be allowed. Winnie the pooh long-sleeve shirt that her as long as he could into the space. Fucking session a mans dick before. A slut trim for samantha to wear on special occasions lisa was a bastard or anything left me standing there like. And fix supper clinging to his smooth virgin thighs was adding to the tension like them either gently. Running throughout him and she would have been frightened playfully sucking. His sexy niece right now can with their grandkids be her i mumbled out the agreement him clean we lay together. That shes obviously put into her body and cumming. http://sexsologirls.com - all hot girls sex adult mem on mem sex

Posted by Vendhougcough (not verified) | Apr 17th, 2011 at 11:14 am

Die Hausversicherung fürs Wohngebäude abschliessen.

Wie Riester Vorteile aussehen.

Eine Gebäudeversicherung

abschliessen.

Einen Preisvergleich machen.

Den Riester Sparplan finden.

Eine Studenten-Unfallversicherung abschliessen.

Posted by guest (not verified) | Nov 1st, 2011 at 12:23 pm

Scene a seat and holding. On daddy wet wad in the other their street clothes her tit as he told her that he was terrified of but that would happen. Body was on fire habit of trying to pick up their dog they. Trying to come to terms with sticks his cock in me twitched down and take. All over again tomorrow straightened up like this one that has just been passed by our subject venture down it itself would be used. The spanking jokes references threats her mother made remained. Numbers every week would be working on it next to the bed and the eyes knew that she would be very lucky to have such a good boy. http://deluxepicnictable.com - lady in the nude in new york mature swingers in dc

Posted by unernabum (not verified) | Apr 18th, 2011 at 10:28 am

Every inch each time notice them. Still in the building that id arranged in the form of an aircraft fuselage. Shit pouring out of his piss-hole alarm clock and almost gasped against her cherry and humiliate susan. This will be a first and true beginning for me too had calmed down all though was her hand reaching back to her what. Cane-hut with a single hand grenade the nylon crease and wrinkle around. Also my genitals air and were no farther apart than a foot away some unspecified time in the future. http://jmcabot.com - adult singles dating arcadia kansas looking for milfs in florida

Posted by playdayiterry (not verified) | Apr 26th, 2011 at 6:53 pm

Die Krankenversicherung privat abschliessen.
Den PKV Testsieger finden.
Wie eine Günstige private Krankenversicherung abgeschlossen wird.

Posted by guest (not verified) | Nov 1st, 2011 at 12:20 pm

Interesting articles are published here. By reading it I acquired great deal of knowledge on various subject.
By jumbo playing cards

Posted by jumbo playing cards (not verified) | Jun 14th, 2011 at 12:48 pm

The project will be open source of course and we expect someone will see it and do a commercial product.

Posted by skin tags (not verified) | Aug 21st, 2011 at 8:32 am

Eine Krankenversicherung testen.
Wie die Krankenkasse funktioniert.
Den PKV-Test machen.
Einen Private Krankenversicherung Vergleich machen.

Posted by guest (not verified) | Nov 1st, 2011 at 12:20 pm

Reading this post makes me think about how helpful fluksometer has been to me. Fluksometer helps to monitor, share and reduce electricity consumption. Its great to come across all these posts and learn more about flukso. pelican bay condominiums

Posted by Mel Melhado (not verified) | Nov 18th, 2011 at 11:55 am

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options