Advice on Transferring to a Solder-able Breadboard

Hello!

So I have my solderless breadboard circuit up and running how I want, I just was wondering if there was any programs that might be able to take my breadboard circuit and put into solderable breadboard layout?
I’ve attempted to transfer the circuit but I know something is connected incorrectly because the “Reset button” resets the board correctly, but every time I press it both the void Ultrasonic and void Photocell automatically turn on.

Note: The solderable breadboards I’m using dont have connected rails like the solderless ones do…

Any guidance on how to wire this correctly would be really appreciated!

#include <NewPing.h>

#define TRIGGER_PIN  10                              // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     9                           // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200                            // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.

const byte  buttonPin[] = {A15, A14, A13, A12};    // button pins in array
const byte  ForwardPin = 12;
const byte  ReversePin = 11;

//Variables for Button Push Counter
int myCounter = 0;                                         //declare your variable myCounter and set to 0

//Constants for Photocell
const byte pResistor [3] = { A0, A1, A2 };                 // Photoresistor at Arduino analog pins

//Variables for Photocells
int SensorValue1;
int SensorValue2;
int SensorValue3;                                          // Store value from photoresistor (0-1023)

// Variables will change:
int buttonState[] = {0, 0, 0, 0};      // current state of the button1
int lastButtonState[] = {0, 0, 0, 0};  // previous state of the button1
int buttonPushCounter[] = {0, 0, 0, 0};

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin[0], INPUT);
  pinMode(buttonPin[1], INPUT);
  pinMode(buttonPin[2], INPUT);
  pinMode(buttonPin[3], INPUT);
  pinMode(buttonPin[4], INPUT);
  pinMode(pResistor[0], INPUT);
  pinMode(pResistor[1], INPUT);
  pinMode(pResistor[2], INPUT);

  // initialize the LED as an output:
  pinMode(ForwardPin, OUTPUT);
  pinMode(ReversePin, OUTPUT);


  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
  // read the pushbutton input pin:
  buttonState[0] = digitalRead(buttonPin[0]);
  buttonState[1] = digitalRead(buttonPin[1]);
  buttonState[2] = digitalRead(buttonPin[2]);
  buttonState[3] = digitalRead(buttonPin[3]);

  if (buttonState[0] != lastButtonState[0]) {
    if (buttonState[0] == HIGH) {
      buttonPushCounter[0]++;
      Serial.println(buttonPushCounter[0]);
    }
    delay(10);
  }
  if (buttonState[1] != lastButtonState[1]) {
    if (buttonState[1] == HIGH) {
      buttonPushCounter[1]++;
      Serial.print("Forward On");
      Serial.println(buttonPushCounter[1]);
    }
    delay(10);
  }
  if (buttonState[2] != lastButtonState[2]) {
    if (buttonState[2] == HIGH) {
      buttonPushCounter[2]++;
      Serial.print("Reverse On");
      Serial.println(buttonPushCounter[2]);
    }
    delay(10);
  }
  if (buttonState[3] != lastButtonState[3]) {
    if (buttonState[3] == HIGH) {
      buttonPushCounter[3]++;
      Serial.println(buttonPushCounter[3]);
    }
    delay(10);
  }

  lastButtonState[0] = buttonState[0];                    // save the current state as the last state, for next time through the loop
  lastButtonState[1] = buttonState[1];
  lastButtonState[2] = buttonState[2];
  lastButtonState[3] = buttonState[3];

  if (buttonPushCounter[0] % 2 == 0) {
    MotorForwardCode();
  }
  if (buttonPushCounter[1] % 2 == 0) {
    MotorReverseCode();
  }
  if (buttonPushCounter[2] % 2 == 0) {
    PhotoCellCode();
  }
  if (buttonPushCounter[3] % 2 == 0) {
   UltrasonicCode();
  }
  else {
    digitalWrite(ForwardPin, LOW);
    digitalWrite(ReversePin, LOW);
    
  } 
}
void MotorForwardCode() {
  digitalWrite(ForwardPin, HIGH);
}
void MotorReverseCode() {
  digitalWrite(ReversePin, HIGH);
}
void PhotoCellCode() {
  SensorValue1 = analogRead(pResistor[0]);                  //get the value from input pin 1
  SensorValue2 = analogRead(pResistor[1]);
  SensorValue3 = analogRead(pResistor[2]);

  if (SensorValue1 < 15 && SensorValue2 < 300) {           //if two are dark turn motor off
    digitalWrite(ForwardPin, LOW);
    digitalWrite(ReversePin, LOW);                                                                          // stop reverse
  }
  else if (SensorValue1 < 15 && SensorValue3 < 25) {
    digitalWrite(ForwardPin, LOW);
    digitalWrite(ReversePin, LOW);                                                                          // stop reverse
  }
  else if (SensorValue2 < 200 && SensorValue3 < 25) {
    digitalWrite(ForwardPin, LOW);
    digitalWrite(ReversePin, LOW);                                                                          // stop reverse
  }
  else {
    digitalWrite(ForwardPin, HIGH);                                                                         //else, keep the motor on
  }

  Serial.print(SensorValue1);
  Serial.print(",");
  Serial.print(SensorValue2);
  Serial.print(",");
  Serial.println(SensorValue3);
}
void UltrasonicCode() {
  delay(29);                     // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
  Serial.print("Ping: ");
  Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
  Serial.println("cm");

  if (sonar.ping_cm() <= 10) {
    digitalWrite(ForwardPin, LOW);
  }
  else {
    digitalWrite(ForwardPin, HIGH);
  }

And Here’s my circuit:
Imgur

I think you will just need to take some time and follow the signals and lern what each part is doing. You are lucky because in your circuit you have colors. Most circuit diagrams don't. :slight_smile:

In your circuit for instance all the black ones are Ground and need to be connected together and then they need to be connected to the Ground/GND on the Arduino. So there are missing connections.

The same is true for the VCC/3V3. All the red ones need to be connected together and then to your boards supply voltage. But make sure the total amount of power does not exceed the capabilty of the board.

Do I understand you corectly you want to move all components on a trough hole breadboard and solder them onto it?

You can ether place the components onto the board and then figure out how to connect them on the fly or use some paper and draw with color pens to do the layout first. This process is easiest when you try to wire in one direction on the top and in a right angle to that at the bottom.

Make sure your lastbuttonstates are initialized properly in setup().
ex:
lastButtonState[0] = digitalRead(buttonPin[0]);
etc.

Some wires are missing.

Show us your soldered PCB circuit.

BTW, update lastButtonState’s only when there is a change in state.

Both Adafruit and Sparkfun sell solder boards that match the layout for a standard breadboard.

The Adafruit ones look a bit nicer. Then you can just duplicate your breadboard. If you are using IC chips best best to get some holders for the chips and solder the holders to the circuit board then drop the chip in the holder, less chance of messing up the chip.

My advice is "Don't."

Once you have checked the concept on solderless breadboard, design a custom PCB. You can get several copies (several screwups) of small boards for under $5 USD. Delivery can be quick too.

Of course you may make a screwup in the design and every copy is useless but it is fixable for another $5 and now you have some cool drink coasters to give away. (Although the usual size for a coaster will be a more expensive PCB.)

I use these frequently:

https://www.ebay.com/itm/10x-DIY-Prototype-Paper-PCB-Experiment-Board-Bakelite-Circuit-Board-4-8x13-3cm/112951198754

They don't match standard breadboards exactly, but are close enough. At 55 cents each, it's cheaper and more convenient to use these instead of getting a board made and shipped.

The Adafruit boards are almost the same price when bought in lots of 3 and do match the breadboard dimensions and the rows and columns are numbered to make finding the correct hole easier

https://www.adafruit.com/category/124

saildude:
The Adafruit boards are almost the same price when bought in lots of 3 and do match the breadboard dimensions and the rows and columns are numbered to make finding the correct hole easier

Breadboards & Protoboards Products Category on Adafruit Industries

The Ebay boards are $5.51 for ten, or $.55 each. The Adafruits are $19.95 for three.

ShermanP:
The Ebay boards are 5.51 for ten, or .55 each. The Adafruits are $19.95 for three.

Sorry I just looked at the ebay link and it shows 5.51 each for singles and I don't see pricing for 10 pack - a 3 pack is 5.23 each or $ 15.69 for a 3 pack - and the ebay boards are smaller so you get less - the smaller may or may not be important - I use a smaller Adafruit board for smaller projects

saildude:
Sorry I just looked at the ebay link and it shows $ 5.51 each for singles and I don't see pricing for 10 pack - a 3 pack is $ 5.23 each or $ 15.69 for a 3 pack - and the ebay boards are smaller so you get less - the smaller may or may not be important - I use a smaller Adafruit board for smaller projects

The link goes to the page:

“10x DIY Prototype Paper PCB Experiment Board Bakelite Circuit Board 4.8x13.3cm”

10x :wink:

I think user DrAzzy offers some nice boards too.

I got so tired of trying to move my projects from breadboards to solder perf boards that I learned to use Eagle to design my PCBs using Eagle (free version) and JLCPCB to make a few boards. (5 boards for $2 +$5.24 postage =$7.24).

Best move I've made, and my projects look so much more professional now.

SteveMann:
I got so tired of trying to move my projects from breadboards to solder perf boards that I learned to use Eagle to design my PCBs using Eagle (free version) and JLCPCB to make a few boards. (5 boards for $2 +$5.24 postage =$7.24).

Best move I've made, and my projects look so much more professional now.

“Best move I've made, ”

Second best here, best was marrying my wife. :wink:

Sorry - I stand corrected on the ebay link - I found the page pricing confusing