-
1Order The PCB
First of all, you should order the PCB.
I'll share the Gerber file in the files section.
-
2Solder All The Parts
After you ordered the parts from the parts list, you should solder them, I suggest you solder the SMD parts first, then the potentiometers, pin headers for Arduino, LM2596, seven-segment pin headers, terminals and fuse pins and rectifier, and lastly the relay sockets.
-
3Programing The Arduino
Now upload the sketch in the next step on the Arduino.
DONT PLACE THE ARDUINO ON THE PCB YET.
-
4Arduino Sketch
#include
#include
#include "math.h"// 7Seg Module connection pins (Digital Pins)
#define CLK 8
#define DIO 7
TM1637Display display(CLK, DIO);const int R[] = {2, 3, 4, 5}; //Rellay output pins
int del[5]; //RonDellay Mapped value
int A[] = {A0, A1}; //potentiometer inputs pinsvoid setup() {
pinMode(A[0], INPUT); //
pinMode(A[1], INPUT); //intializing analog input pinspinMode(R[0], OUTPUT); //
pinMode(R[1], OUTPUT); //
pinMode(R[2], OUTPUT); //
pinMode(R[3], OUTPUT); //
//pinMode(R[4], OUTPUT); //initializing digital output pinsSerial.begin(9600); //running the serial
uint8_t blank[] = { 0x00, 0x00, 0x00, 0x00 };
display.setSegments(blank);}
void loop() {
display.setBrightness(0x0f);
for (int i = 0; i <= 4 4; i++) { a counter wich counts to if (i>= 4) {
i = 0;
}uint8_t blank[] = { 0x00, 0x00, 0x00, 0x00 };
display.setSegments(blank);
int RonDelay = analogRead(A[0]); //reading the analog input [i] --- RonDelay = Rellay On Delay
RonDelay = map(RonDelay, 0, 1023, 0, 1000); //maping the 0 - 1023 value to 1s to 10s to use in delay function
int RoffDelay = analogRead(A[1]); //reading the A[5] analog input --- RoffDelay = Rellay Off Delay
RoffDelay = map(RoffDelay, 0, 1023, 1, 10); //maping the 0 - 1023 value to 1s to 10s to use in delay function
display.showNumberDec((RoffDelay), false, 2, 2);
display.showNumberDec((RonDelay / 100), true, 2, 0); //Display the On Delay on 7Segment
//RonDelay = round(RonDelay); //Rounding the Delay to 0.5
RoffDelay = round(RoffDelay); //Rounding the Delay to 0.5
Serial.println(RonDelay / 100); //printing the measured value
Serial.println(RoffDelay); //printing the measured value
Serial.println(i);digitalWrite(R[i], HIGH); //turning on the [i] rellay depending on the counter value
delay(RonDelay); //keeping the relay on depending on the "RonDelay" integer value
digitalWrite(R[i], LOW); //turning off the [i] rellay depending on the counter value
delay(RoffDelay * 1000); //keeping the relay off depending on the "roffDelay" integer value}
}</=> -
5Test And Troubleshoot The PCB
Now before placing the Arduino on the PCB, you need to connect a 12V-DC (AC will work too but DC is better) to the board, and set the LM2596 output voltage to the 5V-DC. After you did that, place the Arduino in its place and test the board.
-
6Building The Electric Panel
So if you want to build this project for an industrial application, you should build an electrical panel for it.
I won't go for a step-by-step tutorial on how to build that, because that's a whole book to read. but anyway let's do it, if your an expert in this, just skip to step 10.
- Place The Ducts, Rails, And Spacers
- Install The Terminals and Fuses
I used two fuses, one for phase and one for the null, you can skip the null fuse. Then put the terminals on the rails, you'll need:
- 2 phase terminals
- 2 null terminals
- 1 terminal for 24V-DC input
- 5 output terminals
- 5 reserved terminals (you can skip that)
- earth terminals as much as you need
No need to say that you need different color codes for each of these.
- Place the PSU, the JPC, and Start Wiring.
After you placed all the components, you should start the wiring. I used 1mm green wire for phase, 1mm red wire 24V and 12V, 0.5mm black wire for Negative voltages, and 0.25mm blue wire for the null. you don't need to go with these exact numbers and color, 0.5mm wire will work for all of them but make sure to have a good color-coding. Also, make sure to use wire tube crimps for every single wire and number them.
- First, connect the phase and null terminal to the fuses, then from the fuses go to the PSU phase and null terminal.
- Now before connecting the PSU to the board, turn on the PSU and adjust the voltage to about 13V-DC.
- Now takes the output voltage and connect it to the 12V input of the PCB.
- Then you should connect all the relays COM pin to the +24V-DC terminal.
- After that, connect the NO pin of the relays to the output terminals.
- and at the end connect the earth connection to whatever needs and earth.
- Wire The Actuators And Finish It Up
I put this step on you cause it's very different in every situation. but after you id this, you can push the fuses up and turn on the panel.
-
7Adjust the On-Delay and the Off-Delay
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.