SCADBoard 0.0.13 Source Code and SCADuino Primo

The entire SCADBoard 0.0.13 library

/*
  SCADBoard Library & SCADuino
  -------------------------------------------
  3D Printable Breadboard Library in OpenSCAD.

  File: SCADBoard_Lib_0_0_13.scad

  Copyright (c) 2014,  J. Pagliaccio, B. Reidy. All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  By: J. Pagliaccio, B. Reidy

  Version History
  -------------------------------
  v0.0.1 First printed prototype.
  v0.0.2 Wider center line fix.
  v0.0.3 Added ic module.
  v0.0.4 Underwire.
  v0.0.5 LED Module.
  v0.0.6 Better base and cleanup.
  v0.0.7 Parameters for all values.
  v0.0.9 Separate x and y values for each hole for 2-wires-in-a-hole.
  v0.0.10 SCADuino with 2-wire.
  v0.0.11 SCADuino with 2-wire April 2014.
  v0.0.12 SCADuino with 2-wire cleanup 1/2 deep May 2014.
  v0.0.13 Added license and library file.

*/

/* //Start of required variables
//
// THESE VARIABLES ARE REQUIRED
// and are here for reference.
// put them in your main sacd file.
// 

drillHoleRad = 2;
holeDiam = 1.25; // thru hole diameter in mm
holeLenX = holeDiam;
holeLenY = holeDiam;

// if two Wires in One Hole
holeLenY = holeDiam + .9;

holeSpace=2.54; // thru hole spacing in mm
// Nore: .1 inch = .0254 centimeters

// thickness of the board
materialThick = 1.5; //2.54; // mm

// depth of the troughs
inset = materialThick *.5;
deepInset = materialThick *.5; 

// End of required variables
*/

//Start of SCADBoard Library 

pos = "Red";
neg = "Black";
trace = "Orange";
thru = "Gray";
yellowled = "Yellow";
resistor = "Purple";
cap = "Cyan";
led = "Tomato";

blp=1; // Bus Left Pos
bln=2; // Bus Left Neg
a=3;
b=4;
c=5;
d=6;
e=7;
//----- columns 8 9 are the IC centerline
//----- remember columns 8 and 9 are usable
f=10;
g=11;
h=12;
i=13;
j=14;
brp=15; // Bus Right pos
brn=16; // Bus Right neg

//----------------------------------------------------------------------------
// Push Button
//----------------------------------------------------------------------------
module pushbutton(row1, col1, row2, col2, colorx)
{
	hole(row1,col1,thru);
	hole(row1,col2,thru);
	hole(row2,col1,thru);
	hole(row2,col2,thru); 

	translate([row1*holeSpace,col1*holeSpace,materialThick-deepInset])
	color(colorx) cube([holeSpace*(row2-row1)+holeLenX,
	(col2-col1)*holeSpace+holeLenY,5]);
}

//----------------------------------------------------------------------------
// IC - Integrated Circuit
//----------------------------------------------------------------------------
module ic(row1, col1, row2, col2, colorx)
{
	for(n=[row1:1:row2-1])
	{
   		hole(n,e,thru); // ATMEL
   		hole(n,f,thru); // ATMEL
	}
	translate([row1*holeSpace-holeSpace/4,col1*holeSpace,materialThick-inset])
	color("grey") cube([holeSpace*(row2-row1)+holeLenX,
	(col2-col1)*holeSpace+holeLenY,5]);

}	

// ---------------------------------------------------------------------------
// LED - Specifiy the positive hole first
// ---------------------------------------------------------------------------
module led(row1, col1, row2, col2, colorx)
{
	hole(row1,col1,pos);
	hole(row2,col2,neg); 

	translate([row1*holeSpace+(row2-row1)*holeSpace/2+holeLenX/2,
	col1*holeSpace+((col2-col1)*holeSpace)/2+holeLenY/2, materialThick-inset])
	color(colorx) cylinder(h = materialThick*2, r = 6/2);
}

// ---------------------------------------------------------------------------
// HOLE - Thru pin hole for a trace
// ---------------------------------------------------------------------------
module hole(row, col, colorx)
{
	translate([row*holeSpace,col*holeSpace,-materialThick/2])
	color(colorx) cube([holeLenX,holeLenY,materialThick*2]);
}

// ---------------------------------------------------------------------------
// HULLHOLE - This is a hole at the end of the wire inset
// This is used for making the wires with the hull module.
//----------------------------------------------------------------------------
module hullhole(row, col, colorx)
{
	translate([row*holeSpace,col*holeSpace,materialThick/1.5])
	color(colorx)cube([holeLenX,holeLenY,materialThick]);
}

//----------------------------------------------------------------------------
// UNDER HULL HOLE - this should be replaced with hullhole and a new
// depth argument
//----------------------------------------------------------------------------
module underhullhole(row, col, colorx)
{
	translate([row*holeSpace,col*holeSpace,-.5*(materialThick)])
	color(colorx)cube([holeLenX,holeLenY,materialThick/1.25]);
}

//----------------------------------------------------------------------------
// WIRE - A trace form point A to point B
//----------------------------------------------------------------------------
module wire(row1, col1, row2, col2, colorx)
{
	hole(row1,col1,colorx);
	hole(row2,col2,colorx);
	color(colorx)
	hull()
	{
		hullhole(row1,col1,colorx);
		hullhole(row2,col2,colorx);
	}
}

//----------------------------------------------------------------------------
// UNDER WIRE - A trace form point A to point B
//----------------------------------------------------------------------------
module underwire(row1, col1, row2, col2, colorx)
{
	hole(row1,col1,colorx);
	hole(row2,col2,colorx);
	color(colorx)
	hull()
	{
		underhullhole(row1,col1,colorx);
		underhullhole(row2,col2,colorx);
	}
}

//----------------------------------------------------------------------------
// CREATE BASE BOARD
//----------------------------------------------------------------------------
module createboard(rows, colorx){

	pad = 2; // holeSpaces
	x=rows + pad; // rows + 1 + padding
	y=17 + pad; // columns + 1 + padding
   hoff = 1.2; // hole inset from corners  

	color(colorx, 1)

	difference() {
		// the base
		translate([-holeSpace*pad/2,-holeSpace*pad/2,0])
		cube([x*holeSpace+holeLenX,y*holeSpace+holeLenY,materialThick]);

		union() {
			// holes lower left
			translate([hoff,hoff,materialThick])
			cylinder (h = materialThick*2.5, r=drillHoleRad, center = true, $fn=20);
			// lower right
 			translate([holeSpace*x-drillHoleRad*2-hoff,hoff,materialThick])
			cylinder (h = materialThick*2.5, r=drillHoleRad, center = true, $fn=20);
			// upper left
			translate([hoff,holeSpace*y-drillHoleRad*2-hoff,materialThick])
			cylinder (h = materialThick*2.5, r=drillHoleRad, center = true, $fn=20);
			// upper right
			translate([holeSpace*x-drillHoleRad*2-hoff,holeSpace*y-drillHoleRad*2-hoff,materialThick])
			cylinder (h = materialThick*2.5, r=drillHoleRad, center = true, $fn=20);
		}
	}
}

//----------------------------------------------------------------------------
// Standard Breadboard eg: All Holes
//----------------------------------------------------------------------------
module standardBreadboard(x, y)
{
	for(n=[0:1:x])
	{
		for(ii=[0:1:y]) { hole(n,ii); }
	}
}
//End of SCADBoard Library

The SCADuino


/*
  SCADBoard Library & SCADuino
  -------------------------------------------
  3D Printable Breadboard Library in OpenSCAD.

  File: SCADuino_0_0_13.scad

  Copyright (c) 2014,  J. Pagliaccio, B. Reidy. All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  By: J. Pagliaccio, B. Reidy

  Version History
  -------------------------------
  v0.0.1 First printed prototype.
  v0.0.2 Wider center line fix.
  v0.0.3 Added ic module.
  v0.0.4 Underwire.
  v0.0.5 LED Module.
  v0.0.6 Better base and cleanup.
  v0.0.7 Parameters for all values.
  v0.0.9 Separate x and y values for each hole for 2-wires-in-a-hole.
  v0.0.10 SCADuino with 2-wire.
  v0.0.11 SCADuino with 2-wire April 2014.
  v0.0.12 SCADuino with 2-wire cleanup 1/2 deep May 2014.
  v0.0.13 Added license and library file.

*/

// Start of required variables 

drillHoleRad = 2;
holeDiam = 1.25; // the tru-hole diameter in mm
holeLenX = holeDiam;
holeLenY = holeDiam;

// if two Wires in One Hole
holeLenY = holeDiam + .9;

holeSpace=2.54; // The hole spacing in mm
//Note: .1 inch = .0254 centimeters

// Thickness of the board
materialThick = 1.5; //2.54; // for prod - measured in mm

// Depth of the troughs
inset = materialThick *.5;
deepInset = materialThick *.5; 

// End of required variables 

include <SCADBoard_Lib_0_0_13.scad> 

/* 

Specify breadboards locations using standard breadboard
nomenclature of rows and columns, as follows:

•	Specify rows as numbers 1,2,3..
•	Specify columns with lower case letters like a standard breadboard a, b, c …
•	Valid columns are blp, bln, a, b, c, d, e, 8, 9, f, g, h, i, j, brp, brn.
•	blp, bln stand for bus left negative, bus left positive
•	brp, brn stand for bus right positive, bus right negative.
•	Columns 8 and 9 are valid columns. 

*/

// Call the module
// SCADuino1Wire();
SCADuino2Wire();

//----------------------------------------------------------------------------
// 1-wire SCAD + Arduino = SCADUINO
//----------------------------------------------------------------------------
module SCADuino1Wire(){

  difference() {
  //union() {

	union()
	{
		createboard(25, "YellowGreen");
	}
	union()
	{

		// blp bln A B C D E  8 9  F G H I J brp brn
		//------------------------------------------ 

		//--- Start of busses
		// long left vert side buses
		wire(1,bln,22,bln, neg);
		wire(2,blp,22,blp, pos);

		// long right vert side busses
		wire(2,brn,23,brn, neg);
		wire(1,brp,23,brp, pos);

		// cross board bus to bus
		wire(6,blp,6,brp, pos);
	   wire(7,bln,7,brn, neg);

		hole(10,blp,thru); // extra bus holes
		//--- End of busses 

		wire(1,bln,1,e, neg); // Neg left trace to LED
		led(1,e+1, 1,e+2, yellowled); // LED
		wire(1,f, 1,i, pos); // LED Pos
		wire(1,j, 1,brp, resistor); // Resistor

		wire(3,c,3,h, pos); // Cap Pos
		wire(4,c,4,h, neg); // LED Resistor

		hole(3,b,thru); // Power in
		hole(4,b,thru); // Power in

		hole(3,9,thru); // Cap
		hole(4,9,thru); // Cap

		hole(3,h,thru); // 5V Regulator
		hole(4,h,thru); // 5V Regulator
		hole(5,h,thru); // 5V Regulator

		wire(4,h,4,brn, neg); // Power Bus Neg Right
		wire(5,h,5,brp, pos); // Power

		// Power Cap
		hole(6,brp,thru);
		hole(5,brn,thru);

		// Reset Push Button
		pushbutton(8,e,10,f,"Silver");

		wire(8,e,8,bln, neg); // Button
		wire(10,c,10,d, neg); // Button
		wire(10,c,11,c, neg); // Button

		wire(11,blp,11,e, resistor); // Power Bus Neg Right

		// blp bln A B C D E  8 9  F G H I J brp brn
		//------------------------------------------ 

		// TX and RX
		wire(12,b,12,e, resistor);
		wire(13,b,13,e, resistor);

		// ATMEL Processor
		ic(11,e,25,f,neg);

		// Analog Pins
		for(n=[11:1:16])
		{
			hole(n,j,thru);
			wire(n,f,n,i, trace);
		}

		// Left Side
		wire(15,blp,17,e, pos); // ATMEL Mid power 7
		wire(17,bln,18,e, neg); // ATMEL Mid ground 8

		// Little cap 1 and Crystal
		wire(19,bln,19,a, cap);
		hole(19,b,thru);
		wire(19,c,19,e, neg); 

		// Little cap 2 and Crystal
		wire(21,bln,21,a, cap);
		hole(20,d,thru);
		wire(21,c,20,d, neg);
		wire(20,d,20,f, neg);
		wire(21,c,21,bln, neg); 

		// Right side
		wire(17,f,17,brn, neg); // ATMEL 22
		wire(18,f,18,brp, pos); // ATMEL 21
		wire(19,f,19,brp, pos); // ATMEL 20

		// LED pin 13 to ground
		wire(20,f,20,i, led);
		wire(20,j,20,brn, neg);

		// Piezo pin 13 to ground
		wire(21,f,21,i, led);
		wire(21,j,21,brn, neg);

		// ATMEL Analog Pins
		for(n=[23:1:24])
		{
			// Left Side
			hole(n,a,thru);
			wire(n,b,n,e, led);
		}
		// ATMEL Analog Pins
		for(n=[22:1:24])
		{
			// Right Side
			hole(n,j,thru);
			wire(n,f,n,i, led);
		}

	 }
  }
}

//----------------------------------------------------------------------------
// SCADuino with 2 wires per hole for easy assembly
//----------------------------------------------------------------------------
module SCADuino2Wire(){

  difference() {
  //union() {

	union()
	{
		createboard(25, "YellowGreen");
	}
	union()
	{
		// blp bln A B C D E  8 9  F G H I J brp brn
		//------------------------------------------  

		//--- Start of busses
		// long left vert side buses
		wire(1,bln,17,bln, neg);
		wire(2,blp,15,blp, pos);

		// long right vert side busses
		wire(2,brn,23,brn, neg);
		wire(1,brp,23,brp, pos);

		// cross board bus to bus
		wire(6,blp,6,brp, pos);
	   wire(7,bln,7,brn, neg);

		hole(10,blp,thru); // extra bus holes

		// Left side bus jogggle for caps
		wire(17,blp,22,blp, neg);

		//--- End of busses 

		// Top LED section
		wire(1,bln,1,8, neg); // Neg left leed to LED
		led(1,8,1,9, yellowled); // LED
		wire(1,9,1,brp, resistor); // Resistor

		// Start of power section
		hole(3,b,thru); // Power in holes
		hole(4,b,thru); // Power in holes

		wire(3,c,3,h, pos); // Power pos wire to regulator
		wire(4,c,4,h, neg); // Power neg wire to regulator 

		hole(3,f, cap); // Cap pos
		hole(4,f, cap); // Cap neg

		hole(3,h,pos); // 5V Regulator
		hole(4,h,neg); // 5V Regulator
		hole(5,h,pos); // 5V Regulator

		wire(4,h,4,brn, neg); // Power Bus Neg Right
		wire(5,h,5,brp, pos); // Power

		// Power Cap
		hole(2,brp,cap);
		hole(2,brn,cap);
		hole(3,brp,cap); // extra hole
		hole(3,brn,cap); // extra hole 

		// End of power section 

		// Reset Push Button
		pushbutton(8,e,10,f,"Silver");

		wire(8,bln,8,e, neg); // button Neg
		wire(10,c,10,e, pos); // button Pos
		wire(10,c,11,c, pos); // Button pos to pin 1 

		// blp bln A B C D E 8 9 F G H I J brp brn
		//------------------------------------------  

		// ATMEL ATmega328 Processor
		ic(11,e,25,f,neg);

		wire(11,blp,11,e, pos); // Power Bus Neg Right

		// TX and RX
		wire(12,b,12,e, resistor);
		wire(13,b,13,e, resistor);

		// ATMEL Analog Pins 0-5 Right
		for(n=[11:1:16])
		{
			hole(n,i,thru);
			wire(n,f,n,j, trace);
		}

		// Left Side mid side power and ground
		wire(15,blp,17,e, pos); // ATMEL Power 7 mid
		wire(17,bln,18,e, neg); // ATMEL Power 8 mid

		// Left Little cap 1 and Crystal
		wire(19,blp,19,b, cap); // to the joggle
		hole(19,bln,cap); // to the joggle
		wire(19,b,19,e, neg);

		// Little cap 2 and Crystal
		wire(21,blp,21,b, cap); // to the joggle
		hole(21,bln,cap); // to the joggle
		wire(21,b,20,e, neg);

		// Right side
		wire(17,f,17,brn, neg); // ATMEL
		wire(18,f,18,brp, pos); // ATMEL
		wire(19,f,19,brp, pos); // ATMEL

		// LED pin 13 to ground
		wire(20,f,20,i, led);
		wire(20,j,20,brn, neg);

		// Piezo pin 13 to ground
		wire(21,f,21,i, led);
		wire(21,j,21,brn, neg);

		//underwire(9,bln,17,bln, neg);

		wire(18,brn,19,brn, neg);

		// blp bln A B C D E 8 9 F G H I J brp brn
		//------------------------------------------  

		// ATMEL Pins Left
		for(n=[23:1:24])
		{
			// Left Side
			hole(n,a,thru);
			wire(n,b,n,e, led);
		}

		// ATMEL Pins Right
		for(n=[22:1:24])
		{
			// Right Side
			hole(n,h,thru);
			wire(n,f,n,j, led);
		}
	 }
  }
}

Copyright (c) 2014, J. Pagliaccio, B. Reidy. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this condition and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s