Components and modules used:
- Arduino Pro Mini - 5V, 328, 16Mhz
- IBT_2 Motor Controller - 5V, 43A
- SPST momentary pushbutton switches
- 10K ohm through-hole 1/4 watt resistors
- LM7805 voltage regulator
- 50V, 10uf capacitors
- 2 layer PCB
- Hobby motor for testing purposes
Intent of the project: Create a PCB that utilizes logic level momentary switches to replace 30A SPDT rocker switches to save space and eliminate bulky 12 gauge wiring.
The 30A switches control scissor jacks mounted to a platform. The power source for the jacks is a 12V marine battery.
The IBT_2 motor driver is controlled by the Arduino Pro Mini and the momentary switches.
There are 8 SPST pushbutton momentary switches used in pairs. Each pair uses one switch for forward and one for reverse.
Issues: I designed a PCB and had 5 boards printed. They do not work as expected. I realize that I did this early but with the intention of working out the bugs in practice rather than in theory. The schematic attached here shows what I sent out for production.
The circuit and the code together both work when I wire everything on a breadboard but not on the PCB. I have tested the PCB with the Arduino 'Button' example available in the examples on the IDE and it works for each pin attached to each button. I have also enabled and disable pull-up resistors in the code and have had the same results.
I have my suspicions that there is something very basic here that I don't understand.
Maybe the LM7805 circuit doesn't need to be incorporated here since there is on-board regulation with the Pro Mini but I put it in because I will need to have it eventually. I don't know so I am asking if anybody can lend some help. Thank you for reading.
/*
IBT-2 Motor Control Board driven by Arduino.
Speed and direction controlled by a potentiometer attached to analog input 0.
One side pin of the potentiometer (either one) to ground; the other side pin to +5V
Connection to the IBT-2 board:
IBT-2 pin 1 (RPWM) to Arduino pin 5(PWM)
IBT-2 pin 2 (LPWM) to Arduino pin 6(PWM)
IBT-2 pins 3 (R_EN), 4 (L_EN), 7 (VCC) to Arduino 5V pin
IBT-2 pin 8 (GND) to Arduino GND
IBT-2 pins 5 (R_IS) and 6 (L_IS) not connected
*/
int rbutton = 11; // right turn button
int lbutton = 12; // left turn button
int goRight = 5; // Arduino PWM output pin 5; connect to IBT-2 pin 1 (RPWM)
int goLeft = 6; // Arduino PWM output pin 6; connect to IBT-2 pin 2 (LPWM)
void setup()
{
pinMode(goRight, OUTPUT);
pinMode(goLeft, OUTPUT);
pinMode (rbutton, INPUT);//removed INPUT_PULLUP
pinMode (lbutton, INPUT);//removed INPUT_PULLUP
}
void loop()
{
int rbuttonValue = digitalRead(rbutton);
int lbuttonValue = digitalRead(lbutton);
if (rbuttonValue == HIGH);
{
// reverse rotation
int forward = (rbuttonValue == HIGH);
digitalWrite(goRight, forward);
digitalWrite(goLeft, LOW);
}
if (lbuttonValue == HIGH);
{
// forward rotation
int reverse = (lbuttonValue == HIGH);
digitalWrite(goLeft, reverse);
digitalWrite(goRight, LOW);
}
//delay (100);
}
switchBoard.pdf (101 KB)

