The code I have been developing for my Current Cost meter updating to Pachube via Arduino with XPORT is ready for sharing.
You can download the code from this link.
Current cost sensors are
0) Main electricity sensor – clamp on incoming live cable
1) Gas pulse sensor – see entry below
2) light sensor – photo resistor (about 2M ohms dark to 100 ohms bright light) as sensor across the channel inputs on the Current Cost dev board.
Current Cost sensors are read by Arduino, displayed on 4×20 lcd module and uploaded to Pachube via Adafruit XPort shield every 15 minutes.
Succeeded today in remote wireless programming a Funnel IO Arduino clone.
I had previously followed the instructions from LadyAda and got a very flaky program load – particularly with large files. Now following the Funnel IO route I have a reliable and solid way of remotely programming the board. I am using the Arduino IDE to upload the code. This also works well with direct use of avrdude.
The secret lies in the XBee configuration – this works for me.
| Command |
Coordinator (i.e. a PC side) |
End device (i.e. a FIO side) |
| ATRE – Reset to defaults |
| ATBD |
4 |
4 |
| ATID |
1234 |
1234 |
| ATMY |
0 |
1 |
| ATDL |
FFFF |
0 |
| ATD3 |
3 |
5 |
| ATIC |
8 |
- |
| ATIU |
- |
0 |
| ATIA |
- |
FFFF |
| ATRR |
3 |
- |
| ATRO |
10 |
10 |
| ATWR – Write the changes |
| ATCN – Exit command mode |
I think the main difference from my first attempts lies in the destination address (ATDL). I will test further to see what is needed – also how well this works for other Arduino types.
When the switch opens the falling edge will cause a negative pulse on the 4013 input. The diode removes that negative pulse.
Input to 4013 without diode – one pulse (on/off) – zero volts is the centre line. The signal goes negative to minus 1.44 volts. Positive pulse comes from direct connection to +3 volts, negative pulse is smaller because capacitor has to discharge through 1M resistor.
Input to 4013 with the diode – the negative signal is almost totally removed. The signal goes negative to minus 0.35 volts.
Here is the final circuit I will use, the resistor and capacitor values give a time constant of about 0.5 sec – I’m sure many other values would work but I have these ones in my box.
I have added a pull down resistor on the reset line just to make sure it is low unless deliberately raised high. I will build this over the weekend.
@MartinDix from CurrentCost kindly sent me a dev board so I could interface other feeds to the CurrentCost meter. After some experimentation this is the circuit I intend to use. I have not yet fully finalised values of components but it seems to work pretty well on the breadboard. Note my dev board is version 1.1, the positive connection to ch1 is connected to positive power line.
The idea of the circuit is that a rising edge (start of pulse) is latched until it has been transmitted to the meter.
Purchased a Current Cost CC128 meter and it arrived yesterday. No problem getting it going and it is now connected to an Arduino with a XPORT Ethernet shield. I got NewSoftSerial reading from the CC128 at 57600 baud and controlling the XPORT at 19200 baud. I am logging the temperature and watts usage to Pachube every 30 seconds.


I got a photo published! Schmap have included one of my Barry Island pictures on their interactive guide.