I built a quad-copter (That’s for another post!) and bought a cheap chinese 6 channel TX.
It sucks (The TX that is).
I built my own TX from scratch using a 2.4ghz plugin RF module designed for converting 35mghz transmitters into 2.4ghz versions.
The base of the TX is a PS2 pad, the vibration motors were removed and the control chip desoldered. An AVR was installed in one of the “arms” of the pad where the motor was removed from.
The two sticks were connected directly to ADC0-ADC3 on the AVR.
It turns out the pad had “analogue” buttons and these were not good enough to trigger the digital inputs on the AVR. The solution was to fit 4 small micro-buttons behind the shoulder triggers to provide a good action. The top buttons were ignored.
These 4 buttons trigger the “aux” channels, sending a value around 1500 when off and 2000 when pressed. This allows me to trigger options on my quad.
To power the whole thing a small 500mah 3.7 lipo was fitted inside the radio TX module and a 3v to 5v step up adaptor fitted inside the pad. A lipo charger with mini-USB connector was fitted near the old cable outlet.
The LiPo charger outputs 100ma, so 5 hours to fully charge the battery, while the step up converter is capable of 500ma max, so 1 hours maximum run time.
I have yet to do a test to see how long it works in actual usage, but I expect more like 2 hours+ in normal use.
The code to generate the ppm signal is from an open source project called Funkenschlag by a friend from IRC.
So, after google killed the Google PowerMeter api I got the incentive to finish my own project using it. Odd huh.
I wrote loads of code to hook into the google API ages ago, but never got the hardware setup. Now After Google announce the death of the API I finally cracked the last part of my hardware issues and have live power monitoring of my electricity meter.
The key difference to most here is that its NOT a clamp type sensor. It counts rotations of the meter disc itself. It is therefor accurate and matches exactly what I will be charged for.
There are three parts,
1> Pic (UBW board) with IR reflectance sensor
2> Moxa Serial to Ethernet convertor
3> Database server
The Pic board counts rotations of the disc in 1 minute increments. Every ten minutes it connects to the server over serial (to ethernet UDP) and uploads all ten readings
The server saves these into a mysql database.
I wrote some PHP code to generate graphs of various data, this is proving to be the hardest part. Getting the data to look good.
Please excuse the awfull graph but I shrank it to make it fit nicely in the blog post, in the full version you get it nicely labelled and some extra info like average KW/h and total KW/h for the time period selected.
The biggest problem is the jaggedy graph, this is a side effect of the fact I count rotations per minute. Rather than time each rotation. Because the average rpm is low I only get about 1 rotation each 30 seconds. So its very easy to get a reading of 1 followed by 2 by 1 by 2 etc as that second rotation moves slightly back and forth over the 60 second boundry.
I am looking at ways to smooth this out without distorting the data too much.
I used the PIC UBW board because the USB port allowed me to compile code and program the pic in <30 seconds without unplugging anything. The serial to ethernet converter remained connected to the serial port so my development cycle was quite fast for the PIC code.
I did some simple software debounce of the IR sensor (just in case) but it doesn't seem to be needed.
The end result is completely non-invasive to the meter (yes, in the pic you can also see my OWL clip on sensor, this is not part of the new system and only runs a small LCD by my PC).
The next step is to find a sensor that will trigger from the gas meter and allow me to monitor that too. They are close together so the hope is I can use another input on the same PIC and upload both sets of readings at the same time.
This graph has allowed me to identify individual appliances by time and watch their power use, with a little more detailed study I will eventualy work out the power profile for each device and possibly predict when each one is turned on and off purely from the graph data! I can spot my fridge, my oven and washing machine already.