I have looked but cannot find an answer I can understand.
I have a raspberry pi B and I have an Arduino Uno.
How do I make my own emonpi?
I have the ct’s, I have made the input circuit and the Uno is reading the CT and VT inputs.
The bit that I do not understand is connecting the raspberry and the uno.
You need to connect the serial output of the Uno to the serial input of the RPi, in exactly the same way as we recommend making the direct serial connection between the emonTx and the emonBase in the Wiki: EmonTx V3.4 - OpenEnergyMonitor Wiki
(Note that the emonTx pins are not labelled conventionally - the crossover from Tx to Rx is done on-board, so the connector pin labelled TXD is looking for the Tx line, likewise the Rx.)
The bit that worries me the most is 5V and 3.3V. I read that the Raspberry and the uno run at different voltages?
Can I power the Uno from the raspberry - 5V or 3.3V?
Can I power the Uno from the Raspberry USB port? And send the data via USB?
As far as I know, that’s correct. I’m not an Arduino expert and I keep forgetting that all that stuff runs at 5 V. And as far as I know, the RPi only has 5 V on it as far as the power regulator, so 5 V should be available at the USB ports (you might like to read up on the spec. sheet to confirm this).
But the I/O is not 5 V capable. If you stay with the serial connection, then you must use a pair of resistors as a voltage divider to reduce the 5 V Tx line from the Uno to the RPi (look at the circuit diagram of the emonTx Shield for resistor values: GitHub - openenergymonitor/emontx-shield: emonTx Arduino Shield), but the signal going the other way - if you even need it, from the RPi to the Uno - should be OK.
3v3 Power at Raspberry Pi GPIO Pinout says the 3v3 line is capable of ~500 mA on Pi B+
and subsequent models. The first generation of Pis had a linear regulator on the 3v3 line.
Starting with the B+, the linear regulator was replaced by a dual switching mode regulator.
More info here: Power Supply | Introducing the Raspberry Pi Model B+ | Adafruit Learning System
Ahh - so I can power it from the 5V and just reduce the I/O voltage.
And then how do I setup the emoncms software to read the serial data. Or is that the easy part.
There are so many components involved in this my head is spinning!
Thanks for the help.
There’s a link to that on the page I pointed you to earlier.
If you are more comfy with that you can do so, the address you need to use in emonhub will be
/dev/ttyACM0 (assuming this is the first/only arduino connected) instead of the usual
/dev/ttyAMA0. The arduino will then get it’s supply via the usb to, this can be “iffy” on the Arduino, but the Pi’s have particularly stable 5v rails so less of an issue.
Yes, but as Robert has pointed out, it’s only the 5v tx line from the Uno to the 3.3v rx line of the Pi that needs reducing, so a voltage divider (2 resisters) is adequate.
That depends on your sketch in the Uno. Yes it’s pretty easy if your Uno is outputting either space separated variables or key:value pairs at each update. emonhub can take either, you just need make the sketch match for the easiest solution.
You guys make it sound so simple.