Hallo
My problem may be a little bit hard to solve, but I really do not understand the problem at all. I have the following circuit which you can see in the picture.
I have added a kapacitor from emitter to Ground and flyback diode from emitter to Ground. The idea is to have a signal useing serial communication from a computer runnning into the RX line on 16 different Arduinos. The 16 Arduinos should be able to control a TIP122 transistor which then should be able to activate a solenoid actuator. The Arduinos have the following code on them
//Hent Midi Library
#include <MIDI.h>
//Åben et standart MIDI objekt
MIDI_CREATE_DEFAULT_INSTANCE();
// -----------------------------------------------------------------------------
// Pinouts til aktuatorne
#define GPIO0 5
#define GPIO1 6
#define GPIO2 9
#define GPIO3 10
#define GPIO4 11
#define GPIO5 3
// -----------------------------------------------------------------------------
//Unit id
const int unitIndex = 9 ;
void setup()
{
MIDI.begin(); // Start MIDI, standard på kanal 1
Serial.begin(115200); //Start Serial komunikation
//Sæt punouts til output
pinMode(GPIO0, OUTPUT);
pinMode(GPIO1, OUTPUT);
pinMode(GPIO2, OUTPUT);
pinMode(GPIO3, OUTPUT);
pinMode(GPIO4, OUTPUT);
pinMode(GPIO5, OUTPUT);
}
void loop()
{
if (MIDI.read()) //Check om der kan læses en MIDI Komando
{
//Hvis Midi komandoen er NOTEON Læses data
if (MIDI.getType() == midi::NoteOn) {
//Hvis Data 1 stemmer overens med de tildelte pins skrives et analogt output der svarer til værdien af data 2
switch (MIDI.getData1()) {
case (21 + unitIndex * 6):
analogWrite(GPIO0, MIDI.getData2() * 0.666 + 170.34);
break;
case (22 + unitIndex * 6):
analogWrite(GPIO1, MIDI.getData2() * 0.666 + 170.34);
break;
case (23 + unitIndex * 6):
analogWrite(GPIO2, MIDI.getData2() * 0.666 + 170.34);
break;
case (24 + unitIndex * 6):
analogWrite(GPIO3, MIDI.getData2() * 0.666 + 170.34);
break;
case (25 + unitIndex * 6):
analogWrite(GPIO4, MIDI.getData2() * 0.666 + 170.34);
break;
case (26 + unitIndex * 6):
analogWrite(GPIO5, MIDI.getData2() * 0.666 + 170.34);
break;
}
//Hvis Midi komandoen er NOTEOFF Læses Data
} else if (MIDI.getType () == midi::NoteOff) {
//Hvis Data 1 stemmer overens med de tildelte pins slukkes den pågelende pin
switch (MIDI.getData1()) {
case (21 + unitIndex * 6):
analogWrite(GPIO0, 0);
break;
case (22 + unitIndex * 6):
analogWrite(GPIO1, 0);
break;
case (23 + unitIndex * 6):
analogWrite(GPIO2, 0);
break;
case (24 + unitIndex * 6):
analogWrite(GPIO3, 0);
break;
case (25 + unitIndex * 6):
analogWrite(GPIO4, 0);
break;
case (26 + unitIndex * 6):
analogWrite(GPIO5, 0);
break;
}
}
}
}
I have 16 of the circuits on 16 PCB's with code. The PCB's are chained with RST, 5V and RX via screw terminals. A picture of the PCB can be seen below
The arduino chained can be seen below
My problem is the following. I am able to connect one PCB and control the actuator with 12 V connected to the PCB via a separat cobber line on the PCB. But when i connect two or more PCB's together then i am unable to control the arduino. I can see that the LED's activate, but not in the order that i tell them to. It seems random. When i disconnect 12 V then everything works fine. I can connect all of them and they work fine, but the second i connect 12 V to the circuits then it does not work. None of the components get destroyed when placed in the PCB and 12 V is connected.


