@ebclr: Are you deliberately trolling? WTF would R.Pi need to use Programmer to Go mode for?
@R.Pi,
I hadn't spotted the Velleman board has a 12V power in, with a 7805 regulator. Yes it should be entirely satisfactory to power the Arduino from the +5V on Vdd (pin 1) of the PIC socket. PIC Vss (pin 20) needs to connect to Arduino Gnd. You should put a 200mA polyfuse between Vdd and the Arduino +5V to save your bacon if you accidentally short any Arduino pins. If you wire it that way, and don't plug +12V into the K8090, the buttons and LEDs will work if the Arduino has USB or external power, but the relays will be disabled - useful for testing.
Velleman kit manuals are generally crap and usually don't cover the theory. Page 10 of the
K8090 'Parts List' has the schematic - it tells you all you need to know but you have to work it out.
First lets consider the buttons. Each button connects to ground and has a 1K pullup. The buttons are connected together in two banks of four, by a
R-2R resistor ladder DAC. Switches 1-4 connect to PIC AN10 (Pin 13) and 5-8 to AN11 (Pin 12). The buttons have an equivalent source impedance as seen by the ADC of 100K - this is a bit on the high side for the Arduino ADC so a 0.047uF cap to ground on each of the two analog inputs used by the switches would be a good idea to prevent random noisepickup giving you phantom button pushes. Avoid using Arduino pins A4 or A5 as the Arduino will need them to talk to I2C devices like a RTC module.
Just like an Arduino, the PIC has a 10 bit ADC converter, so to read the switches the Velleman firmware must be doing an ADC conversion for each bank and throwing away the bottom 6 bits. In Arduino code this would be:
switches=((analogRead(Sw5to8pin)+32)>>6)|(((analogRead(Sw1to4pin)+32)>>2)&0xF0);
The +32 is for rounding - to make the decision point between two adjacent switch combo voltages half way between them. The >>6 lops off the low 6 bits for the first four switches. The >>2)&0xF0 also lops off the low 6 bits for the last four switches, but leaves the result four bits higher so it can be combined to make a single byte for all the switches.
You'd then extract the state of a particular switch with the expression
!(switches&(1<<(n-1)))
which for n=1 to 8 will give you 1 if the corresponding switch is pressed, otherwise 0.
The relays are on pins:
Skt PIC I/O Description
16 - RC0 - relay 1
15 - RC1 - relay 2
14 - RC2 - relay 3
7 - RC3 - relay 4
6 - RC4 - relay 5
5 - RC5 - relay 6
8 - RC6 - relay 7
9 - RC7 - relay 8
Logic 1 = ON, logic 0 = OFF. Simply connect them to eight Arduino digital pins in order, and NOT using 0 or 1 as they are needed for the Arduino UART and control them with digitalWrite(n,level). They have series 1K resistors feeding into red LEDs and NPN transistor bases so they will about 2mA to 3mA from the I/O pin when on, easily within the Arduino's capabilities.
If you want to check my conclusions, with the PIC removed, jumper pin 1 to any of the relay pin numbers (Skt) to turn that relay on, and hook a DMM on volts between pin 12 or 13 and pin 20 to see how the voltage changes as you press various combos of four buttons.