About 2 weeks ago I ordered the I/O shield board for the Odroid. It contains digital and analog I/O, and I needed these for the control circuit. Getting the thing to work was no easy task. The documentation is very sparse, the system keeps changing, and seems to assume the user already has a lot of knowledge. So figuring out what I needed to do to get all the pieces to work wasn't easy.
The first part I was able to get function was the digital I/O. This is provided by a SPI I/O expander chip. According to the forums, “Starting with kernel 3.8.19 (of today 27.03.14) i2c-4 is not enabled automatically anymore.” So that required this line “modprobe i2c_gpio_custom bus0=4,200,199”. Once that was done, I was able to follow the example in the thread about the I/O Shield.
# modprobe gpio-pca953x
# echo tca6416 0x20 > /sys/devices/platform/i2c-gpio.4/i2c-4/new_device
# echo 289 > /sys/class/gpio/export
# cd /sys/class/gpio/gpio289
/sys/class/gpio/gpio289# echo "in" > /sys/class/gpio/gpio289/direction
/sys/class/gpio/gpio289# cat direction
/sys/class/gpio/gpio289# cat value
My first test was to change the I/O pin to an output.
echo "out" > /sys/class/gpio/gpio289/direction
After this was done, I could toggle the pin.
echo "1" > /sys/class/gpio/gpio289/value
echo "0" > /sys/class/gpio/gpio289/value
I confirmed with my oscilloscope the pin was changing. I need digital I/O in order to drive the power source select relay, so I decided to build a circuit to switch the relay. This required my relay and a FET, which I quickly wired up on my breadboard. It worked perfectly, and the in signaled the FET which in turn drove the relay.
Getting the analog side of things to work are significantly more tricky, mainly because a lot of assumptions were made in the documentation about how an Arduino works. The biggest problem was I needed to have the Standard Firmata protocol installed on the Arduino chip before any of the examples would work. Once I did this, the digital I/O worked just like it said it was suppose to.
I now have all the I/O I need for the solar project. There is a question of design. Since the Arduino is an external processor, it could do all the averaging for me. In fact, it could handle all of the logic for power management. I want to think about this more before I make a decision. In the end, the Odroid still has to have some kind of driver to talk to the Arduino so it can ask about the power state. I plan on logging solar energy production and system power usage, so there will be some kind of software required for the Odroid to make this happen. What I like about the Arduino is the fact it uses an Atmel processor. I have been using a 32-bit Atmel CPU at work, and rather like it. They are very low power. I did a power check with both the plan Odroid, and the Odroid with the I/O shield. I found my meter doesn't have enough precision to show the additional current draw from the I/O shield. This means the less than 0.1 watts of additional power draw, and I can easily live with that.
The next step is to build the circuit. I am not going to have enough room on the I/O shield board to do this, mainly because the connectors won't fit. So I am going to order an external breadboard I can mount above the I/O shield and build the circuit there. The time is getting close to when I will need to order the solar panel and battery.