Browse Source

add 3d model for remote, antenna, i2c lcd and cc2500

design top plate in order to place the boards
master
Schoenberger, Philipp 6 years ago
parent
commit
0c847ab628
No known key found for this signature in database GPG Key ID: 8AC1B34784DD0AB
  1. 693
      3d/lib/Arduino_nano.scad
  2. 188
      3d/lib/Capacitors.scad
  3. 173
      3d/lib/Diode.scad
  4. 65
      3d/lib/Dupont_connector_female.scad
  5. 276
      3d/lib/I2C_interface_LCD1602.scad
  6. 160
      3d/lib/IC_DIP.scad
  7. 161
      3d/lib/IC_TO220.scad
  8. 94
      3d/lib/IC_TO92.scad
  9. 180
      3d/lib/LCD_1602_I2C.scad
  10. 179
      3d/lib/LCD_1602_Serial.scad
  11. 164
      3d/lib/LDR.scad
  12. 459
      3d/lib/Led.scad
  13. 374
      3d/lib/Micro_push_button.scad
  14. 159
      3d/lib/OLED_13_128_64.scad
  15. 82
      3d/lib/PCB.scad
  16. 335
      3d/lib/Pin_header.scad
  17. 540
      3d/lib/Resistor.scad
  18. 51
      3d/lib/Screw_terminal.scad
  19. 64
      3d/lib/Solder.scad
  20. 31
      3d/lib/aligned_cube.scad
  21. 53
      3d/lib/antenna.scad
  22. 141
      3d/lib/cube.scad
  23. 14
      3d/lib/cylinder.scad
  24. 101
      3d/lib/example.scad
  25. 526
      3d/remote.scad
  26. 106
      3d/stick.scad

693
3d/lib/Arduino_nano.scad

@ -0,0 +1,693 @@
$fn=36;
//0=false 1=true
Connection_pins_enabled=1;
Connection_pins_up=0;
6_pins_enabled=0;
6_pins_up=0;
module Pins(Pins_number,Offset)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([0,2.54*a,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,2.54*a,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([0,2.54*a,-2])
Component(2,2,1.25);
if(a==0)
{
Text="D12";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==1)
{
Text="D11";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==2)
{
Text="D10";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==3)
{
Text="D9";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==4)
{
Text="D8";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==5)
{
Text="D7";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==6)
{
Text="D6";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==7)
{
Text="D5";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==8)
{
Text="D4";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==9)
{
Text="D3";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==10)
{
Text="D2";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==11)
{
Text="GND";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==12)
{
Text="RST";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==13)
{
Text="RX0";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==14)
{
Text="TX1";
%color("Black")
translate([1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
}
}
module Pins1(Pins_number,Offset)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([0,2.54*a,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,2.54*a,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([0,2.54*a,-2])
Component(2,2,1.25);
if(a==0)
{
Text="D13";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==1)
{
Text="3V3";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==2)
{
Text="REF";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==3)
{
Text="A0";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==4)
{
Text="A1";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==5)
{
Text="A2";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==6)
{
Text="A3";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==7)
{
Text="A4";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==8)
{
Text="A5";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==9)
{
Text="A6";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==10)
{
Text="A7";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==11)
{
Text="5V";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==12)
{
Text="RST";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==13)
{
Text="GND";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
if(a==14)
{
Text="VIN";
%color("Black")
translate([-1.75,2.54*a,0])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=0.8,valign="center",halign="center");
}
}
}
module Pins_holes(Pins_number)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,-3])
cylinder(r=0.55,h=10,center=true);
}
}
module Pins_copper_rings(Pins_number)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,-3])
cylinder(r=1,h=1.6,center=true);
}
}
module 6_pins(Pins_number)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([1.252,2.54*a+1.252,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([1.252,2.54*a+1.252,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([1.252,2.54*a+1.252,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([1.252,2.54*a+1.252,-2])
Component(2,2,1.25);
color("Goldenrod")
translate([-1.252,2.54*a+1.252,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([-1.252,2.54*a+1.252,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([-1.252,2.54*a+1.252,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([-1.252,2.54*a+1.252,-2])
Component(2,2,1.25);
}
}
module 6_pins_holes(Pins_number)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([1.252,2.54*a+1.252,-3])
cylinder(r=0.55,h=10,center=true);
color("Goldenrod")
translate([-1.252,2.54*a+1.252,-3])
cylinder(r=0.55,h=10,center=true);
}
}
module 6_pins_copper_rings(Pins_number)
{
translate([0,-2.54*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([1.252,2.54*a+1.252,-3])
cylinder(r=1,h=1.6,center=true);
color("Goldenrod")
translate([-1.252,2.54*a+1.252,-3])
cylinder(r=1,h=1.6,center=true);
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
module USBmini()
{
difference()
{
hull()
{
translate([4,4.5,3])
sphere(r=0.5,$fn=18);
translate([-4,4.5,3])
sphere(r=0.5,$fn=18);
translate([4,-4.5,3])
sphere(r=0.5,$fn=18);
translate([-4,-4.5,3])
sphere(r=0.5,$fn=18);
translate([3,4.5,0])
sphere(r=0.5,$fn=18);
translate([-3,4.5,0])
sphere(r=0.5,$fn=18);
translate([3,-4.5,0])
sphere(r=0.5,$fn=18);
translate([-3,-4.5,0])
sphere(r=0.5,$fn=18);
}
translate([0,-1,0])
hull()
{
translate([3.25,4.5,2.5])
sphere(r=0.5,$fn=18);
translate([-3.25,4.5,2.5])
sphere(r=0.5,$fn=18);
translate([3.25,-4.5,2.5])
sphere(r=0.5,$fn=18);
translate([-3.25,-4.5,2.5])
sphere(r=0.5,$fn=18);
translate([2.5,4.5,0.5])
sphere(r=0.5,$fn=18);
translate([-2.5,4.5,0.5])
sphere(r=0.5,$fn=18);
translate([2.5,-4.5,0.5])
sphere(r=0.5,$fn=18);
translate([-2.5,-4.5,0.5])
sphere(r=0.5,$fn=18);
}
}
}
//--------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------
module Arduino_nano(Connection_pins_enabled,Connection_pins_up,6_pins_enabled,6_pins_up)
{
translate([0,1.257,4])
union()
{
difference()
{
union()
{
color("RoyalBlue")
translate([0,-1.252,0])
cube([18,43,1.5],center=true);
translate([2.54*3,0,-3])
rotate([0,180,0])
Pins_copper_rings(15);
translate([-2.54*3,0,-3])
rotate([0,180,0])
Pins_copper_rings(15);
translate([0,2.54*7,-3])
rotate([0,180,90])
6_pins_copper_rings(3);
}
translate([2.54*3,2.54*7+1.252,0])
cylinder(r=0.75,h=5,center=true);
translate([2.54*3,-2.54*9+1.252,0])
cylinder(r=0.75,h=5,center=true);
translate([-2.54*3,2.54*7+1.252,0])
cylinder(r=0.75,h=5,center=true);
translate([-2.54*3,-2.54*9+1.252,0])
cylinder(r=0.75,h=5,center=true);
translate([2.54*3,0,0])
rotate([0,180,0])
Pins_holes(15);
translate([-2.54*3,0,0])
rotate([0,180,0])
Pins_holes(15);
translate([0,2.54*7,0])
rotate([0,180,90])
6_pins_holes(3);
}
color("Silver")
translate([0,-20,1.25])
USBmini();
if(Connection_pins_up==0 && Connection_pins_enabled==1)
translate([2.54*3,0,0])
rotate([0,0,0])
Pins1(15);
if(Connection_pins_up==0 && Connection_pins_enabled==1)
translate([-2.54*3,0,0])
rotate([0,0,0])
Pins(15);
if(Connection_pins_up==1 && Connection_pins_enabled==1)
translate([2.54*3,0,0])
rotate([0,180,0])
Pins(15);
if(Connection_pins_up==1 && Connection_pins_enabled==1)
translate([-2.54*3,0,0])
rotate([0,180,0])
Pins(15);
if(6_pins_up==1 && 6_pins_enabled==1)
translate([0,2.54*7,0])
rotate([0,180,90])
6_pins(3);
if(6_pins_up==0 && 6_pins_enabled==1)
translate([0,2.54*7,0])
rotate([0,0,90])
6_pins(3);
color("Black")
translate([0,-6.5,0])
rotate([0,0,45])
Component(5,5,1.5);
color("Silver")
translate([0,-6.5,-0.5])
rotate([0,0,45])
Component(5.5,4,1.5);
color("Silver")
translate([0,-6.5,-0.5])
rotate([0,0,-45])
Component(5.5,4,1.5);
color("Silver")
translate([-5,-5,0])
rotate([0,0,135])
Component(0.5,2.3,1.25);
color("White")
translate([-1,12,0])
Component(0.7,1.8,1.25);
color("White")
translate([1,12,0])
Component(0.7,1.8,1.25);
color("White")
translate([3,12,0])
Component(0.7,1.8,1.25);
color("White")
translate([-3,12,0])
Component(0.7,1.8,1.25);
color("Saddlebrown")
translate([-1,9,0])
Component(0.7,1.8,1.25);
color("Saddlebrown")
translate([1,9,0])
Component(0.7,1.8,1.25);
color("Saddlebrown")
translate([3,9,0])
Component(0.7,1.8,1.25);
color("Saddlebrown")
translate([-3,9,0])
Component(0.7,1.8,1.25);
color("Silver")
translate([0,2.9,0])
Component(7,3,2);
color("Silver")
translate([0,2.9,0])
Component(5,2,2.1);
color("Saddlebrown")
translate([0,2.9,0])
Component(3,1,2.5);
color("Brown")
translate([0,2.9,0])
Component(3,1,2.5);
//Underneath
color("Saddlebrown")
translate([1.5,-21,-1.25])
Component(0.4,1.5,1);
color("Saddlebrown")
translate([4,-21,-1.25])
Component(0.4,1.5,1);
color("Black")
translate([-1,-20.75,-1.5])
Component(1.25,2.5,1);
color("Saddlebrown")
translate([-4,-19.75,-1.25])
Component(2,4.5,1);
color("Saddlebrown")
translate([4.5,-7,-1.25])
Component(0.4,1.5,1);
color("Saddlebrown")
translate([4,-2,-1.25])
Component(0.4,1.5,1);
color("Saddlebrown")
translate([2.5,-2,-1.25])
Component(0.4,1.5,1);
color("Black")
translate([0,-9.75,-1.75])
Component(3.5,10,1.5);
color("Silver")
translate([0,-9.75,-0.75])
Component(5.5,9,1.5);
color("Black")
translate([2,9.75,-1.75])
Component(5.5,3,1.75);
color("Silver")
translate([2,8,-1])
Component(3,3,0.75);
color("Silver")
translate([2,11,-1])
Component(0.6,3,0.5);
color("Silver")
translate([4,11,-1])
Component(0.6,3,0.5);
color("Silver")
translate([0,11,-1])
Component(0.6,3,0.5);
color("Saddlebrown")
translate([-3,10.5,-1.25])
Component(2.25,4.5,1);
color("Saddlebrown")
translate([-5,8.5,-1])
Component(0.4,1.5,0.5);
color("Saddlebrown")
translate([-5,12.25,-1])
Component(0.4,1.5,0.5);
}
}
Arduino_nano(Connection_pins_enabled,Connection_pins_up,6_pins_enabled,6_pins_up);

188
3d/lib/Capacitors.scad

@ -0,0 +1,188 @@
$fn=36;
Text="10uF";
Capacitor_diameter=2.54*2;
Capacitor_height=13;
Type=0; //0=Electrolitic 1=Ceramic 2=Poliester
Solder=0;
module Capacitor(Text,Capacitor_diameter,Capacitor_height,Type,Solder)
{
if(Type==0)
translate([1.257,0,2.75])
{
color("Black")
translate([0,0,Capacitor_height/2])
rotate([0,0,0])
cylinder(r=Capacitor_diameter,h=Capacitor_height,center=true);
color("Silver")
translate([0,0,Capacitor_height+0.01])
rotate([0,0,0])
cylinder(r=Capacitor_diameter-1,h=0.1,center=true);
color("Silver")
translate([0,0,-0.01])
rotate([0,0,0])
cylinder(r=Capacitor_diameter-2,h=0.1,center=true);
color("Silver")
translate([1.257,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-1.257,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("White")
translate([-Capacitor_diameter+0.9,0,Capacitor_height/2])
rotate([0,0,180])
rotate([90,90,90])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
if(Solder==1)
{
color("Silver")
translate([2.54*0.5,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*0.5,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("White")
%translate([0.15,0,0])
intersection()
{
translate([Capacitor_diameter/2,0,0])
rotate([0,0,0])
cube([Capacitor_diameter,Capacitor_diameter,Capacitor_height*3],center=true);
color("Black")
translate([0,0,Capacitor_height/2+0.02])
rotate([0,0,0])
cylinder(r=Capacitor_diameter-0.1,h=Capacitor_height,center=true);
}
}
if(Type==1)
{
translate([0,0,2.75])
{
color("Sienna")
hull()
{
color("Black")
translate([0,0,Capacitor_height/2])
rotate([90,90,0])
cylinder(r=Capacitor_diameter,h=0.5,center=true);
difference()
{
translate([0,-Capacitor_diameter+1.5,Capacitor_height/2])
rotate([90,90,0])
sphere(Capacitor_diameter);
translate([0,-50,0])
cube([100,100,100],center=true);
}
difference()
{
translate([0,Capacitor_diameter-1.5,Capacitor_height/2])
rotate([90,90,0])
sphere(Capacitor_diameter);
translate([0,50,0])
cube([100,100,100],center=true);
}
}
color("Silver")
translate([2.54,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=20,center=true);
color("Silver")
translate([-2.54,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=20,center=true);
if(Solder==1)
{
color("Silver")
translate([2.54*1,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*1,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("White")
translate([0,-0.5,Capacitor_height/2])
rotate([90,0,0])
%linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
}
if(Type==2)
{
translate([0,0,2.75])
{
color("DodgerBlue")
hull()
{
color("Black")
translate([0,0,2])
rotate([0,0,0])
cube([2.54*3,2.5,2.54*2],center=true);
}
color("Silver")
translate([2.54,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54,0,-4.5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
if(Solder==1)
{
color("Silver")
translate([2.54*1,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*1,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("White")
%translate([0,-0.3,2])
rotate([90,0,0])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
}
}
Capacitor(Text,Capacitor_diameter,Capacitor_height,Type,Solder);

173
3d/lib/Diode.scad

@ -0,0 +1,173 @@
$fn=36;
Text="1N4007";
Size=1;
Solder=1;
module Diode(Text,Size,Solder)
{
if(Size==0)
translate([0,0,2.75])
{
color("Black")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.45,h=2.54*3,center=true);
color("White")
translate([-2.54*1.49,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=1);
color("Silver")
translate([0,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*4,center=true);
color("Silver")
translate([2.54*2,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*2,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*2,0,-2.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("Gray")
%translate([0,0,0.5])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
}
if(Size==1)
translate([0,0,3.75])
{
color("Black")
translate([-1,0,0])
rotate([0,90,0])
cylinder(r=2,h=2.54*3.5,center=true);
color("White")
translate([-2.54*1.99-0.3,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=1);
color("Silver")
translate([-1.257,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*5,center=true);
color("Silver")
translate([2.54*2,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*3,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2,0,-3.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*3,0,-3.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("Gray")
%translate([-1,0,1.05])
linear_extrude(1)
text(Text,size=1.5,valign="center",halign="center");
}
if(Size==2)
translate([0,0,4.25])
{
color("Black")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=2.5,h=2.54*4,center=true);
color("White")
translate([-2.54*1.99,0,0])
rotate([0,90,0])
cylinder(r=2.55,h=1.5);
color("Silver")
translate([0,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*6,center=true);
color("Silver")
translate([2.54*3,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*3,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*3,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*3,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color("Gray")
%translate([0,0,1.7])
linear_extrude(1)
text(Text,size=1.5,valign="center",halign="center");
}
}
Diode(Text,Size,Solder);

65
3d/lib/Dupont_connector_female.scad

@ -0,0 +1,65 @@
$fn=36;
Pitch=2.54;
Positions=6;
Solder=1;
module Dupont_connector_female(Pitch,Positions,Solder)
{
translate([0,-Pitch*round(Positions/2),0])
rotate([0,180,0])
for(a=[0:1:Positions-1])
{
color("Goldenrod")
translate([0,Pitch*a,1])
cube([0.6,0.6,4],center=true);
if(Solder==1)
{
color("Silver")
translate([0,Pitch*a,-2])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,Pitch*a,0.5])
cylinder(r1=1,r2=0,h=1);
}
difference()
{
color("Black")
translate([0,Pitch*a,-11])
Component(2,2.55,10);
color("grey")
translate([0,Pitch*a,-12])
Component(1.25,1.25,10);
}
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
Dupont_connector_female(Pitch,Positions,Solder);

276
3d/lib/I2C_interface_LCD1602.scad

@ -0,0 +1,276 @@
$fn=36;
//0=false 1=true
Connection_pins_enabled=1;
Connection_pins_up=0;
I2C_pins_enabled=1;
I2C_pins_up=3;
Led_pins_enabled=1;
Led_pins_up=0;
module Pins_holes(Pins_number)
{
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,0])
cylinder(r=0.55,h=10,center=true);
}
}
module Pins_copper_rings(Pins_number)
{
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,2.54*a,0])
cylinder(r=1,h=1.05,center=true);
}
}
module Pins(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,-2])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([0,Pitch*a,-7.6])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Pins_90(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,1])
cube([0.6,0.6,10-6],center=true);
color("Goldenrod")
translate([4.7,Pitch*a,-1.25])
rotate([0,90,0])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([10.3,Pitch*a,-1.25])
rotate([0,-90,0])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,10/2-2])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//--------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------
module I2C_interface_LCD1602(Connection_pins_enabled,Connection_pins_up,I2C_pins_enabled,I2C_pins_up,Led_pins_enabled,Led_pins_up)
translate([0,1.27,0])
{
translate([0,1.257,4])
union()
{
difference()
{
union()
{
color("MidnightBlue")
translate([0,-1.252,0])
cube([19,41.5,1],center=true);
translate([2.54*3,-2.54*8,0])
rotate([0,180,0])
Pins_copper_rings(16);
translate([2.54*1,-2.54*8,0])
rotate([0,180,90])
Pins_copper_rings(4);
translate([2.54*0,2.54*7,0])
rotate([0,180,90])
Pins_copper_rings(2);
}
translate([2.54*3,-2.54*8,0])
rotate([0,180,0])
Pins_holes(16);
translate([2.54*1,-2.54*8,0])
rotate([0,180,90])
Pins_holes(4);
translate([2.54*0,2.54*7,0])
rotate([0,180,90])
Pins_holes(2);
}
color("Black")
translate([0,0,0])
rotate([0,0,90])
Component(8,10.5,1.5);
color("Silver")
translate([0,0,0])
rotate([0,0,90])
Component(10,9,1);
difference()
{
union()
{
color("RoyalBlue")
translate([1,-11,0])
rotate([0,0,90])
Component(7,7,5);
color("Grey")
translate([1,-11,2])
rotate([0,0,90])
cylinder(r=2,h=3);
}
color("DimGrey")
translate([1,-11,5])
rotate([0,0,90])
cube([0.75,4,2],center=true);
color("DimGrey")
translate([1,-11,5])
rotate([0,0,0])
cube([0.75,4,2],center=true);
}
if(Connection_pins_enabled==1 && Connection_pins_up==0)
translate([2.54*3,-2.54*1,0])
rotate([0,0,0])
Pins(16,2.54,1);
if(Connection_pins_enabled==1 && Connection_pins_up==1)
translate([2.54*3,-2.54*1,0])
rotate([0,180,0])
Pins(16,2.54,1);
if(Connection_pins_enabled==1 && Connection_pins_up==3)
translate([2.54*3,0,0])
rotate([0,180,180])
Pins_90(16,2.54,1);
if(Connection_pins_enabled==1 && Connection_pins_up==2)
translate([2.54*3,-2.54*1,0])
rotate([0,0,0])
Pins_90(16,2.54,1);
if(I2C_pins_enabled==1 && I2C_pins_up==1)
translate([0,-2.54*8,0])
rotate([0,180,90])
Pins(4,2.54,1);
if(I2C_pins_enabled==1 && I2C_pins_up==0)
translate([0,-2.54*8,0])
rotate([0,0,90])
Pins(4,2.54,1);
if(I2C_pins_enabled==1 && I2C_pins_up==2)
translate([-2.54,-2.54*8,0])
rotate([0,0,-90])
Pins_90(4,2.54,1);
if(I2C_pins_enabled==1 && I2C_pins_up==3)
translate([0,-2.54*8,0])
rotate([0,180,90])
Pins_90(4,2.54,1);
if(Led_pins_enabled==1 && Led_pins_up==1)
translate([2.54*0,2.54*7,0])
rotate([0,180,90])
Pins(2,2.54,1);
if(Led_pins_enabled==1 && Led_pins_up==0)
translate([2.54*0,2.54*7,0])
rotate([0,0,90])
Pins(2,2.54,1);
if(Led_pins_enabled==1 && Led_pins_up==2)
translate([2.54*0,2.54*7,0])
rotate([0,0,90])
Pins_90(2,2.54,1);
if(Led_pins_enabled==1 && Led_pins_up==3)
translate([-2.54,2.54*7,0])
rotate([0,180,-90])
Pins_90(2,2.54,1);
}
}
I2C_interface_LCD1602(Connection_pins_enabled,Connection_pins_up,I2C_pins_enabled,I2C_pins_up,Led_pins_enabled,Led_pins_up);

160
3d/lib/IC_DIP.scad

@ -0,0 +1,160 @@
$fn=36;
Pins_number=6;
Text="BPC817C";
Type=0; //0=small 1=big
Solder=1;
module IC_DIP(Pins_number,Text,Type,Solder)
{
if(Type==0)
translate([0.25,1.252-(round(Pins_number/4)*2.54),2])
difference()
{
for(a=[0:1:Pins_number/2-1])
translate([0,a*2.54,0])
{
color("Black")
translate([0,0,0])
cube([7.1,2.54,3.5]);
color("Silver")
translate([-0.45,1.252-0.5,1.5])
cube([5,1,0.3]);
color("Silver")
translate([2.55,1.252-0.5,1.5])
cube([5,1,0.3]);
color("Silver")
translate([-0.45,1.252-0.3,-4.2])
cube([0.3,0.6,6]);
color("Silver")
translate([7.25,1.252-0.3,-4.2])
cube([0.3,0.6,6]);
color("Silver")
translate([-0.45,1.252-0.5,-0.4])
cube([0.3,1,2]);
color("Silver")
translate([7.25,1.252-0.5,-0.4])
cube([0.3,1,2]);
if(Solder==1)
{
color("Silver")
translate([2.54*3-0.25,1.257,-1.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*0-0.25,1.257,-1.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
translate([12,5,-2])
cylinder(d=3.5,h=10);
if(Pins_number>4)
color("White")
translate([4,2.54*Pins_number/4+0.5,3.45])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
if(Pins_number<5)
color("White")
translate([3.5,2.54*Pins_number/4,3.45])
rotate([0,0,0])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
color("White")
translate([4,0,3.4])
cylinder(r=1,h=1);
color("White")
translate([6,1,3.4])
cylinder(r=0.5,h=1);
}
if(Type==1)
translate([0.25,1.252-(round(Pins_number/4)*2.54),3])
{
difference()
{
for(a=[0:1:Pins_number/2-1])
translate([0,a*2.54,0])
{
color("Black")
translate([0,0,0])
cube([14.7,2.54,3.5]);
color("Silver")
translate([-0.45,1.252-0.5,1.5])
cube([5,1,0.3]);
color("Silver")
translate([10.15,1.252-0.5,1.5])
cube([5,1,0.3]);
color("Silver")
translate([-0.45,1.252-0.3,-4.2])
cube([0.3,0.6,6]);
color("Silver")
translate([14.85,1.252-0.3,-4.2])
cube([0.3,0.6,6]);
color("Silver")
translate([-0.45,1.252-0.5,-0.4])
cube([0.3,1,2]);
color("Silver")
translate([14.85,1.252-0.5,-0.4])
cube([0.3,1,2]);
if(Solder==1)
{
color("Silver")
translate([2.54*6-0.25,1.257,-1.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*0-0.25,1.257,-1.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
if(Pins_number>4)
color("White")
translate([7,2.54*Pins_number/4+0.5,3.45])
rotate([0,0,90])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
if(Pins_number<5)
color("White")
translate([3.5,2.54*Pins_number/4,3.45])
rotate([0,0,0])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
color("White")
translate([7.5,0,3.4])
cylinder(r=1,h=1);
color("White")
translate([13,1,3.4])
cylinder(r=0.5,h=1);
}
}
}
IC_DIP(Pins_number,Text,Type,Solder);

161
3d/lib/IC_TO220.scad

@ -0,0 +1,161 @@
$fn=36;
Text="NDP";
Text1="6020P";
Type=0; //0=vertical 1=90 degrees
Solder=1;
module TO220(Text,Text1,Type,Solder)
{
if(Type==0)
translate([0.1+2.54,0.03-2.54*2,6])
rotate([0,-90,0])
difference()
{
union()
{
color("silver")
translate([0.1,0.1,0])
cube([15,9.8,1.2]);
color("Black")
translate([0,0,0.01])
cube([8.5,10,4.5]);
color("Silver")
translate([-2,2,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-2,2+2.54,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-2,2+2.54*2,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-14,2+0.2,2.5])
cube([13,0.6,0.3]);
color("Silver")
translate([-14,2+2.54+0.2,2.5])
cube([13,0.6,0.3]);
color("Silver")
translate([-14,2+2.54*2+0.2,2.5])
cube([13,0.6,0.3]);
}
translate([12,5,-2])
cylinder(d=3.5,h=10);
color("White")
translate([6,5,4.45])
rotate([0,0,-90])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
color("White")
translate([3,5,4.45])
rotate([0,0,-90])
linear_extrude(1)
text(Text1,size=2,valign="center",halign="center");
}
if(Solder==1)
translate([0,0,4.25])
rotate([0,0,90])
{
color("Silver")
translate([2.54*1,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*0,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*1,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
if(Type==1)
{
translate([0.1+2.54,0.03-2.54*2,2])
rotate([0,0,0])
difference()
{
union()
{
color("silver")
translate([0.1,0.1,0])
cube([15,9.8,1.2]);
color("Black")
translate([0,0,0.01])
cube([8.5,10,4.5]);
color("Silver")
translate([-2.8,2,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-2.8,2+2.54,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-2.8,2+2.54*2,2.5])
cube([5,1,0.3]);
color("Silver")
translate([-2.8,2+0.2,2.5])
rotate([0,90,0])
cube([13,0.6,0.3]);
color("Silver")
translate([-2.8,2+2.54+0.2,2.5])
rotate([0,90,0])
cube([13,0.6,0.3]);
color("Silver")
translate([-2.8,2+2.54*2+0.2,2.5])
rotate([0,90,0])
cube([13,0.6,0.3]);
}
translate([12,5,-2])
cylinder(d=3.5,h=10);
color("White")
translate([6,5,4.45])
rotate([0,0,-90])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
color("White")
translate([3,5,4.45])
rotate([0,0,-90])
linear_extrude(1)
text(Text1,size=2,valign="center",halign="center");
}
if(Solder==1)
translate([0,0,4.25])
rotate([0,0,90])
{
color("Silver")
translate([2.54*1,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*0,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*1,0,-3.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
TO220(Text,Text1,Type,Solder);

94
3d/lib/IC_TO92.scad

@ -0,0 +1,94 @@
$fn=36;
Pitch=2.54;
Text="BC";
Text1="337";
P1="B";
P2="C";
P3="E";
Color="Black";
Solder=1;
module TO92(Text,Text1,P1,P2,P3,Color,Solder)
{ translate([0,0,3])
difference()
{
union()
{
color("Silver")
translate([Pitch,0,-18])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch,0,-18])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([1.75,0,-1])
rotate([0,-20,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-1.75,0,-1])
rotate([0,20,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0,0,-16])
cube([0.5,0.5,34],center=true);
if(Solder==1)
{
color("Silver")
translate([Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([0,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color)
{
translate([0,0,1])
cylinder(d=5,h=4);
}
}
color("SlateGray")
translate([0,-6.5,4])
cube([10,10,10],center=true);
color("White")
translate([0,-1.48,3.75])
rotate([90,0,0])
linear_extrude(1)
text(Text,size=1,valign="center",halign="center");
color("White")
translate([0,-1.48,2.5])
rotate([90,0,0])
linear_extrude(1)
text(Text1,size=1,valign="center",halign="center");
color("White")
translate([-1.5,-1.48,1.5])
rotate([90,0,0])
linear_extrude(1)
text(P1,size=0.5,valign="center",halign="center");
color("White")
translate([0,-1.48,1.5])
rotate([90,0,0])
linear_extrude(1)
text(P2,size=0.5,valign="center",halign="center");
color("White")
translate([1.5,-1.48,1.5])
rotate([90,0,0])
linear_extrude(1)
text(P3,size=0.5,valign="center",halign="center");
}
}
TO92(Text,Text1,P1,P2,P3,Color,Solder);

180
3d/lib/LCD_1602_I2C.scad

@ -0,0 +1,180 @@
use<I2C_interface_LCD1602.scad>;
use<Solder.scad>;
$fn=36;
Pitch=2.54;
PinsDown=1;
Text1="ABCDEFG";
Text2="HIJKLMNOPQ";
module Pins(Pins_number,Pitch)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([0,Pitch*a,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,Pitch*a,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
}
}
module Pins_holes(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=10,center=true);
}
}
module Pins_copper_rings(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=1.6,center=true);
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
module LCD_1602_I2C(PinsDown,Text1,Text2)
translate([-2.54*16,-2.54*7-1.27,0])
{
translate([0,-1.252,0])
difference()
{
union()
{
color("Royalblue")
translate([0,1.5,0])
cube([81,36,1.5]);
translate([Pitch*11,Pitch*14,-2.25])
rotate([0,180,90])
Pins_copper_rings(16,Pitch,1);
color("silver")
translate([2.5,4,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([2.5,35,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([78.5,4,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([78.5,35,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("Black")
translate([40.5,19.5,9.5])
rotate([0,180,0])
Component(71.5,27,8);
}
translate([Pitch*11,Pitch*14,0.5])
rotate([0,180,90])
Pins_holes(16,Pitch,0.55);
color("OliveDrab")
translate([40.5,19.5,12.5])
rotate([0,180,0])
Component(64,16,3);
color("Black")
translate([10,20.5,9.5])
rotate([0,0,0])
linear_extrude(1)
text(Text1,size=4.5,font="Linux Libertine Mono O:style=Mono");
color("Black")
translate([10,14.5,9.5])
rotate([0,0,0])
linear_extrude(1)
text(Text2,size=4.5,font="Linux Libertine Mono O:style=Mono");
color("silver")
translate([2.5,4,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([2.5,35,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([78.5,4,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([78.5,35,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
}
difference()
{
//I2C_interface_LCD1602(Connection_pins_enabled,Connection_pins_up,I2C_pin_enabled,I2C_pins_up,Led_pins_enabled,Led_pins_up);
translate([2.54*11,2.54*10+1.27,0])
rotate([0,180,-90])
I2C_interface_LCD1602(1,0,1,PinsDown,1,PinsDown,1,3);
translate([0,0,52.5])
cube([100,100,100],center=true);
}
translate([2.54*4,2.54*13.5,0.75])
scale([1,1,1.2])
Solder(16,1);
}
LCD_1602_I2C(PinsDown,Text1,Text2);

179
3d/lib/LCD_1602_Serial.scad

@ -0,0 +1,179 @@
//I have two version of this display, one from an original Arduino kit and one from Aliexpress, and the display case (the black part) differ in size so I placed an option to select wich one to visualize. The original one size 26.5x71.5x8.5mm while non original one size 24x71x7mm.The board and pin positions are identical.
$fn=36;
Pitch=2.54;
Pins_enabled=0;
Pins_up=0;
Version=0; //0=Original display from Arduino kit, LCM1602C 1=Generic eBay or Aliexpress
Text1="ABCDEFGHIJKLMNOP";
Text2="QRSTUVWXYZ123456";
module Pins(Pins_number,Pitch)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([0,Pitch*a,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,Pitch*a,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
}
}
module Pins_holes(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=10,center=true);
}
}
module Pins_copper_rings(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=1.6,center=true);
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
module LCD_1602_Serial(Pins_enabled,Pins_up,Version,Text1,Text2)
translate([-Pitch*15-Pitch/2,-Pitch*7-Pitch/2,2.5])
{
translate([0,-1.252,0])
difference()
{
union()
{
color("Royalblue")
translate([0,1.5,0])
cube([80,36,1.5]);
translate([Pitch*10.5,Pitch*14,-2.25])
rotate([0,180,90])
Pins_copper_rings(16,Pitch,0.75);
color("silver")
translate([2.5,4,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([2.5,35,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([77.5,4,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([77.5,35,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
if(Version==0)
color("Black")
translate([40,19,9.5])
rotate([0,180,0])
Component(71.5,27,8);
if(Version==1)
color("Black")
translate([40,19,8.5])
rotate([0,180,0])
Component(71,24,7);
}
translate([Pitch*10.5,Pitch*14,0.5])
rotate([0,180,90])
Pins_holes(16,Pitch,0.55);
color("OliveDrab")
translate([40,19,11.5])
rotate([0,180,0])
Component(64,16,3);
color("Black")
translate([10,20,8.45])
rotate([0,0,0])
linear_extrude(1)
text(Text1,size=4.25);
color("Black")
translate([10,14,8.45])
rotate([0,0,0])
linear_extrude(1)
text(Text2,size=4.25);
color("silver")
translate([2.5,4,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([2.5,35,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([77.5,4,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([77.5,35,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
}
if(Pins_enabled==1 && Pins_up==0)
translate([Pitch*10.5,Pitch*14-1.257,1])
rotate([0,0,90])
Pins(16,Pitch);
if(Pins_enabled==1 && Pins_up==1)
translate([Pitch*11,Pitch*14-1.257,0.8])
rotate([0,180,90])
Pins(16,Pitch);
}
LCD_1602_Serial(Pins_enabled,Pins_up,Version,Text1,Text2);

164
3d/lib/LDR.scad

@ -0,0 +1,164 @@
$fn=36;
module traks()
translate([0.15,0,0])
{
color("Silver")
hull()
{
translate([1.9,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.9,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,0.5,0])
color("Silver")
hull()
{
translate([1.8,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.8,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-0.5,0])
color("Silver")
hull()
{
translate([1.8,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.8,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,1,0])
color("Silver")
hull()
{
translate([1.65,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.55,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-1,0])
color("Silver")
hull()
{
translate([1.65,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.65,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,1.5,0])
color("Silver")
hull()
{
translate([1.4,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.4,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-1.5,0])
color("Silver")
hull()
{
translate([1.4,0,1.95])
cylinder(d=0.2,h=0.1);
translate([-1.4,0,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-1.5,0])
color("Silver")
hull()
{
translate([1.4,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.7,0.5,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-1,0])
color("Silver")
hull()
{
translate([1.7,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.85,0.5,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,-0.5,0])
color("Silver")
hull()
{
translate([1.85,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.9,0.5,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,1.5,0])
color("Silver")
hull()
{
translate([1.4,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.7,-0.5,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,1,0])
color("Silver")
hull()
{
translate([1.7,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.85,-0.5,1.95])
cylinder(d=0.2,h=0.1);
}
translate([0,0.5,0])
color("Silver")
hull()
{
translate([1.85,0,1.95])
cylinder(d=0.2,h=0.1);
translate([1.9,-0.5,1.95])
cylinder(d=0.2,h=0.1);
}
}
module LDR()
difference()
{
union()
{
color("SaddleBrown")
translate([0,0,0])
cylinder(d=5,h=2);
color("Silver")
translate([1.27,0,-40])
cylinder(d=0.6,h=40);
color("Silver")
translate([-1.27,0,-40])
cylinder(d=0.6,h=40);
}
color("SaddleBrown")
translate([0,7,0])
cube([10,10,10],center=true);
color("SaddleBrown")
translate([0,-7,0])
cube([10,10,10],center=true);
color("Silver")
translate([0,0.126,0])
traks();
color("Silver")
translate([0,-0.126,0])
rotate([0,0,180])
traks();
}
LDR();

459
3d/lib/Led.scad

@ -0,0 +1,459 @@
$fn=36;
Pitch=2.54;
Color="white";
Size=1; //0=5mm 1=5mm bicolor 2=5mm RGB 3=3mm 4=3mm bicolor 5=3mm rgb
Solder=1;
module Led(Color,Size,,Solder)
{
if(Size==0)
translate([1.27,0,3])
difference()
{
union()
{
color("Silver")
translate([Pitch/2-0.25,-0.25,-28],center=true)
cube([0.5,0.5,30]);
color("Silver")
translate([-Pitch/2-0.25,-0.25,-26],center=true)
cube([0.5,0.5,28.5]);
color("Silver")
translate([0,0,3],center=true)
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([-Pitch/2-0.25,-0.25,1.5])
cube([Pitch+0.5,0.5,2]);
translate([0.65,-0.25,3])
rotate([0,35,0])
cube([0.5,5,5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch*0.5,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch*0.5,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,6])
sphere(d=5);
translate([0,0,1])
cylinder(d=5,h=1);
}
cylinder(d=6,h=1);
}
}
color(Color,0.6)
translate([-7.5,0,-1])
cube([10,10,10],center=true);
}
if(Size==1)
translate([0,0,3])
difference()
{
union()
{
color("Silver")
translate([Pitch,0,-18])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch,0,-17.4])
cube([0.5,0.5,28.5],center=true);
color("Silver")
translate([1.75,0,-1])
rotate([0,-20,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-1.75,0,-1])
rotate([0,20,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0,0,-15.5])
cube([0.5,0.5,34],center=true);
color("Silver")
translate([0,0,2.5])
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([-Pitch/2-0.25,-0.25,1])
cube([Pitch+0.5,0.5,2]);
translate([0.65,-0.25,2.5])
rotate([0,35,0])
cube([0.5,5,5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([0,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,6])
sphere(d=5);
translate([0,0,1])
cylinder(d=5,h=1);
}
cylinder(d=6,h=1);
}
}
color(Color,0.6)
translate([-7.5,0,4])
cube([10,10,10],center=true);
}
if(Size==2)
translate([Pitch/2,Pitch/2,3])
difference()
{
union()
{
color("Silver")
translate([Pitch/2,-Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch/2,-Pitch/2,-17.4])
cube([0.5,0.5,28.5],center=true);
color("Silver")
translate([Pitch/2,Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch/2,Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([0.73,0.73,-1])
rotate([13,-13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-0.73,0.73,-1])
rotate([13,13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-0.73,-0.73,-1])
rotate([-13,13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0.73,-0.73,-1])
rotate([-13,-13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0,0,2.5])
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([-Pitch/2-0.25,-0.25,1])
cube([Pitch+0.4,0.4,2]);
translate([0.65,-0.25,2.5])
rotate([0,35,0])
cube([0.5,5,5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch/2,Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch/2,Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([Pitch/2,-Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch/2,-Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,6])
sphere(d=5);
translate([0,0,1])
cylinder(d=5,h=1);
}
cylinder(d=6,h=1);
}
}
color(Color,0.6)
translate([-7.5,0,4.95])
cube([10,10,10],center=true);
}
if(Size==3)
translate([Pitch/2,0,3])
difference()
{
union()
{
color("Silver")
translate([Pitch/2,0,-14],center=true)
cube([0.4,0.4,30],center=true);
color("Silver")
translate([-Pitch/2,0,-13],center=true)
cube([0.4,0.4,28.5],center=true);
color("Silver")
translate([0,0,2.2],center=true)
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([0,0,1.5])
cube([Pitch,0.5,2],center=true);
translate([1.2,-0.25,3])
rotate([0,35,0])
cube([0.5,5,6.5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch*0.5,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch*0.5,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,3.5])
sphere(d=3);
translate([0,0,1])
cylinder(d=3,h=1);
}
cylinder(d=4,h=1);
}
}
color(Color,0.6)
translate([-7.5,0,-1])
cube([10,10,10],center=true);
}
if(Size==4)
translate([0,0,3])
difference()
{
union()
{
color("Silver")
translate([Pitch,0,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch,0,-17.4])
cube([0.5,0.5,28.5],center=true);
color("Silver")
translate([1.6,0,-1])
rotate([0,-23,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-1.6,0,-1])
rotate([0,23,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0,0,-15.5])
cube([0.5,0.5,34],center=true);
color("Silver")
translate([0,0,2.5])
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([0,0,2])
cube([Pitch+0.4,0.4,2],center=true);
translate([0.65,-0.25,2.5])
rotate([0,35,0])
cube([0.5,5,5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([0,0,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,3.5])
sphere(d=3);
translate([0,0,1])
cylinder(d=3,h=1);
}
cylinder(d=4,h=1);
}
}
color(Color,0.6)
translate([-6.5,0,4.95])
cube([10,10,10],center=true);
}
if(Size==5)
translate([Pitch/2,Pitch/2,3])
difference()
{
union()
{
color("Silver")
translate([Pitch/2,-Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch/2,-Pitch/2,-17.4])
cube([0.5,0.5,28.5],center=true);
color("Silver")
translate([Pitch/2,Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([-Pitch/2,Pitch/2,-18.15])
cube([0.5,0.5,30],center=true);
color("Silver")
translate([0.73,0.73,-1])
rotate([13,-13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-0.73,0.73,-1])
rotate([13,13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([-0.73,-0.73,-1])
rotate([-13,13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0.73,-0.73,-1])
rotate([-13,-13,0])
cube([0.5,0.5,5],center=true);
color("Silver")
translate([0,0,2.5])
cylinder(d1=0,d2=2,center=true);
color("Silver")
difference()
{
translate([-Pitch/2-0.25,-0.25,1])
cube([Pitch+0.4,0.4,2]);
translate([0.65,-0.25,2.5])
rotate([0,35,0])
cube([0.5,5,5],center=true);
}
if(Solder==1)
{
color("Silver")
translate([Pitch/2,Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch/2,Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([Pitch/2,-Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-Pitch/2,-Pitch/2,-3])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
color(Color,0.8)
{
hull()
{
translate([0,0,3.5])
sphere(d=3);
translate([0,0,1])
cylinder(d=3,h=1);
}
cylinder(d=4,h=1);
}
}
color(Color,0.6)
translate([-6.5,0,4.95])
cube([10,10,10],center=true);
}
}
Led(Color,Size,Solder);

374
3d/lib/Micro_push_button.scad

@ -0,0 +1,374 @@
$fn=36;
use<PCB.scad>
Type=0; //0=6x6 horizontal 1=6x6 vertical 2=12x12 horizontal 3=12x12 vertical
Knob_height=10; //Only knob height
Solder=0;
module Push_button(Type,Knob_height,Solder)
{
if(Type==0)
translate([0,1.27,1])
difference()
{
union()
{
color("Black")
hull()
{
translate([3,3,0.25])
sphere(d=0.5);
translate([3,-3,0.25])
sphere(d=0.5);
translate([-3,3,0.25])
sphere(d=0.5);
translate([-3,-3,0.25])
sphere(d=0.5);
translate([3,3,3-0.25])
sphere(d=0.5);
translate([3,-3,3-0.25])
sphere(d=0.5);
translate([-3,3,3-0.25])
sphere(d=0.5);
translate([-3,-3,3-0.25])
sphere(d=0.5);
}
color("Silver")
hull()
{
translate([3-0.5,3-0.5,3-0.15])
sphere(d=0.5);
translate([3-0.5,-3+0.5,3-0.15])
sphere(d=0.5);
translate([-3+0.5,3-0.5,3-0.15])
sphere(d=0.5);
translate([-3+0.5,-3+0.5,3-0.15])
sphere(d=0.5);
}
color("Black")
{
translate([3-1,3-1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([3-1,-3+1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([-3+1,3-1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([-3+1,-3+1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
}
color("Silver")
{
translate([2.54,0,0.5])
cube([0.6,7.93,0.3],center=true);
translate([-2.54,0,0.5])
cube([0.6,7.93,0.3],center=true);
translate([-2.54,-2.54*1.5,-1.5])
cube([0.6,0.3,4],center=true);
translate([2.54,-2.54*1.5,-1.5])
cube([0.6,0.3,4],center=true);
translate([-2.54,2.54*1.5,-1.5])
cube([0.6,0.3,4],center=true);
translate([2.54,2.54*1.5,-1.5])
cube([0.6,0.3,4],center=true);
}
color("Black")
translate([0,0,1])
cylinder(d=3.5,h=2+Knob_height);
if(Solder==1)
{
color("Silver")
translate([2.54,2.54*1.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,2.54*1.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([2.54,-2.54*1.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,-2.54*1.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
if(Type==1)
translate([0,0.5,5])
rotate([90,0,0])
union()
{
color("Black")
hull()
{
translate([3,3,0.25])
sphere(d=0.5);
translate([3,-3,0.25])
sphere(d=0.5);
translate([-3,3,0.25])
sphere(d=0.5);
translate([-3,-3,0.25])
sphere(d=0.5);
translate([3,3,3-0.25])
sphere(d=0.5);
translate([3,-3,3-0.25])
sphere(d=0.5);
translate([-3,3,3-0.25])
sphere(d=0.5);
translate([-3,-3,3-0.25])
sphere(d=0.5);
}
color("Silver")
hull()
{
translate([3-0.5,3-0.5,3-0.15])
sphere(d=0.5);
translate([3-0.5,-3+0.5,3-0.15])
sphere(d=0.5);
translate([-3+0.5,3-0.5,3-0.15])
sphere(d=0.5);
translate([-3+0.5,-3+0.5,3-0.15])
sphere(d=0.5);
}
color("Black")
{
translate([3-1,3-1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([3-1,-3+1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([-3+1,3-1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
translate([-3+1,-3+1,3+0.1])
scale([1,1,0.5])
sphere(d=1);
}
color("Silver")
{
translate([2.54,-7,0.5])
cube([0.6,9,0.3],center=true);
translate([-2.54,-7,0.5])
cube([0.6,9,0.3],center=true);
}
color("Black")
translate([0,0,1])
cylinder(d=3.5,h=2+Knob_height);
if(Solder==1)
{
color("Silver")
translate([2.54,-2.54*1.96,0.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,-2.54*1.96,0.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
if(Type==2)
translate([0,1.27,1])
difference()
{
union()
{
color("Black")
hull()
{
translate([6,6,0.25])
sphere(d=0.5);
translate([6,-6,0.25])
sphere(d=0.5);
translate([-6,6,0.25])
sphere(d=0.5);
translate([-6,-6,0.25])
sphere(d=0.5);
translate([6,6,3.45])
sphere(d=0.5);
translate([6,-6,3.45])
sphere(d=0.5);
translate([-6,6,3.45])
sphere(d=0.5);
translate([-6,-6,3.45])
sphere(d=0.5);
}
color("Silver")
hull()
{
translate([5.5,5.5,3.55])
sphere(d=0.5);
translate([5.5,-5.5,3.55])
sphere(d=0.5);
translate([-5.5,5.5,3.55])
sphere(d=0.5);
translate([-5.5,-5.5,3.55])
sphere(d=0.5);
}
color("Black")
{
translate([4.5,4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([4.5,-4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([-4.5,4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([-4.5,-4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
}
color("Silver")
{
translate([2.54,0,0.5])
cube([0.6,7.93,0.3],center=true);
translate([-2.54,0,0.5])
cube([0.6,7.93,0.3],center=true);
translate([-2.54,-2.54*2.5,-1])
cube([0.6,0.3,3],center=true);
translate([2.54,-2.54*2.5,-1])
cube([0.6,0.3,3],center=true);
translate([-2.54,2.54*2.5,-1])
cube([0.6,0.3,3],center=true);
translate([2.54,2.54*2.5,-1])
cube([0.6,0.3,3],center=true);
}
color("Black")
translate([0,0,1])
cylinder(d=6.7,h=2.5+Knob_height);
if(Solder==1)
{
color("Silver")
translate([2.54,2.54*2.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,2.54*2.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([2.54,-2.54*2.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,-2.54*2.5,-1])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
if(Type==3)
translate([0,0.5,8])
rotate([90,0,0])
difference()
{
union()
{
color("Black")
hull()
{
translate([6,6,0.25])
sphere(d=0.5);
translate([6,-6,0.25])
sphere(d=0.5);
translate([-6,6,0.25])
sphere(d=0.5);
translate([-6,-6,0.25])
sphere(d=0.5);
translate([6,6,3.45])
sphere(d=0.5);
translate([6,-6,3.45])
sphere(d=0.5);
translate([-6,6,3.45])
sphere(d=0.5);
translate([-6,-6,3.45])
sphere(d=0.5);
}
color("Silver")
hull()
{
translate([5.5,5.5,3.55])
sphere(d=0.5);
translate([5.5,-5.5,3.55])
sphere(d=0.5);
translate([-5.5,5.5,3.55])
sphere(d=0.5);
translate([-5.5,-5.5,3.55])
sphere(d=0.5);
}
color("Black")
{
translate([4.5,4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([4.5,-4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([-4.5,4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
translate([-4.5,-4.5,3.75])
scale([1,1,0.5])
sphere(d=1.5);
}
color("Silver")
{
translate([2.54,-9,0.5])
cube([0.6,7.93,0.3],center=true);
translate([-2.54,-9,0.5])
cube([0.6,7.93,0.3],center=true);
}
color("Black")
translate([0,0,1])
cylinder(d=6.7,h=2.5+Knob_height);
if(Solder==1)
{
color("Silver")
translate([2.54,-2.54*3.15,0.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54,-2.54*3.15,0.5])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
}
Push_button(Type,Knob_height,Solder);
*PCB(100,100,1,2.54,1);

159
3d/lib/OLED_13_128_64.scad

@ -0,0 +1,159 @@
$fn=36;
Pitch=2.54;
Pins_enabled=0;
Pins_up=0;
module Pins(Pins_number,Pitch)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cube([0.6,0.6,10],center=true);
color("Silver")
translate([0,Pitch*a,-1.5])
cylinder(r1=0,r2=1,h=1);
color("Silver")
translate([0,Pitch*a,0.5])
cylinder(r1=1,r2=0,h=1);
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
}
}
module Pins_holes(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=10,center=true);
}
}
module Pins_copper_rings(Pins_number,Pitch,Diameter)
{
translate([0,-Pitch*Pins_number/2,0])
for(a=[0:1:Pins_number-1])
{
color("Goldenrod")
translate([0,Pitch*a,-3])
cylinder(r=Diameter,h=1.6,center=true);
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
module OLED_13_128_64_I2C(Pins_enabled,Pins_up)
{
translate([0,-1.252,0])
difference()
{
union()
{
color("Royalblue")
translate([1.252,0.5,0])
cube([34,35,1.5]);
translate([Pitch,Pitch*7.5,-2.25])
rotate([0,180,0])
Pins_copper_rings(4,Pitch,0.75);
color("silver")
translate([4,3,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([4,33,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([32,3,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("silver")
translate([32,33,-0.05])
rotate([0,0,0])
cylinder(d=3.5,h=1.6);
color("Black")
translate([18,18,2.5])
rotate([0,180,90])
Component(35,22,1);
}
translate([Pitch,Pitch*7.5,0.5])
rotate([0,180,0])
Pins_holes(4,Pitch,0.55);
color("white")
translate([18,8,2])
rotate([0,0,90])
linear_extrude(1)
text("OLED 1.3",size=3);
color("white")
translate([23,11,2])
rotate([0,0,90])
linear_extrude(1)
text("128x64",size=3);
color("silver")
translate([4,3,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([4,33,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([32,3,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
color("silver")
translate([32,33,-1])
rotate([0,0,0])
cylinder(d=2.75,h=10);
}
if(Pins_enabled==1 && Pins_up==0)
translate([Pitch,Pitch*7,1])
rotate([0,0,0])
Pins(4,Pitch);
if(Pins_enabled==1 && Pins_up==1)
translate([Pitch,Pitch*7,0.8])
rotate([0,180,0])
Pins(4,Pitch);
}
OLED_13_128_64_I2C(Pins_enabled,Pins_up);

82
3d/lib/PCB.scad

@ -0,0 +1,82 @@
$fn=36;
PCB_style=1; //1=Cutted board 2=with frame border
PCB_size_X=2.54*20;
PCB_size_Y=2.54*19;
PCB_size_Z=1;
PCB_pitch=2.54;
PCB_holes_diameter=1;
PCB_copper_rings_diameter=2.15;
PCB_copper_rings_thickness=0.1;
PCB_color="Green";
PCB_rings_color="DarkGoldenrod";
module PCB(PCB_size_X,PCB_size_Y,PCB_size_Z,PCB_pitch)
translate([-PCB_pitch*round(PCB_size_X/PCB_pitch/2),-PCB_pitch*round(PCB_size_Y/PCB_pitch/2),0])
{
if(PCB_style==1)
difference()
{
union()
{
color(PCB_color)
cube([PCB_size_X,PCB_size_Y,PCB_size_Z]);
color(PCB_rings_color)
intersection()
{
for(a=[0:PCB_pitch:PCB_size_X+PCB_pitch])
{
for(b=[0:PCB_pitch:PCB_size_Y+PCB_pitch])
{
translate([a,b,-PCB_copper_rings_thickness])
cylinder(d=PCB_copper_rings_diameter,h=PCB_size_Z+PCB_copper_rings_thickness*2);
}
}
translate([0,0,-PCB_size_Z/2])
cube([PCB_size_X,PCB_size_Y,PCB_size_Z*2]);
}
}
color(PCB_rings_color)
for(a=[0:PCB_pitch:PCB_size_X+PCB_pitch])
{
for(b=[0:PCB_pitch:PCB_size_Y+PCB_pitch])
{
translate([a,b,-PCB_size_Z/2])
cylinder(d=PCB_holes_diameter,h=PCB_size_Z*2);
}
}
}
if(PCB_style==2)
difference()
{
union()
{
color(PCB_color)
cube([PCB_size_X,PCB_size_Y,PCB_size_Z]);
color(PCB_rings_color)
for(a=[PCB_pitch:PCB_pitch:PCB_size_X-PCB_pitch/2])
{
for(b=[PCB_pitch:PCB_pitch:PCB_size_Y-PCB_pitch/2])
{
translate([a,b,-PCB_copper_rings_thickness])
cylinder(d=PCB_copper_rings_diameter,h=PCB_size_Z+PCB_copper_rings_thickness*2);
}
}
}
color(PCB_rings_color)
for(a=[PCB_pitch:PCB_pitch:PCB_size_X-PCB_pitch/2])
{
for(b=[PCB_pitch:PCB_pitch:PCB_size_Y-PCB_pitch/2])
{
translate([a,b,-PCB_size_Z/2])
cylinder(d=PCB_holes_diameter,h=PCB_size_Z*2);
}
}
}
}
PCB(PCB_size_X,PCB_size_Y,PCB_size_Z,PCB_pitch);

335
3d/lib/Pin_header.scad

@ -0,0 +1,335 @@
$fn=36;
Pitch=2.54;
Pins_number=10;
Pins_up=1;
Type=0; // 0=vertical 1 row 1=vertical 2 rows 2=90 degrees 1 row 3=90 degrees 2 rows
Solder=1;
module Pins(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,-2])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([0,Pitch*a,-7.6])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Pins_double(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,-2])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([-Pitch,Pitch*a,-2])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([0,Pitch*a,-7.6])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([-Pitch,Pitch*a,-7.6])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([-Pitch,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
color("Black")
translate([-Pitch,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([-Pitch,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(a<Pins_number)
color("Black")
translate([-Pitch/2,Pitch*a,-2])
Component(1,1.6,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([Pitch,Pitch,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Pins_90(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,1])
cube([0.6,0.6,10-6],center=true);
color("Goldenrod")
translate([4.7,Pitch*a,-1.25])
rotate([0,90,0])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([10.3,Pitch*a,-1.25])
rotate([0,-90,0])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,10/2-2])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Pins_90_double(Pins_number,Pitch,Solder)
{
translate([0,-(Pitch*round(Pins_number/2))+Pitch,0])
for(a=[0:1:Pins_number-1])
{
translate([0,0,-10/6])
{
color("Goldenrod")
translate([0,Pitch*a,1])
cube([0.6,0.6,4],center=true);
color("Goldenrod")
translate([-2.54,Pitch*a,1-Pitch/2])
cube([0.6,0.6,4+Pitch],center=true);
color("Goldenrod")
translate([4.7,Pitch*a,-Pitch/2])
rotate([0,90,0])
cube([0.6,0.6,10],center=true);
color("Goldenrod")
translate([4.7-Pitch/2,Pitch*a,-Pitch*1.5])
rotate([0,90,0])
cube([0.6,0.6,10+Pitch],center=true);
color("Goldenrod")
translate([10.3,Pitch*a,-Pitch/2])
rotate([0,-90,0])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([0,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([10.3,Pitch*a,-Pitch*1.5])
rotate([0,-90,0])
rotate([0,0,45])
cylinder(r1=0,r2=0.425,h=0.6,$fn=4);
color("Goldenrod")
translate([-Pitch,Pitch*a,3])
rotate([0,0,45])
cylinder(r2=0,r1=0.425,h=0.6,$fn=4);
}
color("Black")
translate([0,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([0,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
color("Black")
translate([-Pitch,Pitch*a,-2])
Component(2,2,1.25);
if(a<Pins_number-1)
color("Black")
translate([-Pitch,Pitch*a+Pitch/2,-2])
Component(1.6,1,1.25);
if(a<Pins_number)
color("Black")
translate([-Pitch/2,Pitch*a,-2])
Component(1,1.6,1.25);
if(Solder==1)
translate([0,Pitch*a-Pitch,0])
rotate([0,0,90])
{
color("Silver")
translate([Pitch,0,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([Pitch,Pitch,0.35])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
}
}
module Component(X,Y,Z)
{
hull()
{
translate([X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,0])
sphere(r=0.25,$fn=18);
translate([X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
translate([-X/2,-Y/2,Z-0.25])
sphere(r=0.25,$fn=18);
}
}
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
module PIN_HEADER(Pins_number,Pins_up,Type,Solder)
{
if(Pins_up==0)
translate([0,0,0.65])
rotate([0,0,90])
Pins(Pins_number,Pitch,Solder);
if(Pins_up==1)
translate([0,0,0.4])
rotate([0,180,90])
Pins(Pins_number,Pitch,Solder);
}
module PIN_HEADER_DOUBLE(Pins_number,Pins_up,Type,Solder)
{
if(Pins_up==0)
translate([0,0,0.65])
rotate([0,0,90])
Pins_double(Pins_number,Pitch,Solder);
if(Pins_up==1)
translate([0,0,0.4])
rotate([0,180,90])
Pins_double(Pins_number,Pitch,Solder);
}
module PIN_HEADER_90(Pins_number,Pins_up,Type,Solder)
{
if(Pins_up==0)
translate([0,0,0.65])
rotate([0,0,90])
Pins_90(Pins_number,Pitch,Solder);
if(Pins_up==1)
translate([0,0,0.4])
rotate([0,180,90])
Pins_90(Pins_number,Pitch,Solder);
}
module PIN_HEADER_90_DOUBLE(Pins_number,Pins_up,Type,Solder)
{
if(Pins_up==0)
translate([0,0,0.65])
rotate([0,0,90])
Pins_90_double(Pins_number,Pitch,Solder);
if(Pins_up==1)
translate([0,0,0.4])
rotate([0,180,90])
Pins_90_double(Pins_number,Pitch,Solder);
}
module Pin_header(Pins_number,Pins_up,Type,Solder)
{
if(Type==0)
PIN_HEADER(Pins_number,Pins_up,Type,Solder);
if(Type==1)
PIN_HEADER_DOUBLE(Pins_number,Pins_up,Type,Solder);
if(Type==2)
PIN_HEADER_90(Pins_number,Pins_up,Type,Solder);
if(Type==3)
PIN_HEADER_90_DOUBLE(Pins_number,Pins_up,Type,Solder);
}
Pin_header(Pins_number,Pins_up,Type,Solder);

540
3d/lib/Resistor.scad

@ -0,0 +1,540 @@
$fn=36;
Text="4.7k";
Color1="Red";
Color2="Red";
Color3="SaddleBrown";
Color4="GoldenRod";
Orientation=1; //0=Horizontal mounted 1=Vertical mounted
Type=2; //0=1/4W 1=1/2W 2=1W
Solder=1; // 0=no 1=yes
module Resistor(Text,Color1,Color2,Color3,Color4,Orientation,Type,Solder)
{
if(Orientation==0)
{
if(Type==0)
translate([0,0,2.75])
{
color("Khaki")
hull()
{
translate([-2.5,0,0])
sphere(1.25);
translate([2.5,0,0])
sphere(0.5);
}
color("Khaki")
hull()
{
translate([2.5,0,0])
sphere(1.25);
translate([-2.5,0,0])
sphere(1);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.15,h=5,center=true);
color(Color1)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color2)
translate([-1,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color3)
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color4)
translate([1.5,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color("Silver")
translate([0,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*4,center=true);
color("Silver")
translate([2.54*2,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*2,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2,0,-2.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*2,0,-2.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([0,0,0.4])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
if(Type==1)
translate([1.257,0,2.75])
{
color("Khaki")
hull()
{
translate([-3.25,0,0])
sphere(1.5);
translate([2.5,0,0])
sphere(0.5);
}
color("Khaki")
hull()
{
translate([3.25,0,0])
sphere(1.5);
translate([-2.5,0,0])
sphere(1);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.45,h=6,center=true);
color(Color1)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color2)
translate([-1,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color3)
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color4)
translate([1.5,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color("Silver")
translate([0,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*5,center=true);
color("Silver")
translate([2.54*2.5,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*2.5,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*2.5,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([2.54*2.5,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2.5,0,-2.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*2.5,0,-2.75])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([0,0,0.6])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
if(Type==2)
translate([0,0,3.25])
{
color("Khaki")
hull()
{
translate([-4.25,0,0])
sphere(2);
translate([2.5,0,0])
sphere(1.5);
}
color("Khaki")
hull()
{
translate([4.25,0,0])
sphere(2);
translate([-2.5,0,0])
sphere(1.5);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=2,h=8,center=true);
color(Color1)
translate([-3.5,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color2)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color3)
translate([-0.5,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color4)
translate([1,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color("Silver")
translate([0,0,0])
rotate([0,90,0])
cylinder(d=0.55,h=2.54*6,center=true);
color("Silver")
translate([2.54*3,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*3,0,-5])
rotate([0,0,0])
cylinder(d=0.55,h=10,center=true);
color("Silver")
translate([-2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*3,0,-3.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([-2.54*3,0,-3.25])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([0,0,0.6])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
}
if(Orientation==1)
{
if(Type==0)
translate([0,0,6])
rotate([0,90,0])
{
color("Khaki")
hull()
{
translate([-2.5,0,0])
sphere(1.25);
translate([2.5,0,0])
sphere(0.5);
}
color("Khaki")
hull()
{
translate([2.5,0,0])
sphere(1.25);
translate([-2.5,0,0])
sphere(1);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.15,h=5,center=true);
color(Color1)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color2)
translate([-1,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color3)
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color(Color4)
translate([1.5,0,0])
rotate([0,90,0])
cylinder(r=1.25,h=0.5);
color("Silver")
translate([0,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=2.54*4,center=true);
color("Silver")
translate([4.9,0,-2.54])
rotate([90,0,90])
cylinder(d=0.55,h=20,center=true);
color("Silver")
translate([4.9,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=20,center=true);
color("Silver")
translate([-2.54*2,0,-1.257])
rotate([0,0,0])
cylinder(d=0.55,h=2.54,center=true);
color("Silver")
translate([-2.54*2,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*2,0,-2.54])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2.36,0,0])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([2.54*2.36,0,-2.54])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([0,0,0.7])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
if(Type==1)
translate([0,0,6])
rotate([0,90,0])
{
translate([-1.5,0,0])
{
color("Khaki")
hull()
{
translate([-3.25,0,0])
sphere(1.5);
translate([2.5,0,0])
sphere(0.5);
}
color("Khaki")
hull()
{
translate([3.25,0,0])
sphere(1.5);
translate([-2.5,0,0])
sphere(1);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.45,h=6,center=true);
color(Color1)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color2)
translate([-1,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color3)
translate([0,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
color(Color4)
translate([1.5,0,0])
rotate([0,90,0])
cylinder(r=1.5,h=0.5);
}
color("Silver")
translate([0,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=2.54*6,center=true);
color("Silver")
translate([3.65,0,-2.54])
rotate([90,0,90])
cylinder(d=0.55,h=22.5,center=true);
color("Silver")
translate([4.9,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=20,center=true);
color("Silver")
translate([-2.54*3,0,-1.257])
rotate([0,0,0])
cylinder(d=0.55,h=2.54,center=true);
color("Silver")
translate([-2.54*3,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*3,0,-2.54])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*2.36,0,0])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([2.54*2.36,0,-2.54])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([-1.5,0,0.7])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
if(Type==2)
translate([0,0,8])
rotate([0,90,0])
{
translate([-1.5,0,0])
{
color("Khaki")
hull()
{
translate([-4.25,0,0])
sphere(2);
translate([2.5,0,0])
sphere(1.5);
}
color("Khaki")
hull()
{
translate([4.25,0,0])
sphere(2);
translate([-2.5,0,0])
sphere(1.5);
}
color("Khaki")
translate([0,0,0])
rotate([0,90,0])
cylinder(r=2,h=8,center=true);
color(Color1)
translate([-3.5,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color2)
translate([-2,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color3)
translate([-0.5,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
color(Color4)
translate([1,0,0])
rotate([0,90,0])
cylinder(r=2.05,h=0.75);
}
color("Silver")
translate([0,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=2.54*8,center=true);
color("Silver")
translate([3.65,0,-2.54*2])
rotate([90,0,90])
cylinder(d=0.55,h=27.6,center=true);
color("Silver")
translate([4.9,0,0])
rotate([90,0,90])
cylinder(d=0.55,h=25,center=true);
color("Silver")
translate([-2.54*4,0,-2.54])
rotate([0,0,0])
cylinder(d=0.55,h=2.54*2,center=true);
color("Silver")
translate([-2.54*4,0,0])
rotate([0,0,0])
sphere(d=0.55);
color("Silver")
translate([-2.54*4,0,-2.54*2])
rotate([0,0,0])
sphere(d=0.55);
if(Solder==1)
{
color("Silver")
translate([2.54*3.15,0,0])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
color("Silver")
translate([2.54*3.15,0,-2.54*2])
rotate([0,0,0])
scale([1,1,1.1])
sphere(d=2);
}
%color("Black")
translate([-1.5,0,0.7])
linear_extrude(1)
text(Text,size=2,valign="center",halign="center");
}
}
}
Resistor(Text,Color1,Color2,Color3,Color4,Orientation,Type,Solder);

51
3d/lib/Screw_terminal.scad

@ -0,0 +1,51 @@
$fn=36;
Terminal_pitch=2.54*2;
Terminal_positions=2;
module Screw_terminal(Pitch,Positions)
{
for(a=[0:1:Positions-1])
{
difference()
{
union()
{
color("Slategrey")
hull()
{
translate([0,Pitch*a,3.5])
cube([8,Pitch,6],center=true);
translate([0.5,Pitch*a,5.5])
cube([5,Pitch,10],center=true);
}
color("Silver")
translate([0,Pitch*a,0])
cylinder(d=0.75,h=6,center=true);
color("Silver")
translate([0,Pitch*a,-2])
cylinder(r1=0,r2=1,h=1);
}
color("silver")
translate([0.5,Pitch*a,11])
cylinder(d=3,h=6,center=true);
color("DarkGrey")
translate([0.5,Pitch*a,11])
rotate([0,0,45])
cube([0.5,3,10],center=true);
translate([4,Pitch*a,3.5])
cube([8,3,5],center=true);
}
}
}
translate([2.54*12,2.54*2,1.5])
Screw_terminal(Terminal_pitch,Terminal_positions);

64
3d/lib/Solder.scad

@ -0,0 +1,64 @@
$fn=36;
Steps=7;
Type=2;
module Solder(Steps,Type)
translate([0,0,0])
{
if(Type==0)
color("Silver")
hull()
{
translate([0,0,0.8])
rotate([0,0,0])
scale([1,1,0.3])
sphere(d=2);
translate([2.54*(Steps-1),0,0.8])
rotate([0,0,0])
scale([1,1,0.3])
sphere(d=2);
}
if(Type==1)
for(a=[0:1:Steps-1])
{
color("Silver")
translate([2.54*a,0,0])
rotate([0,0,0])
sphere(d=2);
}
if(Type==2)
{
for(a=[0:1:Steps-1])
{
color("Silver")
translate([2.54*a,0,0.8])
rotate([0,0,0])
scale([1,1,0.3])
sphere(d=2);
}
color("Silver")
hull()
{
translate([0,0,0.8])
rotate([0,0,0])
scale([1,1,0.4])
sphere(d=0.5);
translate([2.54*(Steps-1),0,0.8])
rotate([0,0,0])
scale([1,1,0.4])
sphere(d=0.5);
}
}
}
Solder(Steps,Type);

31
3d/lib/aligned_cube.scad

@ -1,31 +0,0 @@
module aligned_cube(size, aligned=[1,1,0])
{
translate(-0.5*[size[0]*aligned[0], size[1]*aligned[1], size[2]*aligned[2]])
cube(size);
}
module rounded_cube(size, r, aligned=[1,1,0])
{
translate(-0.5*[size[0]*aligned[0] -2*r, size[1]*aligned[1] -2*r, size[2]*aligned[2] -2*r])
minkowski() {
cube([size[0] - 2*r, size[1] - 2*r, size[2]- 2*r]);
sphere(r);
}
}
module cylinder_flange_sphere($fn=32,r1=10, r2=15, h=5)
{
diff=abs(r1-r2);
h_off= (r1 < r2 ) ? 0 : h/2;
difference()
{
cylinder($fn=$fn, r=max(r2,r1),h=h);
scale([1,1,h/diff])
rotate_extrude()
translate([diff+min(r2,r1),h_off])
rotate([0,0,0])
circle($fn=$fn,r=diff);
}
}

53
3d/lib/antenna.scad

@ -0,0 +1,53 @@
$fn=32;
eps=0.01;
module antenna() {
d1=[12.8, 12.8, 12.8, 5.85, 5.85, 5.3, 5.85, 5.85,];
d2=[12.8, 12.8, 12.8, 12.8, 5.85, 5.3, 5.85, 5.85,];
h= [180.8, 172, 154, 81, 44, 12, 10.60, 0, ];
difference()
{
translate([0, 0, -h[0]]) {
sphere(d=top_d);
for (i=[0:len(h)-1]) {
translate([0, 0, h[i+1]])
cylinder(d1=d1[i], d2=d2[i], h=h[i]-h[i+1]);
}
}
translate([0, 0, -5.1]) {
sma_connector_male();
}
}
}
module sma_connector_male() {
d=[2, 3.2, 9.1, 8, 9.1, 6.15, ];
fn=[0, 0, 6, 0, 6, 0 , ];
h= [20.5, 16.45, 13.1, 10.75, 8.75, 7.1 , 0];
//translate([0, 0, -h[0]])
{
difference() {
for (i=[0:len(h)-1]) {
translate([0, 0, h[i+1]]) {
if(fn[i] == 0)
cylinder(d=d[i], h=h[i]-h[i+1]);
else
cylinder($fn=fn[i], d=d[i], h=h[i]-h[i+1]);
}
}
translate([0, 0, -eps]) {
cylinder(d=4.6,h=1.75);
}
}
cylinder(d=0.92,h=1.75);
}
}
translate([0,0,0 ])
sma_connector_male();
translate([0,0,-10])
antenna();

141
3d/lib/cube.scad

@ -0,0 +1,141 @@
module aligned_cube(size, aligned=[1,1,0])
{
translate(-0.5*[size[0]*aligned[0], size[1]*aligned[1], size[2]*aligned[2]])
cube(size);
}
module aligned_rounded_cube(size, r=5, rounding=[1,1,1], aligned=[1,1,0])
{
translate(-0.5*[ ( size[0]*aligned[0] -2*r),
( size[1]*aligned[1] -2*r),
( size[2]*aligned[2] -2*r)])
{
eps=0.001;
if( rounding == [1,1,1] ) {
minkowski() {
cube([size[0] - 2*r, size[1] - 2*r, size[2]- 2*r]);
sphere(r);
}
}else if( rounding == [1,1,0] ) {
//cylinder rounding x/y
minkowski() {
translate([ 0,0,-r])
cube([size[0] - 2*r, size[1] - 2*r, size[2]-2*eps]);
cylinder(r=r,h=eps);
}
}else if( rounding == [1,0,1] ) {
//cylinder rounding x/z
minkowski() {
translate([ 0,-r,0])
cube([size[0] - 2*r, size[1] - 2*eps, size[2]- 2*r]);
rotate([90,0]) {
cylinder(r=r,h=eps);
}
}
}else if( rounding == [0,1,1] ) {
//cylinder rounding x/z
minkowski() {
translate([ 0,-r,0])
cube([size[0] - 2*r, size[1] - 2*eps, size[2]- 2*r]);
rotate([90,0]) {
cylinder(r=r,h=eps);
}
}
}
}
}
module rounded_cube(size, r, rounding=[0,0,0])
{
aligned_rounded_cube(size, r, rounding=[0,0,0], aligned=[0,0,0]);
}
module axis(l=30, w=0.3) {
color("red")
cube([l,w,w]);
color("blue")
cube([w,w,l]);
color("green")
cube([w,l,w]);
color("black")
cube([w,w,w]);
}
// test show
translate([-45,45,0]) {
translate([0,-90,0]) {
axis();
%cube(size=[10,10,10]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "cube()");
}
translate([0,10,0]) {
axis();
%aligned_cube(size=[10,10,10], aligned=[1,1,1]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_cube([1,1,1])");
}
translate([0,-30,0]) {
axis();
%aligned_rounded_cube(size=[10,10,10],r=1, aligned=[1,1,0]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube([1,1,0])");
}
translate([50,10,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=1, aligned=[1,1,0]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube(r=1)");
}
translate([50,-30,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=2, aligned=[1,1,0]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube(r=2)");
}
translate([100,10,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=2, rounding=[1,1,1]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube([1,1,1])");
}
translate([100,-30,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=2, rounding=[1,1,0]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube([1,1,0])");
}
translate([100,-60,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=2, rounding=[1,0,1]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube([1,0,1])");
}
translate([100,-90,0]) {
$fn=32;
axis();
%aligned_rounded_cube(size=[10,10,10],r=2, rounding=[0,1,1]);
translate([0,-10,0])
text(halign="center",valign="center", $fn=$fn, size=3,font="Linux Libertine O", "aligned_rounded_cube([0,1,1])");
}
}

14
3d/lib/cylinder.scad

@ -0,0 +1,14 @@
module cylinder_flange_sphere($fn=32,r1=10, r2=15, h=5)
{
diff=abs(r1-r2);
h_off= (r1 < r2 ) ? 0 : h/2;
difference() {
cylinder($fn=$fn, r=max(r2,r1),h=h);
scale([1,1,h/diff])
rotate_extrude()
translate([diff+min(r2,r1),h_off])
rotate([0,0,0])
circle($fn=$fn,r=diff);
}
}

101
3d/lib/example.scad

@ -0,0 +1,101 @@
$fn=36;
use<PCB.scad>;
use<Resistor.scad>;
use<IC_TO220.scad>;
use<INA_3221_I2C.scad>;
use<Arduino nano.scad>;
use<LCD_1602_I2C.scad>;
use<Pin_header.scad>;
use<Solder.scad>;
difference()
{
union()
{
//PCB(PCB_size_X,PCB_size_Y,PCB_size_Z,PCB_pitch,PCB_style);
translate([0,0,0])
PCB(2.54*35,2.54*27,1,2.54,2);
//----------------------------------------------------------------------------------------------------------
//Arduino_nano(Connection_pins_enabled,Connection_pins_up,6_pins_enabled,6_pins_up);
translate([2.54*9,-2.54*8,0])
rotate([0,0,90])
Arduino_nano(1,0,0,0);
//----------------------------------------------------------------------------------------------------------
//LCD_1602_Serial(Pins_enabled,Pins_up,Version,Text1,Text2);
translate([-2.54*11,-2.54,10])
rotate([0,0,90])
LCD_1602_I2C(1);
//Top Side solder track
//5V track
translate([2.54*5,-2.54*6,0])
rotate([0,0,90])
Solder(2,0);
translate([-2.54*14,-2.54*13,0])
rotate([0,0,90])
Solder(8,0);
translate([-2.54*15,-2.54*4,0])
rotate([0,0,0])
Solder(19,0);
//GND track
translate([2.54*3,-2.54*5,0])
rotate([0,0,90])
Solder(2,0,0);
translate([-2.54*15,-2.54*13,0])
rotate([0,0,90])
Solder(10,0);
translate([-2.54*14,-2.54*6,0])
rotate([0,0,0])
Solder(20,0);
}
//Chopping off lower part of legs
translate([0,0,-51.5])
cube([200,200,100],center=true);
}
//Lower side components
//Needs to be a different thread to cut the legs of the components
difference()
{
union()
{
//Bottom side solder tracks
translate([-2.54*13,-2.54*4,0])
rotate([0,180,90])
Solder(10,0);
translate([2.54*9,-2.54*4,0])
rotate([0,180,90])
Solder(2,0);
translate([2.54*9,-2.54*4,0])
rotate([0,180,0])
Solder(23,0);
translate([-2.54*12,-2.54*6,0])
rotate([0,180,90])
Solder(8,2);
translate([2.54*8,-2.54*5,0])
rotate([0,180,90])
Solder(2,2);
translate([2.54*8,-2.54*6,0])
rotate([0,180,0])
Solder(21,2);
}
//Chopping off lower part of legs
translate([0,0,51.5])
cube([200,200,100],center=true);
}

526
3d/remote.scad

@ -0,0 +1,526 @@
use <lib/cube.scad>;
use <lib/cylinder.scad>;
use <lib/triangle.scad>;
use <lib/antenna.scad>;
use <stick.scad>;
use <lib/LCD_1602_I2C.scad>;
use <lib/PCB.scad>;
use <lib/Arduino_nano.scad>;
show_switch=1;
show_lcd=1;
show_sticks=1;
name="phschoen";
text_pos=[[-10,-18,0], [10,-18,0], [-55,49,0], [-25,49,0], [0,40,0], [25,49,0], [55,49,0] ];
top_text=["on", "armed", "some", "thing", "needs", "to be", "configur"];
bot_text=["off", "disarmed", "", "", "", "", "" ];
eps=0.1;
$fn=32;
module lcd_1602() {
pcb=[80,36,1.6];
metal_case=[71.2, 24.2, 6.5];
case_lcd_cut=[64.5, 14.5, 6.5+2*eps];
// metal case
difference() {
translate([0,0,pcb[2]])
aligned_cube(metal_case,[1,1,0]);
translate([0,0,pcb[2]])
aligned_cube(case-2,[1,1,0]);
// glas cut
translate([0,0,pcb[2]-eps])
aligned_cube(case_lcd_cut,[1,1,0]);
}
// glas cut
color("blue")
translate([0,0,0])
aligned_cube(case_lcd_cut,[1,1,0]);
// pcb
color("green")
aligned_cube(pcb,[1,1,0]);
}
module ps2_pad() {
// pcb
difference()
{
pcb=[26, 34, 1.6];
color([0.2, 0.2, 0.2]) {
aligned_cube(pcb,[0,0,0]);
}
// mounting holes
r=3.4/2;
color([0.8, 0.8, 0.8])
for (i = [
[ 1.4+r, 3.3+r, -0.1], // bot left
[pcb[0]-(1.4+r), 3.3+r, -0.1], // bot right
[pcb[0]-(1.4+r), pcb[1]-(1.6+r), -0.1], // top right
[ (1.4+r), pcb[1]-(1.6+r), -0.1], // top left
]) {
translate(i)
cylinder($fn=16, r=r, h=0.2 + pcb[2]);
}
}
// pins
{
}
}
//ps2_pad();
//pin_angled();
module pin_angled(pins=4, angled=true) {
w=0.65;
pin_angled=[w, 7-w, w];
pin_vertical=[w, w, 7.2-w];
plastic=[2.16,12.6];
color([0.8,0.8,0.8]) {
// vertical pin part
translate([0,0,0])
aligned_cube(pin_vertical, [1,0,0]);
// angled pin part
translate([0,w,7.2])
aligned_cube(pin_angled, [1,0,2]);
difference() {
d=1.5;
translate([0,d/2,7.2-d/2])
rotate([0,90,0])
translate([0,0,-w/2])
cylinder($fn=32,d=d, h=w);
translate([0,w+d/2,7.2-d/2-w])
rotate([0,90,0])
translate([0,0,-w/2-eps])
cylinder($fn=32,d=d, h=w+2*eps);
}
}
}
module remote() {
bottom_case();
top_case();
if (show_sticks) {
if($t < 0.25)
sticks($t*4,0);
else if($t < 0.5)
sticks(1,($t-0.25)*4);
else if($t < 0.75)
sticks(1-($t-0.5)*4,1);
else
sticks(0,1-($t-0.75)*4);
}
}
module sticks(l1,l2)
{
max_angle=30;
color("orange")
for(i=[1,-1]) {
translate([40*i,20,-10]) {
rotate([max_angle*(l1*2-1),max_angle*(l2*2-1),0])
translate([0,0,8]) {
stick(h=20);
}
}
}
}
module top_case() {
difference() {
thick=2.5;
union() {
hull() {
remote_top_plate_1=[150,110,1];
remote_top_plate_2=[140,120,thick];
remote_top_plate_3=[100,135,thick];
aligned_rounded_cube(remote_top_plate_1,2,[1,1,0],[1,1,0]);
aligned_rounded_cube(remote_top_plate_2,2,[1,1,0],[1,1,0]);
aligned_rounded_cube(remote_top_plate_3,2,[1,1,0],[1,1,0]);
}
{
for(i=[0:1:len(text_pos)-1]) {
translate(text_pos[i])
button_with_text(thick=thick+2*eps,
text_size=4,
top_text=top_text[i],
bottom_text=bot_text[i]);
}
}
// lcd screw holder
translate([0, -45,0])
translate([-40.6,-20.25,0])
{
// screwsholders
h=9.75;
translate([0,1,thick-h]){
translate([2.5,4,-1]) rotate([0,0,0])
difference() {cylinder(d=5.1,h=h); translate([0,0,-eps]) cylinder(d=2.9, h=4);};
translate([2.5,35,-1]) rotate([0,0,0])
difference() {cylinder(d=5.1,h=h); translate([0,0,-eps]) cylinder(d=2.9, h=4);};
translate([78.5,4,-1]) rotate([0,0,0])
difference() {cylinder(d=5.1,h=h); translate([0,0,-eps]) cylinder(d=2.9, h=4);};
translate([78.5,35,-1]) rotate([0,0,0])
difference() {cylinder(d=5.1,h=h); translate([0,0,-eps]) cylinder(d=2.9, h=4);};
}
}
// button holders
{
for(i=[0:1:len(text_pos)-1]) {
translate([0,0,thick-10])
translate(text_pos[i])
difference() {
aligned_cube([11,10,8]);
translate([0,0,-7.25])
aligned_cube([8.5,13,10]);
}
}
}
// stm32 holder
// TODO
translate([48,-15,0]) {
rotate([0,180,180])
%stm32_bluepill();
}
translate([0,70,-15]) {
rotate([90,0,0])
color("darkgray")
%antenna();
}
translate([0,10,-3]) {
rotate([0,0,90])
%cc2500();
}
}
//lcdcutout
translate([0,-45,-eps]) {
color("green") {
aligned_rounded_cube(size=[64,14,5+2*eps], r=2, rounding=[1,1,0]);
hull() {
e=10;
translate([0,0,0.6])
aligned_rounded_cube(size=[65,15,eps], r=2, rounding=[1,1,0]);
translate([0,0,0.6+thick])
aligned_rounded_cube(size=[65+e,15+e,eps], r=2, rounding=[1,1,0]);
}
}
if(show_lcd)
{
translate([0,1,-10])
%LCD_1602_I2C(PinsDown,
"RSSI 99 A99 ",
" ARMED A99 ");
}
}
// stick cutouts
color("orange")
for(i=[1,-1]) {
w=36;
r=14;
translate([40*i,20,-eps]) {
//aligned_rounded_cube(size=[w,w,thick+2*eps], r=2, rounding=[1,1,0]);
aligned_rounded_cube(size=[w,w,thick+2*eps], r=r, rounding=[1,1,0]);
hull() {
e=5;
translate([0,0,thick])
aligned_rounded_cube(size=[w,w,eps], r=r, rounding=[1,1,0]);
translate([0,0,0])
aligned_rounded_cube(size=[w+e,w+e,eps], r=r, rounding=[1,1,0]);
}
hull() {
e=2;
translate([0,0,thick+0.3])
aligned_rounded_cube(size=[w+e,w+e,eps], r=r, rounding=[1,1,0]);
translate([0,0,thick-1])
aligned_rounded_cube(size=[w,w,eps], r=r, rounding=[1,1,0]);
}
}
}
// buttons cutouts and naming
translate([0,0,-eps]) {
translate([0,61,0])
text_engave(thick, text_size=5, text_=name);
translate([0,-61,0])
text_engave(thick, text_size=5, text_="toolbox v1");
// buttons
for(i=[0:1:len(text_pos)-1]) {
translate(text_pos[i])
button_with_text(thick=thick+2*eps,
text_size=4,
top_text=top_text[i],
bottom_text=bot_text[i]);
}
}
}
}
module button_with_text(thick=4,text_size=5, top_text="on",bottom_text="off")
{
dist_text=10.5;
cylinder(d=5.8, h=thick+2*eps);
translate([0,0,-5])
if(show_switch) {
%switch(thick);
}
//
color("gray")
translate([0,0,thick-1])
union() {
cylinder(d=12, h=1);
aligned_cube([2.6,8,1],[1,0,0]);
}
translate([0,dist_text,0])
text_engave(thick, text_size=text_size, text_=top_text);
translate([0,1-dist_text,0])
text_engave(thick, text_size=text_size, text_=bottom_text);
}
module text_engave(thick, text_size, text_)
{
color("black")
translate([0,0,thick-0.5]) {
linear_extrude(height = 0.75) {
translate([0,dist_text,0]) {
text(
halign="center",
valign="center",
$fn=$fn,
size=text_size,
font="Linux Libertine O",
text_
);
}
}
}
}
module bottom_case() {
}
module switch() {
// screw
cylinder(d=5.75,h=8.75);
translate([0,0,8.75])
rotate([24,0,0]) {
// stick
sphere(d=3);
cylinder(d=3,h=8.5);
translate([0,0,8.5])
sphere(d=3);
}
// body
aligned_cube([8.05,13,10],[1,1,2]);
// pins
for(i=[1,0,-1]) {
translate([0, i*4.5,-10])
difference() {
aligned_cube([2,0.7, 4.2], [1,1,2]);
translate([0,0,-3])
rotate([0,90,0])
cylinder(d=1, h=2, center=true);
}
}
// screw place
/* difference() { */
/* cylinder(d=10.2, h=1); */
/* translate([0,0,-0.1]) */
/* cylinder(d=6.1, h=2); */
/* } */
// top plate
translate([0,0,7])
difference() {
union() {
cylinder(d=12, h=0.7);
aligned_cube([2.6, 8, 0.7],[0,1,0]);
}
translate([0,0,-0.1])
cylinder(d=6.1, h=2);
}
// top screw
translate([0,0,7.7])
difference() {
cylinder($fn=6, d=9.4, h=0.7);
translate([0,0,-0.1])
cylinder(d=6.1, h=2);
}
}
module stm32_bluepill() {
eps=0.1;
pitch=2.54;
pcb_size=[52.3, 22.6, 1.6];
pin_offset=[ [2.35,3.65], [2.35, 18.6]];
pin_names=[ [
"G", "G", "3.3", "R", "B11", "B10", "B1", "B0", "A7", "A6",
"A5", "A4", "A3", "A2", "A1", "A0", "C15", "C14", "C13", "VB",
], [
"B12", "B13", "B14", "B15", "A8", "A9", "A10", "A11", "A12",
"A15", "B3", "B4", "B5", "B6", "B7", "B8", "B9", "5V", "G", "3.3",
]];
difference() {
union() {
//pcb
color("LightBlue") {
aligned_cube(pcb_size);
}
// IC
color("black")
rotate([0,0,45])
translate([0,0,pcb_size[2]])
aligned_cube([7,7,2],[1,1,0]);
// IC pins
color("silver")
rotate([0,0,45])
translate([0,0,pcb_size[2]])
aligned_cube([8,8,1],[1,1,0]);
translate([pcb_size[0]/2,0 ,pcb_size[2]])
usb_micro();
// pins pads
for(p=[0,1])
for(i=[0:1:len(pin_names[p])-1]) {
translate([-pcb_size[0]/2+pin_offset[p][0]+i*pitch,
-pcb_size[1]/2+pin_offset[p][1],-eps])
{
color("silver") {
cylinder(d=1.5,h=pcb_size[2]+2*eps);
}
color("black") {
translate([0,(p-0.5)*2*2,pcb_size[2]+eps])
linear_extrude(height = eps)
text(
halign="center",
valign="center",
$fn=$fn,
size=1,
font="Linux Libertine O",
pin_names[p][i]
);
}
}
}
}
// pin drill hole
for(p=[0,1])
for(i=[0:1:len(pin_names[p])-1]) {
translate([-pcb_size[0]/2+pin_offset[p][0]+i*pitch,
-pcb_size[1]/2+pin_offset[p][1],-2*eps])
color("Silver") {
cylinder(d=0.7,h=pcb_size[2]+4*eps);
}
}
}
}
module usb_micro() {
color("Silver")
difference() {
size= [7.45, 6, 2.5];
aligned_cube(size,[2,1,0]);
}
}
module cc2500() {
eps=0.1;
pitch=2;
pcb_size=[34.3, 21.4, 0.9];
pin_offset=[0.25,2];
pin_names=[
"LNA_EN",
"PA_EN",
"CSn",
"GDO0",
"GND",
"GDO2",
"SO",
"SCLK",
"SI",
"VCC"
];
difference() {
union() {
//pcb
color("LightBlue") {
aligned_cube(pcb_size);
}
// hf cage
color("silver")
translate([0,0,pcb_size[2]])
aligned_cube([26.84,19.75,3.2],[1,1,0]);
// pins pads
for(i=[0:1:len(pin_names)-1]) {
translate([-pcb_size[0]/2+pin_offset[0],
-pcb_size[1]/2+pin_offset[1]+i*pitch,-eps])
{
color("silver") {
cylinder(d=1.5,h=pcb_size[2]+2*eps);
}
color("black") {
rotate([180,0])
translate([1,0,-eps])
linear_extrude(height = eps)
text(
halign="left",
valign="center",
$fn=$fn,
size=1,
font="Linux Libertine O",
pin_names[i]
);
}
}
}
}
// pin drill hole
for(p=[0,1])
for(i=[0:1:len(pin_names)-1]) {
translate([-pcb_size[0]/2+pin_offset[0],
-pcb_size[1]/2+pin_offset[1]+i*pitch,-2*eps])
color("Silver") {
cylinder(d=0.7,h=pcb_size[2]+4*eps);
}
}
}
}
remote();

106
3d/stick.scad

@ -0,0 +1,106 @@
// hight of stick from the cone
// throttle has different mounting slot at the bottom then the roll stick
// throttle has a metal stick and roll has a ps2 plastic shaft
use <lib/cube.scad>
// draw itself
stick();
module stick(h=25)
{
$fn=32;
translate([0,0,15]) {
cylinder(d=5,h=h);
translate([0,0,h])
// top nob to grab
gabber_part();
}
// stick holder with cutout
stick_mount();
// dust protector
protector_cone();
}
module gabber_part() {
difference() {
union() {
cylinder(d1=5,d2=8,h=4);
translate([0,0,4])
cylinder(d1=8,d2=8,h=4);
translate([0,0,8])
cylinder(d1=8,d2=4,h=3);
}
for (rot=[0:15:360]) {
r=0.5;
// top grips
translate([0,0,8])
rotate([0,0,rot])
rotate([0,90,0])
translate([-3,0,0])
cylinder($fn=4,r=r,h=40);
// head grips
translate([0,0,8.5])
rotate([0,0,rot])
rotate([0,35,0])
translate([-3,0,-10])
cylinder($fn=4,r=r,h=40);
// vertiacal grips
rotate([0,0,rot])
translate([4,0,0])
cylinder($fn=4,r=r,h=10);
// bottom grips
translate([0,0,2])
rotate([0,0,rot])
rotate([0,21,0])
translate([3,0,0])
cylinder($fn=4,r=r,h=20);
}
}
}
module stick_mount(is_ps2_shaft=1) {
ps2_dia=4*1.269;
ps2_hight=5;
ps2_width=3*1.276;
eps = 0.01;
difference() {
color([1,0,1]) {
if ( is_ps2_shaft ) {
cylinder(d=6.75,h=15);
} else {
cylinder(d=6,h=15);
}
}
translate([0,0,-eps])
if ( is_ps2_shaft ) {
intersection() {
cube(center=true,[ps2_width,100,100]);
cylinder(d=ps2_dia,h=ps2_hight);
}
translate([0,0,ps2_hight])
cylinder(d1=ps2_dia,d2=1.5,h=1.5);
} else {
aligned_cube([1.9,1.15,6],[0,0,0]);
}
}
}
module protector_cone() {
//dust protector
difference() {
union() {
sphere(d=30);
translate([0,0,12])
cylinder(d2=3,d1=17.5,h=7);
}
translate([-15,-15,-30])
cube([30,30,30]);
sphere(d=26);
}
}
Loading…
Cancel
Save