├── pcb ├── sym-lib-table ├── mainPCB.jpeg ├── mainPCB.pdf ├── bom │ ├── Parts.ods │ ├── datasheet.ods │ ├── pickplaceTop.pdf │ ├── SeeedOrder.csv │ ├── SelfSolderingParts.csv │ ├── AllPartslist.csv │ └── mainPCB-all.pos ├── gerber │ ├── mainPCB-NPTH.drl │ ├── mainPCB-Edge.Cuts.gm1 │ ├── mainPCB-B.SilkS.gbo │ └── mainPCB-PTH.drl ├── mainPCB.pro ├── Relais.sch ├── ProtectedInput.sch ├── F9P-IO.sch ├── motorDriver.sch ├── IMU.sch ├── RS232.sch ├── canTransceiver.sch ├── ADS-Input.sch ├── powerSupply.sch ├── I2C-Signal.sch ├── usbUart.sch └── LAN8720.sch ├── .gitignore ├── cases ├── Test-Setup │ ├── Middle.scad │ ├── Base.scad │ └── top.scad └── Basic-1xF9P │ ├── Case_MainCover.scad │ └── Case_Baseplate.scad ├── LICENSE ├── code ├── Load-Test │ ├── Load-Test.ino │ ├── Adafruit_ADS1015.h │ └── Adafruit_ADS1015.cpp ├── HW-Test-Responder │ └── HW-Test-Responder.ino ├── HW-Test │ ├── Adafruit_ADS1015.h │ └── Adafruit_ADS1015.cpp └── LSM9DS1-IronCompensation │ └── LSM9DS1-IronCompensation.ino └── README.md /pcb/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | ) 3 | -------------------------------------------------------------------------------- /pcb/mainPCB.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doppelgrau/esp32-f9p-io-board/HEAD/pcb/mainPCB.jpeg -------------------------------------------------------------------------------- /pcb/mainPCB.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doppelgrau/esp32-f9p-io-board/HEAD/pcb/mainPCB.pdf -------------------------------------------------------------------------------- /pcb/bom/Parts.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doppelgrau/esp32-f9p-io-board/HEAD/pcb/bom/Parts.ods -------------------------------------------------------------------------------- /pcb/bom/datasheet.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doppelgrau/esp32-f9p-io-board/HEAD/pcb/bom/datasheet.ods -------------------------------------------------------------------------------- /pcb/bom/pickplaceTop.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doppelgrau/esp32-f9p-io-board/HEAD/pcb/bom/pickplaceTop.pdf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #OS junk files 2 | [Tt]humbs.db 3 | *.DS_Store 4 | 5 | # kicad 6 | pcb/*.bak 7 | pcb/*.kicad_pcb-bak 8 | -------------------------------------------------------------------------------- /pcb/gerber/mainPCB-NPTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C3.200 4 | T2C3.250 5 | T3C4.300 6 | % 7 | G90 8 | G05 9 | T1 10 | X148.209Y-105.791 11 | X28.575Y-82.423 12 | X28.575Y-65.532 13 | X115.169Y-53.706 14 | T2 15 | X96.774Y-48.524 16 | X108.204Y-48.524 17 | T3 18 | X28.511Y-44.958 19 | X28.321Y-104.902 20 | X169.926Y-44.958 21 | X170.117Y-104.902 22 | T0 23 | M30 24 | -------------------------------------------------------------------------------- /pcb/gerber/mainPCB-Edge.Cuts.gm1: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.0.2-bee76a0~70~ubuntu18.04.1* 2 | G04 #@! TF.CreationDate,2019-09-07T22:00:11+02:00* 3 | G04 #@! TF.ProjectId,mainPCB,6d61696e-5043-4422-9e6b-696361645f70,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW 5.0.2-bee76a0~70~ubuntu18.04.1) date Sa 07 Sep 2019 22:00:11 CEST* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %ADD10C,0.150000*% 14 | G04 APERTURE END LIST* 15 | D10* 16 | X17462500Y-37465000D02* 17 | X17462500Y-110617000D01* 18 | X177482500Y-37465000D02* 19 | X17462500Y-37465000D01* 20 | X177482500Y-110617000D02* 21 | X177482500Y-37465000D01* 22 | X17462500Y-110617000D02* 23 | X177482500Y-110617000D01* 24 | M02* 25 | -------------------------------------------------------------------------------- /pcb/gerber/mainPCB-B.SilkS.gbo: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,5.0.2-bee76a0~70~ubuntu18.04.1* 2 | G04 #@! TF.CreationDate,2019-09-07T22:00:11+02:00* 3 | G04 #@! TF.ProjectId,mainPCB,6d61696e-5043-4422-9e6b-696361645f70,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Legend,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW 5.0.2-bee76a0~70~ubuntu18.04.1) date Sa 07 Sep 2019 22:00:11 CEST* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.150000*% 15 | G04 APERTURE END LIST* 16 | D10* 17 | X17462500Y-37465000D02* 18 | X17462500Y-110617000D01* 19 | X177482500Y-37465000D02* 20 | X17462500Y-37465000D01* 21 | X177482500Y-110617000D02* 22 | X177482500Y-37465000D01* 23 | X17462500Y-110617000D02* 24 | X177482500Y-110617000D01* 25 | M02* 26 | -------------------------------------------------------------------------------- /pcb/mainPCB.pro: -------------------------------------------------------------------------------- 1 | update=So 25 Aug 2019 16:41:57 CEST 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | [schematic_editor] 35 | version=1 36 | PageLayoutDescrFile= 37 | PlotDirectoryName=mainPCB.pdf 38 | SubpartIdSeparator=0 39 | SubpartFirstId=65 40 | NetFmtName= 41 | SpiceAjustPassiveValues=0 42 | LabSize=50 43 | ERC_TestSimilarLabels=1 44 | -------------------------------------------------------------------------------- /pcb/bom/SeeedOrder.csv: -------------------------------------------------------------------------------- 1 | Designator,MPN/Seeed SKU,Qty 2 | "C1, C3, C4, C2, C8, C12, C19, C21, C27, C26, C28, C30, C29, C32, C39, C41, C36, C38, C45, C44, C46, C43, C42, C51, C49, C48,C35",302010165,27 3 | "C5, C10, C11, C9, C20, C25, C37", C2012X5R1E226MT000E,7 4 | "C7, C50",302010178,2 5 | "C14, C15, C17, C18, C16, C23, C24",CL21C102JBCNNNC,7 6 | "C31, C40",302010148,2 7 | C34,202R18W102KV4E,1 8 | C47,302010175,1 9 | D2,304090039,1 10 | D5,304090046,1 11 | D9,304090057,1 12 | "D7, D8, D11",SD0805S020S1R0,3 13 | D10,BAT54CLT1G,1 14 | F1,3413.0329.22,1 15 | FB1,1-1624117-7,1 16 | IC1,FXL6408UMX,1 17 | IC2,ATA6561-GAQW-N,1 18 | IC3,ICL3221EIVZ,1 19 | J14,105017-0001,1 20 | PS1,V78E05-1000-SMT-TR,1 21 | "Q2, Q1","BC817-40,215",2 22 | "R1, R25, R33, R39, R38, R41",301010351,6 23 | "R3, R17",CRCW0805620RFKEAC,2 24 | "R10, R6, R18, R20, R24, R23, R22, R31, R35",CRCW080547K0FKEAC,9 25 | "R11, R12, R13, R7, R8, R9, R36, R37, R40",301010311,9 26 | "R14, R26, R27, R30, R29, R43, R50, R51, R52, R53",301012194,10 27 | "R2, R16, R15, R54",RC0805FR-0724RL,4 28 | "R19, R21, R32, R48",0805W8F1212T5E,4 29 | R28,RC0805FR-07220KL,1 30 | R34,0805W8F2212T5E,1 31 | "R42, R44",301011479,2 32 | "R45, R46, R47, R49",0805W8F499JT5E,4 33 | SW1,PTS645SM43SMTR92LFS,1 34 | U1,ESP32-WROOM-32,1 35 | U2,AZ1117IH-3.3TRG1,1 36 | "U3, U5, U9",VNH7070ASTR,3 37 | U4,ADS1115IDGSR,1 38 | U6,PCA9306DCTR,1 39 | U7,TPD3E001DRLR,1 40 | U8,CP2102N-A01-GQFN24R,1 41 | U10,NUD3124LT1G,1 42 | U11,LAN8720A-CP-TR-ABC,1 43 | U12,LSM9DS1TR,1 44 | -------------------------------------------------------------------------------- /cases/Test-Setup/Middle.scad: -------------------------------------------------------------------------------- 1 | $fn=60; 2 | 3 | // methoden 4 | module holder(edge=[0,0,0]) { 5 | translate(edge){ 6 | rotate([0,0,90]) difference(){ 7 | union() { 8 | translate([0,10,0]) cube([10,10,5]); 9 | translate([0,15,5]) rotate([0,90,0]) cylinder(h=10, d=10); 10 | }; 11 | translate([0,15,5]) rotate([0,90,0]) cylinder(h=10, d=5); 12 | translate([0,4,10]) cube([10,4,3]); 13 | translate([0,12,10]) cube([10,4,3]); 14 | }; 15 | }; 16 | }; 17 | 18 | 19 | // main 20 | difference() { 21 | cube([95,195,10]); 22 | // cut for the base layer 23 | translate([5,170,0]) cube([10.4,25,10]); 24 | translate([80,170,0]) cube([10.4,25,10]); 25 | translate([20,175,0]) cube([10.4,20,10]); 26 | translate([65,175,0]) cube([10.4,20,10]); 27 | // screw hole 28 | translate([0,180,5]) rotate([0,90,0]) cylinder(h=20, d=5); 29 | translate([75,180,5]) rotate([0,90,0]) cylinder(h=20, d=5); 30 | // dent for the front hinge of the top plate 31 | translate([85,0,14]) rotate([-90,0,0]) cylinder(h=5, d=13); 32 | 33 | //easier access to the screws 34 | translate([0,185,0]) cube([21,10,10]); 35 | translate([74,185,0]) cube([21,10,10]); 36 | // place as stopper 37 | translate([80,15,0]) cube([20,145,10]); 38 | // edge for holder on the top layer 39 | translate([30,0,0]) rotate([0,0,-45]) cube([30,28.3,10]); 40 | cube([50,20,10]); 41 | } 42 | 43 | 44 | // holder 45 | holder(edge=[100,160,10]); 46 | holder(edge=[100,5,10]); 47 | -------------------------------------------------------------------------------- /cases/Test-Setup/Base.scad: -------------------------------------------------------------------------------- 1 | $fn=60; 2 | 3 | // methoden 4 | module holder(edge=[0,0,0]) { 5 | translate(edge){ 6 | difference(){ 7 | union() { 8 | cube([10,20,30]); 9 | translate([0,10,0]) cube([10,10,35]); 10 | translate([0,15,35]) rotate([0,90,0]) cylinder(h=10, d=10); 11 | }; 12 | translate([0,15,35]) rotate([0,90,0]) cylinder(h=10, d=5); 13 | translate([0,4,10]) cube([10,4,3]); 14 | translate([0,12,10]) cube([10,4,3]); 15 | }; 16 | }; 17 | }; 18 | 19 | module pcbHolder(center=[0,0,0],h=12,d=10, screw=2) { 20 | translate(center){ 21 | difference() { 22 | union() { 23 | cube([d,d,h], center=true); 24 | }; 25 | translate([0,0,1]) cylinder(h=h+1, r=screw/2); 26 | }; 27 | }; 28 | }; 29 | 30 | 31 | // main 32 | translate([0,0,-6]) difference() { 33 | cube([95,185,6]); 34 | // for clamp 35 | translate([35,0,2]) cube([25,40,5]); 36 | // for resistors 37 | translate([15,133,1]) cube([60,14,5]); 38 | translate([15,098,1]) cube([60,14,5]); 39 | translate([15,080,1]) cube([60,14,5]); 40 | translate([15,045,1]) cube([60,14,5]); 41 | } 42 | // stopper 43 | translate([25,165,0]) cube([40,10,30]); 44 | translate([0,20,0]) cube([4,20,30]); 45 | translate([91,0,0]) cube([4,12,30]); 46 | 47 | // holder 48 | holder(edge=[5,165,0]); 49 | holder(edge=[80,165,0]); 50 | pcbHolder([12,153,5]); 51 | pcbHolder([72,153,5]); 52 | pcbHolder([12,11,5]); 53 | pcbHolder([72,11,5]); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | If not stated explicitly other in any file, the following license should apply: 2 | 3 | BSD 3-Clause License 4 | 5 | Copyright (c) 2019, doppelgrau 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | 1. Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | 3. Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /code/Load-Test/Load-Test.ino: -------------------------------------------------------------------------------- 1 | // IO pins -------------------------------- 2 | #define VNH_A_PWM 4 3 | #define VNH_A_E1 0 4 | #define VNH_A_E2 2 5 | #define VNH_B_PWM 12 6 | #define I2C_SDA 32 7 | #define I2C_SCL 33 8 | // includes 9 | #include 10 | 11 | 12 | void setup() { 13 | // initialize PINs for VNHs 14 | pinMode(VNH_A_PWM, OUTPUT); 15 | pinMode(VNH_A_E1, OUTPUT); 16 | pinMode(VNH_A_E2, OUTPUT); 17 | pinMode(VNH_B_PWM, OUTPUT); 18 | 19 | // PWM for outputs 20 | // PWM-Channel 21 | ledcSetup(0, 10000, 8); 22 | // IO-PINs 23 | ledcAttachPin(VNH_A_PWM, 0); 24 | ledcAttachPin(VNH_B_PWM, 0); 25 | 26 | 27 | 28 | // I2C 29 | Wire.begin(I2C_SDA, I2C_SCL, 400000); 30 | 31 | // Baustein konfigurieren 32 | // direction (Input/Output) 33 | setByteI2C(0x43, 0x03, 0b11101111); 34 | // disable High-Z on outputs 35 | setByteI2C(0x43, 0x07, 0b00010000); 36 | // en-/disable Pullup/downs 37 | setByteI2C(0x43, 0x0B, 0b00010000); 38 | // set direction of the pull 39 | setByteI2C(0x43, 0x0D, 0b00010000); 40 | 41 | } 42 | void loop() { 43 | // duty cyle 44 | ledcWrite(0, 230); 45 | 46 | digitalWrite(VNH_A_E1, HIGH); 47 | digitalWrite(VNH_A_E2, LOW); 48 | setByteI2C(0x43, 0x05, 0b10100010); 49 | 50 | // warten 0,5s 51 | delay(500); 52 | 53 | // duty cyle 54 | ledcWrite(0, 25); 55 | 56 | // und andersherum 57 | digitalWrite(VNH_A_E1, LOW); 58 | digitalWrite(VNH_A_E2, HIGH); 59 | setByteI2C(0x43, 0x05, 0b01000100); 60 | // warten 0,5s 61 | delay(500); 62 | } 63 | 64 | 65 | uint8_t getByteI2C(int address, int i2cregister) { 66 | Wire.beginTransmission(address); 67 | Wire.write(i2cregister); 68 | Wire.endTransmission(false); 69 | uint8_t state = Wire.requestFrom(address, 1, (int)true); 70 | return Wire.read(); 71 | } 72 | 73 | 74 | uint8_t setByteI2C(int address, byte i2cregister, byte value) { 75 | Wire.beginTransmission(address); 76 | Wire.write(i2cregister); 77 | Wire.write(value); 78 | return Wire.endTransmission(); 79 | } 80 | -------------------------------------------------------------------------------- /cases/Test-Setup/top.scad: -------------------------------------------------------------------------------- 1 | $fn=60; 2 | 3 | // methoden 4 | module wireStrapHolder(center=[0,0,0], rotation=[0,90,0], inner=2.0, outer=5.5, width=2.75) { 5 | translate(center){ 6 | rotate(rotation){ 7 | difference(){ 8 | translate([0,0,-width/2]) cylinder(h=width, r=outer, center = true); 9 | translate([0,0,-width/2]) cylinder(h=width, r=inner, center = true); 10 | translate([0,0,outer]) cube(2*outer, center=true); 11 | }; 12 | }; 13 | }; 14 | }; 15 | 16 | module pcbHolder(center=[0,0,0], rotation=[0,0,0], l=10) { 17 | translate(center){ 18 | rotate(rotation){ 19 | difference(){ 20 | cube([l,5,4], center = true); 21 | translate([0,1.5,-1.8]) cube([l,2,0.6], center = true); // pcb 22 | translate([0,2.67,-1]) rotate([40,0,0]) cube([l,4,2], center=true); 23 | }; 24 | }; 25 | }; 26 | }; 27 | 28 | // main 29 | difference() { 30 | cube([95,195,10]); 31 | // cut for the base layer 32 | translate([79,0,0]) cube([20,10,10]); 33 | translate([79,15,0]) cube([20,10.6,10]); 34 | translate([79,30.6,0]) cube([20,10,10]); 35 | translate([79,155,0]) cube([20,10,10]); 36 | translate([79,170,0]) cube([20,10.6,10]); 37 | translate([79,185.6,0]) cube([20,10,10]); 38 | // hole 39 | translate([85,165,5]) rotate([0,90,90]) cylinder(h=22, d=5); 40 | translate([85,10,5]) rotate([0,90,90]) cylinder(h=22, d=5); 41 | translate([86.5,10,0]) rotate([0,45,0]) cube([20,10,10]); 42 | 43 | // a bit cleanter look 44 | translate([90,0,0]) cube([10,35,10]); 45 | translate([90,160,0]) cube([10,35,10]); 46 | // 1.2mm for the PCB (extended to the left) 47 | translate([0,29,8.8]) cube([78,161,10]); 48 | //below pcb 49 | translate([0,34,6]) cube([75.5,136,10]); 50 | 51 | // edgeHolder 52 | for (a =[45:10:150]) wireStrapHolder(center=[97.5,a,10], rotation=[90,0,0], inner=5, outer=7, width=5); 53 | } 54 | 55 | pcbHolder(center=[72,28.5,12], rotation=[0,0,0], l=6); 56 | pcbHolder(center=[43,190.5,12], rotation=[0,0,180], l=70); 57 | pcbHolder(center=[78.5,59.5,12], rotation=[0,0,90], l=3); 58 | pcbHolder(center=[78.5,142,12], rotation=[0,0,90], l=4); 59 | 60 | -------------------------------------------------------------------------------- /pcb/Relais.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 14 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Relay_own:CP1SA-12V-Z K2 19 | U 1 1 5CEBBD54 20 | P 5950 3100 21 | F 0 "K2" H 5950 3465 50 0000 C CNN 22 | F 1 "CP1SA-12V-Z" H 5950 3374 50 0000 C CNN 23 | F 2 "Relay_own:CP1SA12VZ" H 6300 3300 50 0001 L CNN 24 | F 3 "https://www.mouser.com/datasheet/2/315/cp-catalog-1299312.pdf" H 6300 3200 50 0001 L CNN 25 | F 4 "PANASONIC ELECTRIC WORKS - CP1SA-12V-Z - RELAY, AUTOMOTIVE, SPDT, 14VDC, 20A" H 6300 3100 50 0001 L CNN "Description" 26 | F 5 "10.5" H 6300 3000 50 0001 L CNN "Height" 27 | F 6 "769-CP1SA-12V-Z" H 6300 2900 50 0001 L CNN "Mouser Part Number" 28 | F 7 "Panasonic" H 6800 2600 50 0001 L CNN "Manufacturer_Name" 29 | F 8 "CP1SA-12V-Z" H 6800 2500 50 0001 L CNN "Manufacturer_Part_Number" 30 | 1 5950 3100 31 | 1 0 0 -1 32 | $EndComp 33 | $Comp 34 | L GateDriver_own:NUD3124LT1G U10 35 | U 1 1 5CEBBF42 36 | P 6350 2400 37 | F 0 "U10" H 6300 2715 50 0000 C CNN 38 | F 1 "NUD3124LT1G" H 6300 2624 50 0000 C CNN 39 | F 2 "ICs_own:SOT95P237X100-3N" H 5900 2000 50 0001 L CNN 40 | F 3 "https://www.mouser.com/datasheet/2/308/NUD3124-D-91887.pdf" H 5300 1700 50 0001 L CNN 41 | F 4 "ON Semiconductor NUD3124LT1G, MOSFET Power Driver, 150mA, 3-Pin SOT-23" H 5100 1550 50 0001 L CNN "Description" 42 | F 5 "1" H 6800 2250 50 0001 L CNN "Height" 43 | F 6 "ON Semiconductor" H 6200 1900 50 0001 L CNN "Manufacturer_Name" 44 | F 7 "NUD3124LT1G" H 6200 1800 50 0001 L CNN "Manufacturer_Part_Number" 45 | 1 6350 2400 46 | 1 0 0 -1 47 | $EndComp 48 | Wire Wire Line 49 | 6450 3000 6950 3000 50 | Wire Wire Line 51 | 6950 3000 6950 2350 52 | Wire Wire Line 53 | 5650 2350 1100 2350 54 | Wire Wire Line 55 | 1100 2450 5650 2450 56 | Wire Wire Line 57 | 5450 3200 1100 3200 58 | Wire Wire Line 59 | 5450 3000 5100 3000 60 | Wire Wire Line 61 | 5100 3000 5100 4200 62 | Wire Wire Line 63 | 5100 4200 10750 4200 64 | Wire Wire Line 65 | 5450 3100 5300 3100 66 | Wire Wire Line 67 | 5300 3100 5300 4350 68 | Wire Wire Line 69 | 5300 4350 10750 4350 70 | Wire Wire Line 71 | 6450 3100 6450 4050 72 | Wire Wire Line 73 | 6450 4050 10750 4050 74 | Text HLabel 10750 4200 2 50 BiDi ~ 0 75 | COM 76 | Text HLabel 10750 4050 2 50 BiDi ~ 0 77 | NC 78 | Text HLabel 10750 4350 2 50 BiDi ~ 0 79 | NO 80 | Text HLabel 1100 2350 0 50 BiDi ~ 0 81 | Enable 82 | Text HLabel 1100 2450 0 50 BiDi ~ 0 83 | GND 84 | Text HLabel 1100 3200 0 50 BiDi ~ 0 85 | +12V 86 | $EndSCHEMATC 87 | -------------------------------------------------------------------------------- /pcb/ProtectedInput.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 5 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Text HLabel 5550 2600 2 50 BiDi ~ 0 18 | GND 19 | Text HLabel 5550 2300 2 50 Output ~ 0 20 | output 21 | Text HLabel 2550 2300 0 50 Input ~ 0 22 | input 23 | $Comp 24 | L Device:R R18 25 | U 1 1 5C4E78E9 26 | P 3200 2300 27 | AR Path="/5C4EB24D/5C4E78E9" Ref="R18" Part="1" 28 | AR Path="/5C4EB277/5C4E78E9" Ref="R20" Part="1" 29 | AR Path="/5C4EB28C/5C4E78E9" Ref="R?" Part="1" 30 | AR Path="/5C9B01EE/5C4E78E9" Ref="R31" Part="1" 31 | AR Path="/5C9B01F3/5C4E78E9" Ref="R?" Part="1" 32 | AR Path="/5CD0B67B/5C4E78E9" Ref="R?" Part="1" 33 | F 0 "R31" V 2993 2300 50 0000 C CNN 34 | F 1 "47k" V 3084 2300 50 0000 C CNN 35 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3130 2300 50 0001 C CNN 36 | F 3 "~" H 3200 2300 50 0001 C CNN 37 | 1 3200 2300 38 | 0 1 1 0 39 | $EndComp 40 | $Comp 41 | L Device:R R19 42 | U 1 1 5C4E791C 43 | P 4150 2450 44 | AR Path="/5C4EB24D/5C4E791C" Ref="R19" Part="1" 45 | AR Path="/5C4EB277/5C4E791C" Ref="R21" Part="1" 46 | AR Path="/5C4EB28C/5C4E791C" Ref="R?" Part="1" 47 | AR Path="/5C9B01EE/5C4E791C" Ref="R32" Part="1" 48 | AR Path="/5C9B01F3/5C4E791C" Ref="R?" Part="1" 49 | AR Path="/5CD0B67B/5C4E791C" Ref="R?" Part="1" 50 | F 0 "R32" H 4220 2496 50 0000 L CNN 51 | F 1 "12.1k" H 4220 2405 50 0000 L CNN 52 | F 2 "Resistor_SMD:R_0805_2012Metric" V 4080 2450 50 0001 C CNN 53 | F 3 "~" H 4150 2450 50 0001 C CNN 54 | 1 4150 2450 55 | 1 0 0 -1 56 | $EndComp 57 | $Comp 58 | L Device:C C14 59 | U 1 1 5C4E7961 60 | P 4700 2450 61 | AR Path="/5C4EB24D/5C4E7961" Ref="C14" Part="1" 62 | AR Path="/5C4EB277/5C4E7961" Ref="C15" Part="1" 63 | AR Path="/5C4EB28C/5C4E7961" Ref="C?" Part="1" 64 | AR Path="/5C9B01EE/5C4E7961" Ref="C24" Part="1" 65 | AR Path="/5C9B01F3/5C4E7961" Ref="C?" Part="1" 66 | AR Path="/5CD0B67B/5C4E7961" Ref="C?" Part="1" 67 | F 0 "C24" H 4815 2496 50 0000 L CNN 68 | F 1 "1n" H 4815 2405 50 0000 L CNN 69 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4738 2300 50 0001 C CNN 70 | F 3 "~" H 4700 2450 50 0001 C CNN 71 | 1 4700 2450 72 | 1 0 0 -1 73 | $EndComp 74 | Wire Wire Line 75 | 2550 2300 3050 2300 76 | Wire Wire Line 77 | 3350 2300 4150 2300 78 | Connection ~ 4150 2300 79 | Wire Wire Line 80 | 4150 2300 4700 2300 81 | Connection ~ 4700 2300 82 | Wire Wire Line 83 | 4700 2300 5550 2300 84 | Wire Wire Line 85 | 4150 2600 4700 2600 86 | Connection ~ 4700 2600 87 | Wire Wire Line 88 | 4700 2600 5550 2600 89 | $EndSCHEMATC 90 | -------------------------------------------------------------------------------- /pcb/F9P-IO.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 9 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Wire Wire Line 18 | 4800 3450 5050 3450 19 | NoConn ~ 5050 2250 20 | NoConn ~ 5050 2350 21 | NoConn ~ 5050 2450 22 | NoConn ~ 5050 2550 23 | NoConn ~ 5050 2650 24 | NoConn ~ 5050 2950 25 | NoConn ~ 5050 3050 26 | NoConn ~ 5050 3150 27 | NoConn ~ 5050 3250 28 | NoConn ~ 5050 3350 29 | NoConn ~ 5050 3550 30 | NoConn ~ 5600 2650 31 | NoConn ~ 5600 3050 32 | NoConn ~ 5600 3150 33 | NoConn ~ 5600 3350 34 | Wire Wire Line 35 | 5600 2950 5900 2950 36 | Wire Wire Line 37 | 5850 2650 5850 2750 38 | Wire Wire Line 39 | 5850 2750 5600 2750 40 | Wire Wire Line 41 | 5600 3250 5900 3250 42 | $Comp 43 | L Connector:Conn_01x08_Female J9 44 | U 1 1 5C9A6566 45 | P 5250 2250 46 | F 0 "J9" H 5150 2800 50 0000 L CNN 47 | F 1 "Conn_01x08_Female" H 4950 2700 50 0000 L CNN 48 | F 2 "Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical" H 5250 2250 50 0001 C CNN 49 | F 3 "" H 5250 2250 50 0001 C CNN 50 | 1 5250 2250 51 | 1 0 0 -1 52 | $EndComp 53 | $Comp 54 | L Connector:Conn_01x08_Female J10 55 | U 1 1 5C9A656D 56 | P 5250 3150 57 | F 0 "J10" H 5100 2650 50 0000 L CNN 58 | F 1 "Conn_01x08_Female" H 4700 2550 50 0000 L CNN 59 | F 2 "Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical" H 5250 3150 50 0001 C CNN 60 | F 3 "" H 5250 3150 50 0001 C CNN 61 | 1 5250 3150 62 | 1 0 0 -1 63 | $EndComp 64 | $Comp 65 | L Connector:Conn_01x08_Female J11 66 | U 1 1 5C9A6574 67 | P 5400 2950 68 | F 0 "J11" H 5294 3435 50 0000 C CNN 69 | F 1 "Conn_01x08_Female" H 5300 3350 50 0000 C CNN 70 | F 2 "Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical" H 5400 2950 50 0001 C CNN 71 | F 3 "" H 5400 2950 50 0001 C CNN 72 | 1 5400 2950 73 | -1 0 0 -1 74 | $EndComp 75 | Wire Wire Line 76 | 5600 2850 5850 2850 77 | Wire Wire Line 78 | 5850 2750 5850 2850 79 | Connection ~ 5850 2750 80 | Text HLabel 5850 2650 2 50 BiDi ~ 0 81 | GND 82 | Text HLabel 5900 2950 2 50 BiDi ~ 0 83 | +5V 84 | Text HLabel 5900 3250 2 50 BiDi ~ 0 85 | +3V3 86 | Wire Wire Line 87 | 4800 3450 4800 4250 88 | Wire Wire Line 89 | 4800 4250 7600 4250 90 | Wire Wire Line 91 | 7600 4250 7600 2750 92 | Wire Wire Line 93 | 7600 2750 5850 2750 94 | Text HLabel 5050 1950 0 50 Output ~ 0 95 | TX1 96 | Text HLabel 5050 2050 0 50 Input ~ 0 97 | RX1 98 | Text HLabel 5050 2150 0 50 Output ~ 0 99 | TX2 100 | Text HLabel 5050 2850 0 50 Input ~ 0 101 | RX2 102 | $EndSCHEMATC 103 | -------------------------------------------------------------------------------- /pcb/bom/SelfSolderingParts.csv: -------------------------------------------------------------------------------- 1 | Designator,Qty,MPN,maker,type,value,detail,mouserNO.,DigikeyNO.,footprints 2 | "C6, C13, C22, C33, ",4,UCM1V561MNL1GS,Nichicon,CP,560u,Polarized capacitor,647-UCM1V561MNL1GS ,,Capacitor_SMD:CP_Elec_10x10.5 3 | "J1, ",1,1814883,Phoenix Contact,PTSM-Header-Horizontal-6,PTSM-Header-Horizontal-6,,651-1814883,277-9960-1-ND,Connector_own:1814883 4 | "J3, ",1,1814896,Phoenix Contact,PTSM-Header-Horizontal-7,PTSM-Header-Horizontal-7,,651-1814896,277-9961-1-ND,Connector_own:1814896 5 | "J4, ",1,1836366,Phoenix Contact,277-16334-ND ,CCA-Header-Horizontal-4,,651-1836366 ,277-16334-ND,Connector_own:1836366 6 | "J5, ",1,1814870,Phoenix Contact,PTSM-Header-Horizontal-5,PTSM-Header-Horizontal-5,,651-1814870,277-9959-1-ND,Connector_own:1814870 7 | "J7, ",1,68016-404HLF,FCI / Amphenol,Conn_01x04_Male,Conn_01x04_Male,"Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)",649-68016-404HLF,,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal 8 | "J8, ",1,M20-9770446,Harwin,Conn_01x04_Male,Conn_01x04_Male,"Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)",855-M20-9770446 ,,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical 9 | "J9, J10, J11, ",3,M20-7820842,Harwin,Conn_01x08_Female,Conn_01x08_Female,"Generic connector, single row, 01x08, script generated (kicad-library-utils/schlib/autogen/connector/)",855-M20-7820842,,Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical 10 | "J12, ",1,68021-404HLF,FCI / Amphenol,Conn_02x02_Odd_Even,Conn_02x02_Odd_Even,"Generic connector, double row, 02x02, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)",649-68021-404HLF,,Connector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_Horizontal 11 | "J13, J17, ",2,PRT-14417,SparkFun Electronics,SM04B-SRSS-TB(LF)(SN),SM04B-SRSS-TB(LF)(SN),"JST (JAPAN SOLDERLESS TERMINALS) - SM04B-SRSS-TB(LF)(SN) - CONNECTOR, HEADER, SMT, R/A, 1MM, 4WAY",474-PRT-14417,455-1804-1-ND,Connector_own:JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal 12 | "J15, ",1,RJMG1BD3B8K1ANR,FCI / Amphenol,RJ45_Amphenol_RJMG1BD3B8K1ANR,RJ45_Amphenol_RJMG1BD3B8K1ANR,"1 Port RJ45 Magjack Connector Through Hole 10/100 Base-T, AutoMDIX",523-RJMG1BD3B8K1ANR ,RJMG1BD3B8K1ANR-ND,Connector_own:RJ45_Amphenol_RJMG1BD3B8K1ANR 13 | "J16, ",1,LD09P33E4GV00LF,FCI / Amphenol,DB9_Male_MountingHoles,DB9_Male_MountingHoles,"9-pin male D-SUB connector, Mounting Hole",649-LD09P33E4GV00LF ,609-5186-ND,Connector_own:LD09P33E4GV00LF 14 | "J18, ",1,1814841,Phoenix Contact,PTSM-Header-Horizontal-2,PTSM-Header-Horizontal-2,,651-1814841,277-9956-1-ND,Connector_own:1814841 15 | "K1, K2, ",2,CP1SA-12V-Z,Panasonic,CP1SA-12V-Z,CP1SA-12V-Z,"PANASONIC ELECTRIC WORKS - CP1SA-12V-Z - RELAY, AUTOMOTIVE, SPDT, 14VDC, 20A",769-CP1SA-12V-Z,255-3417-1-ND,Relay_own:CP1SA12VZ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32 F9P IO board 2 | 3 | This PCB is a versatile IO plattform that provides computing power (ESP32) and IO interfaces to build GPS/RTK applications. 4 | 5 | ## Hardware Overview 6 | 7 | - Power supply: 8 | - Input 9V-28V (labeld 12V on the board), external connection on J4. 9 | - Protected against wrong polarity (Diode D7 parallel to the relay K1) 10 | - Reduced inrush current (resistors R15/16 in serie with the starting diode D7 before the relay K1 closes and shortens the path). 11 | - V78E05-1000 (step down converter) PS1 generates 5V 12 | - AZ1117-3.3 LDO U2 generates 3V from the 5V supply. 13 | - 12A (slow) fuse soldered on the board. Recommended to use a 10A external fuse. 14 | - ESP32-WROOM-32 U1 for computing-power, wifi, Bluetooth 15 | - Arduino headers for the simpleRTK2B-F9P (uart 1 of the F9P connected) 16 | - Serial interfaces 17 | - one uart (IO13/14) on the Arduino headers for the F9P 18 | - one uart (IO0/2) next to the arduino headers on two pins (J2) for the new simpleRTK2Blight. Since the two pins have a special meaning during boot, pulling TX to GND during startup results in the ESP going into programming mode. 19 | - one uart (IO15/16) for RS232 on the D-Sub connector J16 20 | - one uart (IO1/3) on the USB-Uart converter (J14) - Also supports programming with "RTS/DTR" 21 | - I2C (IO32/33) 22 | - I2C with 3.3V logic level (J8 pin header, J13,17 [qwiic](https://www.sparkfun.com/qwiic) connector) 23 | - I2C with 5V logic level (J7 pin header) 24 | - internal used adresses: 25 | - 0x1C - Magnetometer part of the LSM9DS1 (U12) 26 | - 0x43 - FXL6408 port extender (IC 1) 27 | - 0x48 - ADS1115 (U4) 28 | - 0x6A - Accelerometer part of the LSM9DS1 (U12) 29 | - CAN bus 30 | - Tranceiver (U2) + ESP32 integrated controler (TX IO5, RX IO35) 31 | - Termination resistor and sending messages can/must both be enabled with a jumper on J12 32 | - external connection J18 33 | - Ethernet: 34 | - internal MAC, connected to LAN8720A on IO17,18,19,21,22,23,25,26,27 35 | - IO17 Clock 36 | - IO18 MDIO 37 | - IO23 MDC 38 | - PHY-Reset controlled with FXL6408-GPI01 39 | - ETH-Address of the LAN8720: 0 40 | - IMU: 9 Axis, LSM9DS1 (U12). Magnetometer needs iron correction to be usable. 41 | - Outputs 42 | - One H-bridge/motordriver with two VNH7070AS (U3/5), (PWM IO4, FXL6408-GPIO6/7 direction). External connected on J4 43 | - One H-bridge/motordriver with one VNH7070AS (U9), (PWM IO12, FXL6408-GPI04/5 direction), external connected on J3 44 | - One Relay (K2) controlled on FXL6408-GPI03, external connected on J3 45 | - One status LED (D2) controlled on FXL6408-GPI02 46 | - Inputs 47 | - Three 15V tolerant (analog) inputs IO34, SENSOR_VN/36, SENSOR_VP/39, external connected on J1 48 | - Three 5V tolerant (analog) inputs on the ADS1115, first two cann be used to measure differential. Number four is hardwired to VCC/5V. External connected on J5 49 | - One Button (e.g. for entering configuration mode), on FXL6408-GPI00 50 | - Connectors: 51 | - J1 - 6 pin PTSM header. 15V tolerant inputs and 12V for easy cabeling if used as switch 52 | - J2 - 2 Pin Uart 53 | - J3 - 7 pin PTSM header. Outputs of second H-bridge, two times ground (for using as two half bridges) and the three pins for the relay (comm, no, nc) 54 | - J4 - 4 pin CCA header. Power input and output of the first motor driver/h-bridge 55 | - J5 - 5 pin PTSM header. Three ADS1115 inputs, 5V and GND for easy cabeling (e.g. linear potentiometer) 56 | - J7 - 4 pin header. I2C 5V logic level + GND and 5V 57 | - J8 - 4 pin header. I2C 3V3 logic level + GND and 3V3 58 | - J9, J10, J11 - 8 pin header. Socket for the simpleRTK2B F9P 59 | - J12 - 2x2 horizontal pin header. Used for jumpers to enable CAN termination and/or CAN TX 60 | - J13, J17 - qwiic connector. I2C 3V3 61 | - J14 - micro USB connector. Can power 5V and 3V3 part of the PCB. Electricaly not isolated! Used for programming the ESP32 62 | - J15 - RJ45 ethernet connector 63 | - J16 - D-Sub connector (male). RS232 64 | - J18 - 2 pin PTSM header. CAN bus 65 | -------------------------------------------------------------------------------- /cases/Basic-1xF9P/Case_MainCover.scad: -------------------------------------------------------------------------------- 1 | // to allow easier adjustments the top of the pcb is laying on the plane created by x and y-axis. H3, H4 on y. H3, H2 on x 2 | // 0.1mm of pcb not in the lower part 3 | // printed turned by 180° (but so the coordinated match with the lower part) 4 | error = 0.15; // how much increase for error during print 5 | $fn=100; 6 | 7 | // helper modules 8 | module screwHole(center=[0,0,0],height=24.85,inner=5.7,wall=1.6, hole=3.0, slope=1.8) { 9 | translate(center) { 10 | difference() { 11 | translate([0,0,height/2]) cylinder(h=height, r=inner/2+2*wall/2+0.01, center = true); 12 | translate([0,0,height/2]) cylinder(h=height, r=hole/2, center = true); 13 | translate([0,0,(height - wall - slope)/2+wall+slope]) cylinder(h=height - wall - slope, r=inner/2, center = true); 14 | translate([0,0,slope/2 + wall]) cylinder(h=slope, r1=hole/2, r2=inner/2, center = true); 15 | }; 16 | }; 17 | }; 18 | 19 | // main design 20 | difference(){ 21 | // base form 22 | translate([-9.2,-1.2,0]) cube([140,170,25.25]); 23 | // 0.2mm for the pcb 24 | translate([0,0,-0.1]) cube([73+4*error,160.1+2*error,0.3]); 25 | // space above pcb (1mm/1.5 of the small sides solid) 26 | translate([0,1.5,-0.1]) cube([73+2*error,157.6+2*error,24.1]); 27 | // space for esp32 antenna 28 | translate([-7.9,67,-0.1]) cube([8,30,24.1]); 29 | // space above the side holder 30 | translate([-10,11,-0.1]) cube([8,54.5,24.1]); 31 | translate([-10,98.5,-0.1]) cube([8,62,24.1]); 32 | translate([2,163,-0.1]) cube([70,8,24.1]); 33 | translate([80,-3,-0.1]) cube([20,8,24.1]); 34 | translate([140-9.2-7,12,-0.1]) cube([8,170-1.2-2*12,24.1]); 35 | // space between the dust isolation 36 | translate([70 ,12, -0.1]) cube([80,102,10.1]); 37 | // holder for the dust isolation 38 | translate([104.5 ,12, 0]) cube([9.5,102,11]); 39 | // space behind the isolation to the pcb 40 | translate([70 ,12, -0.1]) cube([30,130,24.1]); 41 | // holes for screws 42 | translate([120,170-2*1.2-7, -3]) cylinder(h=100, r=3, center = true); 43 | translate([120,7, -3]) cylinder(h=100, r=3, center = true); 44 | translate([5.9, 7.5,0]) cylinder(h=100, r=3, center = true); 45 | translate([65.9,7.5,0]) cylinder(h=100, r=3, center = true); 46 | translate([5.9,149,0]) cylinder(h=100, r=3, center = true); 47 | translate([65.9,149,0]) cylinder(h=100, r=3, center = true); 48 | // openning rs232 49 | translate([15.2-error,-1.25,0]) cube([31.2+2*error,4,12.5+0.1+error]); 50 | //openning usb (front a bit wider than the rest 51 | translate([53.2-error,-1.25,0]) cube([7.6+2*error,4,2.6+0.1+error]); // main 52 | translate([53.0-error,-1.25,0]) cube([8+2*error,1.6,2.85+0.1+error]); // main 53 | 54 | // space for the switch 55 | translate([84,163,-0.4]) cube([17+2*error,7,1]); 56 | 57 | // small cutout for the plug and it's holder 58 | translate([72, 8.5,-0.01]) cube([8.5,4,8]); 59 | 60 | // thinner top over the LEDs (e.g. for two color print) 61 | translate([25,25,23.75]) cube([15,30,1]); 62 | translate([0,93,23.75]) cube([12,15,1]); 63 | translate([60,108,23.75]) cube([10,10,1]); 64 | 65 | // outside edges 45° about 0.5mm 66 | translate([-9.2,-1.2,10]) rotate([0,0,45]) cube([1,1,50], center=true); 67 | translate([-9.2,-1.2+170,10]) rotate([0,0,45]) cube([1,1,50], center=true); 68 | translate([-9.2+140,-1.2,10]) rotate([0,0,45]) cube([1,1,50], center=true); 69 | translate([-9.2+140,-1.2+170,10]) rotate([0,0,45]) cube([1,1,50], center=true); 70 | translate([65,-1.2,25.25]) rotate([-45,0,0]) cube([150,1,1], center=true); 71 | translate([65,-1.2+170,25.25]) rotate([-45,0,0]) cube([150,1,1], center=true); 72 | translate([-9.2,85,25.25]) rotate([0,45,0]) cube([1,180,1], center=true); 73 | translate([-9.2+140,85,25.25]) rotate([0,45,0]) cube([1,180,1], center=true); 74 | }; 75 | screwHole(center=[120,170-2*1.2-7, 0.15], height=25.1); 76 | screwHole(center=[120,7, 0.15], height=25.1); 77 | screwHole(center=[5.9, 7.5,0.3], wall=1.2); 78 | screwHole(center=[65.9,7.5,0.3], wall=1.2); 79 | screwHole(center=[5.9,149.2,0.3], wall=2.4); 80 | screwHole(center=[65.9,149.2,0.3], wall=2.4); 81 | // a bit more support (thin walls) 82 | translate([0, 6.5,0.3]) cube([3,2,24]); 83 | translate([69.4, 6.5,0.3]) cube([4.5,2,24]); 84 | translate([4.9, 1,0.3]) cube([2,3,24]); 85 | translate([64.9, 1,0.3]) cube([2,3,24]); 86 | translate([0, 148.2,0.3]) cube([3,2,24]); 87 | translate([69.9, 148.2,0.3]) cube([4,2,24]); 88 | // small support for the thin top 89 | translate([-9, 80, 20]) cube([120,2.4,5]); 90 | -------------------------------------------------------------------------------- /code/HW-Test-Responder/HW-Test-Responder.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Just a very simple sketch that receives a can-message, and responds with an other message. 3 | * Also responds on a uart, ethernet and switches M1 on for a short period of time after some can message 4 | * Other side for the HW-Test 5 | * Uses arduino-can: https://github.com/sandeepmistry/arduino-CAN 6 | */ 7 | 8 | #define CAN_TX 5 9 | #define CAN_RX 35 10 | #define I2C_SDA 32 11 | #define I2C_SCL 33 12 | #define VNH_A_PWM 4 13 | #define VNH_B_PWM 12 14 | #define UART_RX 2 15 | #define UART_TX 0 16 | // Ethernet 17 | #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT 18 | #define ETH_POWER_PIN -1 19 | #define ETH_TYPE ETH_PHY_LAN8720 20 | #define ETH_ADDR 0 21 | #define ETH_MDC_PIN 23 22 | #define ETH_MDIO_PIN 18 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | WebServer server(80); 31 | int counter = 0; 32 | 33 | uint8_t setByteI2C(int address, byte i2cregister, byte value) { 34 | Wire.beginTransmission(address); 35 | Wire.write(i2cregister); 36 | Wire.write(value); 37 | return Wire.endTransmission(); 38 | } 39 | 40 | void handle_OnConnect() { 41 | Serial.println("Received http request"); 42 | server.send(200, "text/html", "Success!"); 43 | } 44 | 45 | void setup() { 46 | Serial.begin(115200); 47 | Serial.println("HW-Test Responder"); 48 | 49 | // configure CAN-interface 50 | CAN.setPins(CAN_RX, CAN_TX); 51 | // start the CAN bus at 500 kbps 52 | if (!CAN.begin(500E3)) { 53 | Serial.println("Starting CAN failed!"); 54 | while (1); 55 | } 56 | // configure uart 57 | gpio_pad_select_gpio(GPIO_NUM_2); 58 | gpio_set_direction(GPIO_NUM_2, GPIO_MODE_INPUT); 59 | gpio_pad_select_gpio(GPIO_NUM_0); 60 | gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT); 61 | Serial1.begin(19200, SERIAL_8N1, UART_TX, UART_RX); 62 | 63 | // configure I2C 64 | Wire.begin(I2C_SDA, I2C_SCL, 400000); 65 | 66 | //FXL6408 67 | // direction (Input/Output) 68 | setByteI2C(0x43, 0x03, 0b11111110); 69 | // disable High-Z on outputs 70 | setByteI2C(0x43, 0x07, 0b00000001); 71 | // en-/disable Pullup/downs 72 | setByteI2C(0x43, 0x0B, 0b00000001); 73 | // set direction of the pull 74 | setByteI2C(0x43, 0x0D, 0b00000001); 75 | // configure PWM for M1 76 | ledcSetup(0, 1500, 8); 77 | ledcAttachPin(VNH_A_PWM, 0); 78 | ledcWrite(0, 255); 79 | 80 | // configure ethernet 81 | // enable the LAN8720 82 | setByteI2C(0x43, 0x05, 0b00000010); 83 | 84 | // Start Network 85 | ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); 86 | ETH.config(IPAddress(10, 0, 1, 203),IPAddress(0, 0, 0, 0),IPAddress(255, 255, 255, 0),IPAddress(0, 0, 0, 0),IPAddress(0, 0, 0, 0)); 87 | 88 | // webserver 89 | server.on("/", handle_OnConnect); 90 | 91 | } 92 | 93 | void loop() { 94 | // status LED 95 | if ((counter++ % 256) < 128) { 96 | setByteI2C(0x43, 0x05, 0b00000110); 97 | } else { 98 | setByteI2C(0x43, 0x05, 0b00000010); 99 | } 100 | 101 | // webserver 102 | server.handleClient(); 103 | 104 | // uart 105 | while (Serial1.available()) { 106 | char byteRead = Serial1.read(); 107 | Serial.print("Received on uart: "); 108 | Serial.println(byteRead); 109 | Serial1.write(byteRead); 110 | } 111 | 112 | // CAN 113 | // try to parse packet 114 | int packetSize = CAN.parsePacket(); 115 | 116 | if (packetSize) { 117 | // received a packet 118 | Serial.print("Received "); 119 | 120 | Serial.print("packet with id 0x"); 121 | int packetId = CAN.packetId(); 122 | Serial.println(packetId, HEX); 123 | if (packetId == 0x10) { 124 | Serial.print(" Length "); 125 | Serial.print(packetSize); 126 | Serial.print(" and data: "); 127 | while (CAN.available()) { 128 | Serial.print((char)CAN.read()); 129 | } 130 | Serial.println(); 131 | 132 | delay(100); 133 | 134 | // send response 135 | Serial.print("Sending response ... "); 136 | 137 | CAN.beginPacket(0x12); 138 | CAN.write('a'); 139 | CAN.write('c'); 140 | CAN.write('k'); 141 | CAN.endPacket(); 142 | Serial.println("done"); 143 | } 144 | if (packetId == 0x05) { 145 | Serial.print("Buzzer ... "); 146 | //enable M1 147 | setByteI2C(0x43, 0x05, 0b00001010); 148 | delay(50); 149 | // disable again 150 | setByteI2C(0x43, 0x05, 0b00000010); 151 | Serial.println("off"); 152 | } 153 | } 154 | delay(5); 155 | } 156 | -------------------------------------------------------------------------------- /pcb/motorDriver.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 3 17 8 | Title "H-Bridge Motor Driver" 9 | Date "" 10 | Rev "0.1" 11 | Comp "" 12 | Comment1 "Based on STM VNH7070ASTR" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Text HLabel 5600 1450 2 50 Output ~ 0 18 | outA 19 | Text HLabel 5600 1650 2 50 Output ~ 0 20 | outB 21 | Text HLabel 850 1450 0 50 Input ~ 0 22 | INA 23 | Text HLabel 850 1750 0 50 Input ~ 0 24 | InB 25 | Text HLabel 850 2050 0 50 Input ~ 0 26 | PWM 27 | $Comp 28 | L Driver_Motor_own:VNH7070AS U3 29 | U 1 1 5C445805 30 | P 3300 1350 31 | AR Path="/5C443F4F/5C445805" Ref="U3" Part="1" 32 | AR Path="/5C443F5E/5C445805" Ref="U?" Part="1" 33 | AR Path="/5C9CCBB2/5C445805" Ref="U5" Part="1" 34 | AR Path="/5C9DA548/5C445805" Ref="U?" Part="1" 35 | AR Path="/5C9DA551/5C445805" Ref="U9" Part="1" 36 | F 0 "U9" H 3300 1666 50 0000 C CNN 37 | F 1 "VNH7070AS" H 3300 1575 50 0000 C CNN 38 | F 2 "Package_SO:SOIC-16_3.9x9.9mm_P1.27mm" H 3250 1400 50 0001 C CNN 39 | F 3 "" H 3250 1400 50 0001 C CNN 40 | 1 3300 1350 41 | 1 0 0 -1 42 | $EndComp 43 | Wire Wire Line 44 | 3300 750 3300 1250 45 | Wire Wire Line 46 | 3850 1450 5600 1450 47 | Wire Wire Line 48 | 2750 2950 2750 1800 49 | Wire Wire Line 50 | 3150 2150 3150 2950 51 | Connection ~ 3150 2950 52 | Wire Wire Line 53 | 3150 2950 2750 2950 54 | Wire Wire Line 55 | 3500 2150 3500 2950 56 | Wire Wire Line 57 | 3150 2950 3500 2950 58 | Connection ~ 3500 2950 59 | Wire Wire Line 60 | 3500 2950 4150 2950 61 | $Comp 62 | L Device:C C12 63 | U 1 1 5C44655B 64 | P 4150 900 65 | AR Path="/5C443F4F/5C44655B" Ref="C12" Part="1" 66 | AR Path="/5C443F5E/5C44655B" Ref="C?" Part="1" 67 | AR Path="/5C9CCBB2/5C44655B" Ref="C21" Part="1" 68 | AR Path="/5C9DA548/5C44655B" Ref="C?" Part="1" 69 | AR Path="/5C9DA551/5C44655B" Ref="C32" Part="1" 70 | F 0 "C32" H 4265 946 50 0000 L CNN 71 | F 1 "100n" H 4265 855 50 0000 L CNN 72 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4188 750 50 0001 C CNN 73 | F 3 "~" H 4150 900 50 0001 C CNN 74 | 1 4150 900 75 | 1 0 0 -1 76 | $EndComp 77 | Connection ~ 4150 750 78 | Wire Wire Line 79 | 4150 750 3300 750 80 | Wire Wire Line 81 | 4150 1050 4150 2950 82 | Connection ~ 4150 2950 83 | Wire Wire Line 84 | 4150 2950 5600 2950 85 | Wire Wire Line 86 | 3850 1650 5600 1650 87 | Wire Wire Line 88 | 1900 1750 1900 1550 89 | Wire Wire Line 90 | 1900 1550 2750 1550 91 | Wire Wire Line 92 | 2250 2050 2250 1650 93 | Wire Wire Line 94 | 2250 1650 2750 1650 95 | Wire Wire Line 96 | 4150 750 4950 750 97 | $Comp 98 | L power:GND #PWR? 99 | U 1 1 5C60F6E8 100 | P 5600 2950 101 | AR Path="/5C443F5E/5C60F6E8" Ref="#PWR?" Part="1" 102 | AR Path="/5C443F4F/5C60F6E8" Ref="#PWR047" Part="1" 103 | AR Path="/5C9CCBB2/5C60F6E8" Ref="#PWR049" Part="1" 104 | AR Path="/5C9DA548/5C60F6E8" Ref="#PWR?" Part="1" 105 | AR Path="/5C9DA551/5C60F6E8" Ref="#PWR051" Part="1" 106 | F 0 "#PWR051" H 5600 2700 50 0001 C CNN 107 | F 1 "GND" H 5605 2777 50 0000 C CNN 108 | F 2 "" H 5600 2950 50 0001 C CNN 109 | F 3 "" H 5600 2950 50 0001 C CNN 110 | 1 5600 2950 111 | 1 0 0 -1 112 | $EndComp 113 | $Comp 114 | L power:+12V #PWR? 115 | U 1 1 5C60F720 116 | P 5600 750 117 | AR Path="/5C443F5E/5C60F720" Ref="#PWR?" Part="1" 118 | AR Path="/5C443F4F/5C60F720" Ref="#PWR046" Part="1" 119 | AR Path="/5C9CCBB2/5C60F720" Ref="#PWR048" Part="1" 120 | AR Path="/5C9DA548/5C60F720" Ref="#PWR?" Part="1" 121 | AR Path="/5C9DA551/5C60F720" Ref="#PWR050" Part="1" 122 | F 0 "#PWR050" H 5600 600 50 0001 C CNN 123 | F 1 "+12V" H 5615 923 50 0000 C CNN 124 | F 2 "" H 5600 750 50 0001 C CNN 125 | F 3 "" H 5600 750 50 0001 C CNN 126 | 1 5600 750 127 | 1 0 0 -1 128 | $EndComp 129 | Wire Wire Line 130 | 850 1450 2750 1450 131 | Wire Wire Line 132 | 850 1750 1900 1750 133 | Wire Wire Line 134 | 850 2050 2250 2050 135 | $Comp 136 | L Device:CP C13 137 | U 1 1 5C9C254B 138 | P 4950 900 139 | AR Path="/5C443F4F/5C9C254B" Ref="C13" Part="1" 140 | AR Path="/5C9CCBB2/5C9C254B" Ref="C22" Part="1" 141 | AR Path="/5C9DA548/5C9C254B" Ref="C?" Part="1" 142 | AR Path="/5C9DA551/5C9C254B" Ref="C33" Part="1" 143 | F 0 "C33" H 5068 946 50 0000 L CNN 144 | F 1 "560u" H 5068 855 50 0000 L CNN 145 | F 2 "Capacitor_SMD:CP_Elec_10x10.5" H 4988 750 50 0001 C CNN 146 | F 3 "~" H 4950 900 50 0001 C CNN 147 | 1 4950 900 148 | 1 0 0 -1 149 | $EndComp 150 | Connection ~ 4950 750 151 | Wire Wire Line 152 | 4950 750 5600 750 153 | Wire Wire Line 154 | 4950 1050 4150 1050 155 | Connection ~ 4150 1050 156 | $EndSCHEMATC 157 | -------------------------------------------------------------------------------- /cases/Basic-1xF9P/Case_Baseplate.scad: -------------------------------------------------------------------------------- 1 | // to allow easier adjustments pcb is laying on the plane created by x and y-axis. H3, H4 on y. H3, H2 on x 2 | // 1.5mm of the pcb embedded in this part 3 | error = 0.15; // how much increase for error during print 4 | $fn=100; 5 | 6 | // helper modules 7 | module pcbHolder(center=[0,0,0],height=10.8,baseDia=16,topDia=8, screw=2) { 8 | translate(center){ 9 | difference() { 10 | rotate([0,0,45]) cylinder(height,baseDia/2,topDia/2,$fn=4); 11 | translate([0,0,1]) cylinder(h=height+1, r=screw/2); 12 | }; 13 | }; 14 | }; 15 | 16 | module wireStrapHolder(center=[0,0,0], rotation=[0,90,0], inner=2.0, outer=5.5, width=2.75+2*error) { 17 | translate(center){ 18 | rotate(rotation){ 19 | difference(){ 20 | translate([0,0,-width/2]) cylinder(h=width, r=outer, center = true); 21 | translate([0,0,-width/2]) cylinder(h=width, r=inner, center = true); 22 | translate([0,0,outer]) cube(2*outer, center=true); 23 | 24 | }; 25 | }; 26 | }; 27 | }; 28 | 29 | module edgeHolder(center=[0,0,0],angle=0) { 30 | translate(center){ 31 | rotate([0,0,angle]) { 32 | cube([3,13,14], center=true); 33 | translate([0,2,-1.5]) cube([30,3,2.5]); 34 | translate([0,-5,-1.5]) cube([30,3,2.5]); 35 | }; 36 | }; 37 | }; 38 | 39 | module switchSpace() { 40 | translate([0,-45,0]) cube([27+2*error,45,12]); // long inner part 41 | translate([5,-7,-0.3]) cube([17+2*error,7,1]); // dent for the small triangles at the side 42 | translate([-4,-32.4,0]) cube([35,30,12]); // wider space inside 43 | translate([0,-65,35]) rotate([-60,0,0]) cube([27+2*error,40,20]); // angle at the end 44 | translate([-2,-90,5.5]) cube([15,60,12]); // a bit space for cable management (under J3 45 | } 46 | 47 | module pcbClamp(center=[0,0,0], rotation=[0,0,0], l=10) { 48 | translate(center){ 49 | rotate(rotation){ 50 | difference(){ 51 | cube([l,5,4], center = true); 52 | translate([0,1.5,-1.8]) cube([l,2,0.6], center = true); // pcb 53 | translate([0,2.67,-1]) rotate([40,0,0]) cube([l,4,2], center=true); 54 | }; 55 | }; 56 | }; 57 | }; 58 | 59 | // main design 60 | difference(){ 61 | // base form 62 | translate([-9.2,-1.2,-12]){ 63 | cube([140,170,13.5]); 64 | }; 65 | // pcb itselfwireStrapHolder 66 | cube([73+2*error,160.1+2*error,1.6]); 67 | //space below the pcb 68 | translate([1,2,-10.8]){ 69 | cube([71,156,11]); 70 | }; 71 | // space for the switch 72 | translate([79,170,-10.5]) switchSpace(); 73 | 74 | // a bit lower for isolation foam (1mm) 75 | translate([104.5 ,12, 0.5]) cube([9.5,102,3.01]); 76 | // holder for wire straps (cables) 77 | for (a =[25:15:110]) wireStrapHolder([103, a, 1.5]); 78 | for (a =[17.5:15:110]) wireStrapHolder([98, a, 1.5]); 79 | // corner rows 80 | for (a =[25:15:110]) wireStrapHolder([123, a, 1.5]); 81 | for (a =[17.5:15:110]) wireStrapHolder([118, a, 1.5]); 82 | 83 | // corner (whole box) 84 | wireStrapHolder(center=[140-9.2,-1.2,-4.35], rotation=[0,0,0], inner=7.5, outer=10, width=5); 85 | wireStrapHolder(center=[140-9.2,170-1.2,-4.35], rotation=[0,0,0], inner=7.5, outer=10, width=5); 86 | wireStrapHolder(center=[-9.2,-1.2,-4.35], rotation=[0,0,0], inner=7.5, outer=10, width=5); 87 | wireStrapHolder(center=[-9.2,170-1.2,-4.35], rotation=[0,0,0], inner=7.5, outer=10, width=5); 88 | // edgeHolder 89 | for (a =[22.5:25:155]) edgeHolder([127, a, -5.25]); 90 | for (a =[22.5 - 9.2:25:70]) edgeHolder([a, 165, -5.25], 90); 91 | for (a =[22.5 - 9.2+75:25:110]) edgeHolder([a, 2, -5.25], 270); 92 | // keep the antenna out 93 | for (a =[22.5:25:65]) edgeHolder([-5, a, -5.25],180); 94 | for (a =[122.5:25:155]) edgeHolder([-5, a, -5.25],180); 95 | // holes for the screws for the lid 96 | translate([120,170-2*1.2-7, -3]) cylinder(h=10,r=2/2,center=true); 97 | translate([120,7, -3]) cylinder(h=10,r=2/2,center=true); 98 | 99 | // outside edges 45° about 0.5mm 100 | translate([-9.2,-1.2,10]) rotate([0,0,45]) cube([1,1,50], center=true); 101 | translate([-9.2,-1.2+170,10]) rotate([0,0,45]) cube([1,1,50], center=true); 102 | translate([-9.2+140,-1.2,10]) rotate([0,0,45]) cube([1,1,50], center=true); 103 | translate([-9.2+140,-1.2+170,10]) rotate([0,0,45]) cube([1,1,50], center=true); 104 | translate([65,-1.2,-12]) rotate([-45,0,0]) cube([150,1,1], center=true); 105 | translate([65,-1.2+170,-12]) rotate([-45,0,0]) cube([150,1,1], center=true); 106 | translate([-9.2,85,-12]) rotate([0,45,0]) cube([1,180,1], center=true); 107 | translate([-9.2+140,85,-12]) rotate([0,45,0]) cube([1,180,1], center=true); 108 | }; 109 | // pcbHolder, tanslate all on the bottom layer 110 | translate([0,0,-10.8]) { 111 | pcbHolder(center=[5.9, 7.5,0], topDia=9); 112 | pcbHolder(center=[65.9,7.5,0], topDia=9); 113 | pcbHolder(center=[5.9,149.2,0]); 114 | pcbHolder(center=[65.9,149.2,0]); 115 | }; 116 | 117 | // help during mount 118 | pcbClamp(center=[73.8,29.5,3.5], rotation=[0,0,90], l=3); 119 | pcbClamp(center=[73.8,112,3.5], rotation=[0,0,90], l=4); 120 | -------------------------------------------------------------------------------- /pcb/IMU.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 17 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Wire Wire Line 18 | 6450 4100 8900 4100 19 | Wire Wire Line 20 | 5850 2400 5750 2400 21 | Wire Wire Line 22 | 5750 2400 5750 2000 23 | Wire Wire Line 24 | 6050 2400 6150 2400 25 | Wire Wire Line 26 | 6150 2400 6150 2300 27 | $Comp 28 | L Device:C C51 29 | U 1 1 5CBA731C 30 | P 6300 2300 31 | F 0 "C51" V 6048 2300 50 0000 C CNN 32 | F 1 "100n" V 6139 2300 50 0000 C CNN 33 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6338 2150 50 0001 C CNN 34 | F 3 "~" H 6300 2300 50 0001 C CNN 35 | 1 6300 2300 36 | 0 1 1 0 37 | $EndComp 38 | $Comp 39 | L Device:C C50 40 | U 1 1 5CBA73BD 41 | P 6300 1800 42 | F 0 "C50" V 6048 1800 50 0000 C CNN 43 | F 1 "10u" V 6139 1800 50 0000 C CNN 44 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6338 1650 50 0001 C CNN 45 | F 3 "~" H 6300 1800 50 0001 C CNN 46 | 1 6300 1800 47 | 0 1 1 0 48 | $EndComp 49 | Wire Wire Line 50 | 5750 1250 6150 1250 51 | $Comp 52 | L Device:R R54 53 | U 1 1 5CBA757D 54 | P 6150 1400 55 | F 0 "R54" H 6220 1446 50 0000 L CNN 56 | F 1 "24" H 6220 1355 50 0000 L CNN 57 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6080 1400 50 0001 C CNN 58 | F 3 "~" H 6150 1400 50 0001 C CNN 59 | 1 6150 1400 60 | 1 0 0 -1 61 | $EndComp 62 | Connection ~ 6150 1250 63 | Wire Wire Line 64 | 6150 1250 7050 1250 65 | Wire Wire Line 66 | 6150 1550 6150 1800 67 | Connection ~ 6150 1800 68 | $Comp 69 | L Device:C C49 70 | U 1 1 5CBA774A 71 | P 5900 2000 72 | F 0 "C49" V 5648 2000 50 0000 C CNN 73 | F 1 "100n" V 5739 2000 50 0000 C CNN 74 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5938 1850 50 0001 C CNN 75 | F 3 "~" H 5900 2000 50 0001 C CNN 76 | 1 5900 2000 77 | 0 1 1 0 78 | $EndComp 79 | Connection ~ 5750 2000 80 | Wire Wire Line 81 | 5750 2000 5750 1250 82 | Connection ~ 6150 2300 83 | Wire Wire Line 84 | 6150 1800 6150 2300 85 | Wire Wire Line 86 | 6450 1800 8900 1800 87 | Wire Wire Line 88 | 8900 1800 8900 2000 89 | Connection ~ 8900 4100 90 | Wire Wire Line 91 | 8900 4100 10350 4100 92 | Wire Wire Line 93 | 6050 2000 8900 2000 94 | Connection ~ 8900 2000 95 | Wire Wire Line 96 | 8900 2000 8900 2300 97 | Wire Wire Line 98 | 6450 2300 8900 2300 99 | Connection ~ 8900 2300 100 | Wire Wire Line 101 | 8900 2300 8900 2900 102 | $Comp 103 | L Device:C C48 104 | U 1 1 5CBA7C6D 105 | P 4850 3950 106 | F 0 "C48" H 4735 3904 50 0000 R CNN 107 | F 1 "100n" H 4735 3995 50 0000 R CNN 108 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4888 3800 50 0001 C CNN 109 | F 3 "~" H 4850 3950 50 0001 C CNN 110 | 1 4850 3950 111 | -1 0 0 1 112 | $EndComp 113 | $Comp 114 | L Device:C C47 115 | U 1 1 5CBA7D22 116 | P 4450 3950 117 | F 0 "C47" H 4335 3904 50 0000 R CNN 118 | F 1 "10n" H 4335 3995 50 0000 R CNN 119 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4488 3800 50 0001 C CNN 120 | F 3 "~" H 4450 3950 50 0001 C CNN 121 | 1 4450 3950 122 | -1 0 0 1 123 | $EndComp 124 | Wire Wire Line 125 | 4850 3800 5050 3800 126 | Wire Wire Line 127 | 5050 3700 4450 3700 128 | Wire Wire Line 129 | 4450 3700 4450 3800 130 | Wire Wire Line 131 | 4450 4100 4850 4100 132 | Connection ~ 4850 4100 133 | Connection ~ 6150 2400 134 | Wire Wire Line 135 | 6450 3700 6450 4100 136 | Connection ~ 6450 3700 137 | Wire Wire Line 138 | 6450 3600 6450 3700 139 | Connection ~ 6450 3600 140 | Wire Wire Line 141 | 6450 3500 6450 3600 142 | Connection ~ 6450 3500 143 | Wire Wire Line 144 | 6450 3400 6450 3500 145 | Wire Wire Line 146 | 6450 3300 6450 3400 147 | Connection ~ 6450 3400 148 | Connection ~ 5750 2400 149 | $Comp 150 | L Sensor_Motion:LSM9DS1 U12 151 | U 1 1 5CBA7137 152 | P 5750 3200 153 | F 0 "U12" H 5750 2314 50 0000 C CNN 154 | F 1 "LSM9DS1" H 5750 2223 50 0000 C CNN 155 | F 2 "Package_LGA:LGA-24L_3x3.5mm_P0.43mm" H 7250 3950 50 0001 C CNN 156 | F 3 "http://www.st.com/content/ccc/resource/technical/document/datasheet/1e/3f/2a/d6/25/eb/48/46/DM00103319.pdf/files/DM00103319.pdf/jcr:content/translations/en.DM00103319.pdf" H 5750 3300 50 0001 C CNN 157 | 1 5750 3200 158 | 1 0 0 -1 159 | $EndComp 160 | Wire Wire Line 161 | 4850 4100 5650 4100 162 | Connection ~ 6450 4100 163 | Wire Wire Line 164 | 5850 4000 5850 4100 165 | Connection ~ 5850 4100 166 | Wire Wire Line 167 | 5850 4100 6450 4100 168 | Wire Wire Line 169 | 5650 4000 5650 4100 170 | Connection ~ 5650 4100 171 | Wire Wire Line 172 | 5650 4100 5850 4100 173 | Text HLabel 10400 1250 2 50 Input ~ 0 174 | +3V3 175 | Text HLabel 10350 4100 2 50 BiDi ~ 0 176 | GND 177 | Wire Wire Line 178 | 5050 2800 2000 2800 179 | Wire Wire Line 180 | 5050 2900 2000 2900 181 | Text HLabel 2000 2800 0 50 BiDi ~ 0 182 | SCL 183 | Text HLabel 2000 2900 0 50 BiDi ~ 0 184 | SDA 185 | Wire Wire Line 186 | 6450 2800 7050 2800 187 | Wire Wire Line 188 | 7050 2800 7050 1250 189 | Connection ~ 7050 1250 190 | Wire Wire Line 191 | 7050 1250 10400 1250 192 | Wire Wire Line 193 | 5750 1250 4450 1250 194 | Wire Wire Line 195 | 4450 1250 4450 3100 196 | Wire Wire Line 197 | 4450 3100 5050 3100 198 | Connection ~ 5750 1250 199 | Wire Wire Line 200 | 6450 2900 8900 2900 201 | Connection ~ 8900 2900 202 | Wire Wire Line 203 | 8900 2900 8900 4100 204 | Wire Wire Line 205 | 5050 3200 3400 3200 206 | Wire Wire Line 207 | 3400 3200 3400 4100 208 | Wire Wire Line 209 | 3400 4100 4450 4100 210 | Connection ~ 4450 4100 211 | $EndSCHEMATC 212 | -------------------------------------------------------------------------------- /pcb/RS232.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 16 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Interface_UART_own:ICL3221EIVZ IC3 19 | U 1 1 5CF77802 20 | P 5600 3150 21 | F 0 "IC3" H 5600 3765 50 0000 C CNN 22 | F 1 "ICL3221EIVZ" H 5600 3674 50 0000 C CNN 23 | F 2 "ICs_own:SOP65P640X120-16N" H 4500 2500 50 0001 L CNN 24 | F 3 "http://www.intersil.com/content/dam/Intersil/documents/icl3/icl3221e-22e-23e-32e-41e-43e.pdf" H 4500 2400 50 0001 L CNN 25 | F 4 "Intersil ICL3221EIVZ, Line Transceiver, EIA/TIA-232/ RS-232/ V.24/ V.28, 3.3 V, 5 V, 16-Pin TSSOP" H 4500 2300 50 0001 L CNN "Description" 26 | F 5 "1.2" H 6100 3300 50 0001 L CNN "Height" 27 | F 6 "Intersil" H 6100 3000 50 0001 L CNN "Manufacturer_Name" 28 | F 7 "ICL3221EIVZ" H 4500 2600 50 0001 L CNN "Manufacturer_Part_Number" 29 | 1 5600 3150 30 | 1 0 0 -1 31 | $EndComp 32 | $Comp 33 | L Device:C C45 34 | U 1 1 5CF77964 35 | P 4450 2100 36 | F 0 "C45" H 4335 2054 50 0000 R CNN 37 | F 1 "100n" H 4335 2145 50 0000 R CNN 38 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4488 1950 50 0001 C CNN 39 | F 3 "~" H 4450 2100 50 0001 C CNN 40 | 1 4450 2100 41 | -1 0 0 1 42 | $EndComp 43 | $Comp 44 | L Device:C C44 45 | U 1 1 5CF779C2 46 | P 3750 2500 47 | F 0 "C44" V 4002 2500 50 0000 C CNN 48 | F 1 "100n" V 3911 2500 50 0000 C CNN 49 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 3788 2350 50 0001 C CNN 50 | F 3 "~" H 3750 2500 50 0001 C CNN 51 | 1 3750 2500 52 | 0 -1 -1 0 53 | $EndComp 54 | $Comp 55 | L Device:C C46 56 | U 1 1 5CF77A14 57 | P 6400 2750 58 | F 0 "C46" H 6285 2704 50 0000 R CNN 59 | F 1 "100n" H 6285 2795 50 0000 R CNN 60 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6438 2600 50 0001 C CNN 61 | F 3 "~" H 6400 2750 50 0001 C CNN 62 | 1 6400 2750 63 | -1 0 0 1 64 | $EndComp 65 | $Comp 66 | L Device:C C43 67 | U 1 1 5CF77A3E 68 | P 3250 2500 69 | F 0 "C43" V 3502 2500 50 0000 C CNN 70 | F 1 "100n" V 3411 2500 50 0000 C CNN 71 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 3288 2350 50 0001 C CNN 72 | F 3 "~" H 3250 2500 50 0001 C CNN 73 | 1 3250 2500 74 | 0 -1 -1 0 75 | $EndComp 76 | NoConn ~ 6250 3400 77 | Wire Wire Line 78 | 4950 2900 3900 2900 79 | Wire Wire Line 80 | 3900 2900 3900 2500 81 | Wire Wire Line 82 | 4950 3100 3600 3100 83 | Wire Wire Line 84 | 3600 3100 3600 2500 85 | Wire Wire Line 86 | 9100 1750 8100 1750 87 | Wire Wire Line 88 | 4950 1750 4950 2800 89 | Wire Wire Line 90 | 6250 2900 6300 2900 91 | Wire Wire Line 92 | 6700 2900 6700 1900 93 | Wire Wire Line 94 | 6700 1900 9100 1900 95 | Wire Wire Line 96 | 6250 2800 6300 2800 97 | Wire Wire Line 98 | 6300 2800 6300 2900 99 | Connection ~ 6300 2900 100 | Wire Wire Line 101 | 6300 2900 6400 2900 102 | Connection ~ 6400 2900 103 | Wire Wire Line 104 | 6400 2900 6700 2900 105 | Wire Wire Line 106 | 6400 2600 6400 1750 107 | Connection ~ 6400 1750 108 | Wire Wire Line 109 | 6400 1750 4950 1750 110 | Wire Wire Line 111 | 4950 3200 3400 3200 112 | Wire Wire Line 113 | 3400 3200 3400 2500 114 | Wire Wire Line 115 | 4950 3300 3100 3300 116 | Wire Wire Line 117 | 3100 3300 3100 2500 118 | $Comp 119 | L Device:C C42 120 | U 1 1 5CF794FF 121 | P 2600 2100 122 | F 0 "C42" H 2485 2054 50 0000 R CNN 123 | F 1 "100n" H 2485 2145 50 0000 R CNN 124 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 2638 1950 50 0001 C CNN 125 | F 3 "~" H 2600 2100 50 0001 C CNN 126 | 1 2600 2100 127 | -1 0 0 1 128 | $EndComp 129 | Wire Wire Line 130 | 4950 3400 2600 3400 131 | Wire Wire Line 132 | 2600 3400 2600 2250 133 | Wire Wire Line 134 | 2600 1950 2600 1750 135 | Wire Wire Line 136 | 2600 1750 4450 1750 137 | Connection ~ 4950 1750 138 | Wire Wire Line 139 | 4450 1950 4450 1750 140 | Connection ~ 4450 1750 141 | Wire Wire Line 142 | 4450 1750 4950 1750 143 | Wire Wire Line 144 | 4450 2250 4450 3000 145 | Wire Wire Line 146 | 4450 3000 4950 3000 147 | Wire Wire Line 148 | 6250 3000 7100 3000 149 | Wire Wire Line 150 | 7100 3000 7100 1750 151 | Connection ~ 7100 1750 152 | Wire Wire Line 153 | 7100 1750 6400 1750 154 | Text HLabel 6250 3300 2 50 BiDi ~ 0 155 | UART_TX 156 | Text HLabel 6250 3500 2 50 BiDi ~ 0 157 | UART_RX 158 | Text HLabel 9100 1750 2 50 BiDi ~ 0 159 | GND 160 | Text HLabel 9100 1900 2 50 BiDi ~ 0 161 | +3V3 162 | $Comp 163 | L Connector:DB9_Male_MountingHoles J16 164 | U 1 1 5CADB03E 165 | P 5600 4900 166 | F 0 "J16" V 5473 5455 50 0000 L CNN 167 | F 1 "DB9_Male_MountingHoles" V 5564 5455 50 0000 L CNN 168 | F 2 "Connector_own:LD09P33E4GV00LF" H 5600 4900 50 0001 C CNN 169 | F 3 " ~" H 5600 4900 50 0001 C CNN 170 | 1 5600 4900 171 | 0 1 1 0 172 | $EndComp 173 | Wire Wire Line 174 | 5400 4600 5400 4050 175 | Wire Wire Line 176 | 5400 4050 4300 4050 177 | Wire Wire Line 178 | 4300 4050 4300 3500 179 | Wire Wire Line 180 | 4300 3500 4950 3500 181 | Wire Wire Line 182 | 6250 3100 6750 3100 183 | Wire Wire Line 184 | 6750 3100 6750 4050 185 | Wire Wire Line 186 | 6750 4050 5600 4050 187 | Wire Wire Line 188 | 5600 4050 5600 4600 189 | Wire Wire Line 190 | 6000 4600 6000 4350 191 | Wire Wire Line 192 | 6000 4350 7550 4350 193 | Wire Wire Line 194 | 7550 4350 7550 1750 195 | Connection ~ 7550 1750 196 | Wire Wire Line 197 | 7550 1750 7100 1750 198 | Wire Wire Line 199 | 8100 1750 8100 5600 200 | Wire Wire Line 201 | 8100 5600 5000 5600 202 | Wire Wire Line 203 | 5000 5600 5000 4900 204 | Connection ~ 8100 1750 205 | Wire Wire Line 206 | 8100 1750 7550 1750 207 | Wire Wire Line 208 | 6400 2900 6400 3200 209 | Wire Wire Line 210 | 6400 3200 6250 3200 211 | $EndSCHEMATC 212 | -------------------------------------------------------------------------------- /pcb/canTransceiver.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 11 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Interface_CAN_LIN_own:ATA6561-GAQW-N IC2 19 | U 1 1 5CACB7D0 20 | P 5550 2300 21 | F 0 "IC2" H 5550 2715 50 0000 C CNN 22 | F 1 "ATA6561-GAQW-N" H 5550 2624 50 0000 C CNN 23 | F 2 "ICs_own:SOIC127P600X175-8N" H 5950 2550 50 0001 L CNN 24 | F 3 "https://componentsearchengine.com/Datasheets/1/ATA6561-GAQW-N.pdf" H 5950 2450 50 0001 L CNN 25 | F 4 "MICROCHIP - ATA6561-GAQW-N - CAN TRANSCEIVER, 5MBPS, -40 TO 150DEG C" H 5950 2350 50 0001 L CNN "Description" 26 | F 5 "1.75" H 5950 2250 50 0001 L CNN "Height" 27 | F 6 "579-ATA6561-GAQW-N" H 5950 2150 50 0001 L CNN "Mouser Part Number" 28 | F 7 "https://www.mouser.com/Search/Refine.aspx?Keyword=579-ATA6561-GAQW-N" H 5950 2050 50 0001 L CNN "Mouser Price/Stock" 29 | F 8 "Microchip" H 5950 1950 50 0001 L CNN "Manufacturer_Name" 30 | F 9 "ATA6561-GAQW-N" H 5950 1850 50 0001 L CNN "Manufacturer_Part_Number" 31 | 1 5550 2300 32 | 1 0 0 -1 33 | $EndComp 34 | $Comp 35 | L Connector_Generic:Conn_02x02_Odd_Even J12 36 | U 1 1 5CACBC2B 37 | P 7200 1700 38 | F 0 "J12" H 7250 1375 50 0000 C CNN 39 | F 1 "Conn_02x02_Odd_Even" H 7250 1466 50 0000 C CNN 40 | F 2 "Connector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_Horizontal" H 7200 1700 50 0001 C CNN 41 | F 3 "~" H 7200 1700 50 0001 C CNN 42 | 1 7200 1700 43 | -1 0 0 -1 44 | $EndComp 45 | Wire Wire Line 46 | 6100 2350 7600 2350 47 | Wire Wire Line 48 | 9450 2250 6900 2250 49 | Wire Wire Line 50 | 7600 2350 7600 1800 51 | Connection ~ 7600 2350 52 | Wire Wire Line 53 | 7600 2350 9450 2350 54 | $Comp 55 | L Device:R R33 56 | U 1 1 5CACBF66 57 | P 6900 2100 58 | F 0 "R33" H 6970 2146 50 0000 L CNN 59 | F 1 "120" H 6970 2055 50 0000 L CNN 60 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6830 2100 50 0001 C CNN 61 | F 3 "~" H 6900 2100 50 0001 C CNN 62 | 1 6900 2100 63 | 1 0 0 -1 64 | $EndComp 65 | Connection ~ 6900 2250 66 | Wire Wire Line 67 | 6900 2250 6100 2250 68 | Wire Wire Line 69 | 7400 1700 7650 1700 70 | Text HLabel 1050 1350 0 50 Input ~ 0 71 | TXD 72 | Text HLabel 1050 1550 0 50 Output ~ 0 73 | RXD 74 | Text HLabel 1050 2800 0 50 BiDi ~ 0 75 | 5V 76 | Text HLabel 1050 2950 0 50 BiDi ~ 0 77 | 3V3 78 | Text HLabel 1050 3100 0 50 BiDi ~ 0 79 | GND 80 | Wire Wire Line 81 | 5000 2450 2550 2450 82 | Wire Wire Line 83 | 2550 2450 2550 1550 84 | Wire Wire Line 85 | 2550 1550 1050 1550 86 | Wire Wire Line 87 | 1050 2800 3500 2800 88 | Wire Wire Line 89 | 4800 2800 4800 2700 90 | Wire Wire Line 91 | 4800 2350 5000 2350 92 | Wire Wire Line 93 | 1050 2950 6100 2950 94 | Wire Wire Line 95 | 6100 2950 6100 2700 96 | $Comp 97 | L Device:C C27 98 | U 1 1 5CACCF27 99 | P 6250 2700 100 | F 0 "C27" V 5998 2700 50 0000 C CNN 101 | F 1 "100n" V 6089 2700 50 0000 C CNN 102 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6288 2550 50 0001 C CNN 103 | F 3 "~" H 6250 2700 50 0001 C CNN 104 | 1 6250 2700 105 | 0 1 1 0 106 | $EndComp 107 | Connection ~ 6100 2700 108 | Wire Wire Line 109 | 6100 2700 6100 2450 110 | Wire Wire Line 111 | 6100 2150 6400 2150 112 | Wire Wire Line 113 | 6400 2150 6400 2700 114 | Connection ~ 6400 2700 115 | Wire Wire Line 116 | 6400 2700 6400 3100 117 | $Comp 118 | L Device:C C26 119 | U 1 1 5CACD350 120 | P 4650 2700 121 | F 0 "C26" V 4398 2700 50 0000 C CNN 122 | F 1 "100n" V 4489 2700 50 0000 C CNN 123 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4688 2550 50 0001 C CNN 124 | F 3 "~" H 4650 2700 50 0001 C CNN 125 | 1 4650 2700 126 | 0 1 1 0 127 | $EndComp 128 | Connection ~ 4800 2700 129 | Wire Wire Line 130 | 4800 2700 4800 2350 131 | Wire Wire Line 132 | 1050 3100 3500 3100 133 | Wire Wire Line 134 | 4500 2250 4500 2700 135 | Wire Wire Line 136 | 4500 2250 5000 2250 137 | Connection ~ 4500 3100 138 | Wire Wire Line 139 | 4500 3100 6400 3100 140 | Connection ~ 4500 2700 141 | Wire Wire Line 142 | 4500 2700 4500 3100 143 | $Comp 144 | L Device:C C25 145 | U 1 1 5CACDBDC 146 | P 3500 2950 147 | F 0 "C25" H 3615 2996 50 0000 L CNN 148 | F 1 "22u" H 3615 2905 50 0000 L CNN 149 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 3538 2800 50 0001 C CNN 150 | F 3 "~" H 3500 2950 50 0001 C CNN 151 | 1 3500 2950 152 | 1 0 0 -1 153 | $EndComp 154 | Connection ~ 3500 2800 155 | Wire Wire Line 156 | 3500 2800 4800 2800 157 | Connection ~ 3500 3100 158 | Wire Wire Line 159 | 3500 3100 4500 3100 160 | $Comp 161 | L Connector_own:PTSM-Header-Horizontal-2 J18 162 | U 1 1 5CC27296 163 | P 9850 2300 164 | F 0 "J18" H 10078 2346 50 0000 L CNN 165 | F 1 "PTSM-Header-Horizontal-2" H 10078 2255 50 0000 L CNN 166 | F 2 "Connector_own:1814841" H 9100 2000 50 0001 L CNN 167 | F 3 "" H 9100 1900 50 0001 L CNN 168 | F 4 "Phoenix Contact PTSM Series, 2.5mm Pitch 2 Way 1 Row Right Angle PCB Terminal Block, Solder Termination, 6A" H 9100 1800 50 0001 L CNN "Description" 169 | F 5 "5" H 9100 1700 50 0001 L CNN "Height" 170 | F 6 "651-1814841" H 9100 1600 50 0001 L CNN "Mouser Part Number" 171 | F 7 "https://www.mouser.com/Search/Refine.aspx?Keyword=651-1814841" H 9100 1500 50 0001 L CNN "Mouser Price/Stock" 172 | F 8 "Phoenix Contact" H 9100 1400 50 0001 L CNN "Manufacturer_Name" 173 | F 9 "1814841" H 9100 1300 50 0001 L CNN "Manufacturer_Part_Number" 174 | 1 9850 2300 175 | 1 0 0 -1 176 | $EndComp 177 | Wire Wire Line 178 | 5000 1050 7650 1050 179 | Wire Wire Line 180 | 7650 1050 7650 1700 181 | Wire Wire Line 182 | 5000 1050 5000 2150 183 | Wire Wire Line 184 | 3800 1700 3800 1350 185 | Wire Wire Line 186 | 3800 1350 1050 1350 187 | Wire Wire Line 188 | 7400 1800 7600 1800 189 | Wire Wire Line 190 | 3800 1700 6900 1700 191 | Wire Wire Line 192 | 6900 1800 6900 1950 193 | $EndSCHEMATC 194 | -------------------------------------------------------------------------------- /code/HW-Test/Adafruit_ADS1015.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file Adafruit_ADS1015.h 4 | @author K. Townsend (Adafruit Industries) 5 | @license BSD (see license.txt) 6 | 7 | This is a library for the Adafruit ADS1015 breakout board 8 | ----> https://www.adafruit.com/products/??? 9 | 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit and open-source hardware by purchasing 12 | products from Adafruit! 13 | 14 | @section HISTORY 15 | 16 | v1.0 - First release 17 | v1.1 - Added ADS1115 support - W. Earl 18 | */ 19 | /**************************************************************************/ 20 | 21 | #if ARDUINO >= 100 22 | #include "Arduino.h" 23 | #else 24 | #include "WProgram.h" 25 | #endif 26 | 27 | #include 28 | 29 | /*========================================================================= 30 | I2C ADDRESS/BITS 31 | -----------------------------------------------------------------------*/ 32 | #define ADS1015_ADDRESS (0x48) // 1001 000 (ADDR = GND) 33 | /*=========================================================================*/ 34 | 35 | /*========================================================================= 36 | CONVERSION DELAY (in mS) 37 | -----------------------------------------------------------------------*/ 38 | #define ADS1015_CONVERSIONDELAY (1) 39 | #define ADS1115_CONVERSIONDELAY (8) 40 | /*=========================================================================*/ 41 | 42 | /*========================================================================= 43 | POINTER REGISTER 44 | -----------------------------------------------------------------------*/ 45 | #define ADS1015_REG_POINTER_MASK (0x03) 46 | #define ADS1015_REG_POINTER_CONVERT (0x00) 47 | #define ADS1015_REG_POINTER_CONFIG (0x01) 48 | #define ADS1015_REG_POINTER_LOWTHRESH (0x02) 49 | #define ADS1015_REG_POINTER_HITHRESH (0x03) 50 | /*=========================================================================*/ 51 | 52 | /*========================================================================= 53 | CONFIG REGISTER 54 | -----------------------------------------------------------------------*/ 55 | #define ADS1015_REG_CONFIG_OS_MASK (0x8000) 56 | #define ADS1015_REG_CONFIG_OS_SINGLE (0x8000) // Write: Set to start a single-conversion 57 | #define ADS1015_REG_CONFIG_OS_BUSY (0x0000) // Read: Bit = 0 when conversion is in progress 58 | #define ADS1015_REG_CONFIG_OS_NOTBUSY (0x8000) // Read: Bit = 1 when device is not performing a conversion 59 | 60 | #define ADS1015_REG_CONFIG_MUX_MASK (0x7000) 61 | #define ADS1015_REG_CONFIG_MUX_DIFF_0_1 (0x0000) // Differential P = AIN0, N = AIN1 (default) 62 | #define ADS1015_REG_CONFIG_MUX_DIFF_0_3 (0x1000) // Differential P = AIN0, N = AIN3 63 | #define ADS1015_REG_CONFIG_MUX_DIFF_1_3 (0x2000) // Differential P = AIN1, N = AIN3 64 | #define ADS1015_REG_CONFIG_MUX_DIFF_2_3 (0x3000) // Differential P = AIN2, N = AIN3 65 | #define ADS1015_REG_CONFIG_MUX_SINGLE_0 (0x4000) // Single-ended AIN0 66 | #define ADS1015_REG_CONFIG_MUX_SINGLE_1 (0x5000) // Single-ended AIN1 67 | #define ADS1015_REG_CONFIG_MUX_SINGLE_2 (0x6000) // Single-ended AIN2 68 | #define ADS1015_REG_CONFIG_MUX_SINGLE_3 (0x7000) // Single-ended AIN3 69 | 70 | #define ADS1015_REG_CONFIG_PGA_MASK (0x0E00) 71 | #define ADS1015_REG_CONFIG_PGA_6_144V (0x0000) // +/-6.144V range = Gain 2/3 72 | #define ADS1015_REG_CONFIG_PGA_4_096V (0x0200) // +/-4.096V range = Gain 1 73 | #define ADS1015_REG_CONFIG_PGA_2_048V (0x0400) // +/-2.048V range = Gain 2 (default) 74 | #define ADS1015_REG_CONFIG_PGA_1_024V (0x0600) // +/-1.024V range = Gain 4 75 | #define ADS1015_REG_CONFIG_PGA_0_512V (0x0800) // +/-0.512V range = Gain 8 76 | #define ADS1015_REG_CONFIG_PGA_0_256V (0x0A00) // +/-0.256V range = Gain 16 77 | 78 | #define ADS1015_REG_CONFIG_MODE_MASK (0x0100) 79 | #define ADS1015_REG_CONFIG_MODE_CONTIN (0x0000) // Continuous conversion mode 80 | #define ADS1015_REG_CONFIG_MODE_SINGLE (0x0100) // Power-down single-shot mode (default) 81 | 82 | #define ADS1015_REG_CONFIG_DR_MASK (0x00E0) 83 | #define ADS1015_REG_CONFIG_DR_128SPS (0x0000) // 128 samples per second 84 | #define ADS1015_REG_CONFIG_DR_250SPS (0x0020) // 250 samples per second 85 | #define ADS1015_REG_CONFIG_DR_490SPS (0x0040) // 490 samples per second 86 | #define ADS1015_REG_CONFIG_DR_920SPS (0x0060) // 920 samples per second 87 | #define ADS1015_REG_CONFIG_DR_1600SPS (0x0080) // 1600 samples per second (default) 88 | #define ADS1015_REG_CONFIG_DR_2400SPS (0x00A0) // 2400 samples per second 89 | #define ADS1015_REG_CONFIG_DR_3300SPS (0x00C0) // 3300 samples per second 90 | 91 | #define ADS1015_REG_CONFIG_CMODE_MASK (0x0010) 92 | #define ADS1015_REG_CONFIG_CMODE_TRAD (0x0000) // Traditional comparator with hysteresis (default) 93 | #define ADS1015_REG_CONFIG_CMODE_WINDOW (0x0010) // Window comparator 94 | 95 | #define ADS1015_REG_CONFIG_CPOL_MASK (0x0008) 96 | #define ADS1015_REG_CONFIG_CPOL_ACTVLOW (0x0000) // ALERT/RDY pin is low when active (default) 97 | #define ADS1015_REG_CONFIG_CPOL_ACTVHI (0x0008) // ALERT/RDY pin is high when active 98 | 99 | #define ADS1015_REG_CONFIG_CLAT_MASK (0x0004) // Determines if ALERT/RDY pin latches once asserted 100 | #define ADS1015_REG_CONFIG_CLAT_NONLAT (0x0000) // Non-latching comparator (default) 101 | #define ADS1015_REG_CONFIG_CLAT_LATCH (0x0004) // Latching comparator 102 | 103 | #define ADS1015_REG_CONFIG_CQUE_MASK (0x0003) 104 | #define ADS1015_REG_CONFIG_CQUE_1CONV (0x0000) // Assert ALERT/RDY after one conversions 105 | #define ADS1015_REG_CONFIG_CQUE_2CONV (0x0001) // Assert ALERT/RDY after two conversions 106 | #define ADS1015_REG_CONFIG_CQUE_4CONV (0x0002) // Assert ALERT/RDY after four conversions 107 | #define ADS1015_REG_CONFIG_CQUE_NONE (0x0003) // Disable the comparator and put ALERT/RDY in high state (default) 108 | /*=========================================================================*/ 109 | 110 | typedef enum 111 | { 112 | GAIN_TWOTHIRDS = ADS1015_REG_CONFIG_PGA_6_144V, 113 | GAIN_ONE = ADS1015_REG_CONFIG_PGA_4_096V, 114 | GAIN_TWO = ADS1015_REG_CONFIG_PGA_2_048V, 115 | GAIN_FOUR = ADS1015_REG_CONFIG_PGA_1_024V, 116 | GAIN_EIGHT = ADS1015_REG_CONFIG_PGA_0_512V, 117 | GAIN_SIXTEEN = ADS1015_REG_CONFIG_PGA_0_256V 118 | } adsGain_t; 119 | 120 | class Adafruit_ADS1015 121 | { 122 | protected: 123 | // Instance-specific properties 124 | uint8_t m_i2cAddress; 125 | uint8_t m_conversionDelay; 126 | uint8_t m_bitShift; 127 | adsGain_t m_gain; 128 | 129 | public: 130 | Adafruit_ADS1015(uint8_t i2cAddress = ADS1015_ADDRESS); 131 | void begin(void); 132 | uint16_t readADC_SingleEnded(uint8_t channel); 133 | int16_t readADC_Differential_0_1(void); 134 | int16_t readADC_Differential_2_3(void); 135 | void startComparator_SingleEnded(uint8_t channel, int16_t threshold); 136 | int16_t getLastConversionResults(); 137 | void setGain(adsGain_t gain); 138 | adsGain_t getGain(void); 139 | 140 | private: 141 | }; 142 | 143 | // Derive from ADS1105 & override construction to set properties 144 | class Adafruit_ADS1115 : public Adafruit_ADS1015 145 | { 146 | public: 147 | Adafruit_ADS1115(uint8_t i2cAddress = ADS1015_ADDRESS); 148 | 149 | private: 150 | }; 151 | -------------------------------------------------------------------------------- /code/Load-Test/Adafruit_ADS1015.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file Adafruit_ADS1015.h 4 | @author K. Townsend (Adafruit Industries) 5 | @license BSD (see license.txt) 6 | 7 | This is a library for the Adafruit ADS1015 breakout board 8 | ----> https://www.adafruit.com/products/??? 9 | 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit and open-source hardware by purchasing 12 | products from Adafruit! 13 | 14 | @section HISTORY 15 | 16 | v1.0 - First release 17 | v1.1 - Added ADS1115 support - W. Earl 18 | */ 19 | /**************************************************************************/ 20 | 21 | #if ARDUINO >= 100 22 | #include "Arduino.h" 23 | #else 24 | #include "WProgram.h" 25 | #endif 26 | 27 | #include 28 | 29 | /*========================================================================= 30 | I2C ADDRESS/BITS 31 | -----------------------------------------------------------------------*/ 32 | #define ADS1015_ADDRESS (0x48) // 1001 000 (ADDR = GND) 33 | /*=========================================================================*/ 34 | 35 | /*========================================================================= 36 | CONVERSION DELAY (in mS) 37 | -----------------------------------------------------------------------*/ 38 | #define ADS1015_CONVERSIONDELAY (1) 39 | #define ADS1115_CONVERSIONDELAY (8) 40 | /*=========================================================================*/ 41 | 42 | /*========================================================================= 43 | POINTER REGISTER 44 | -----------------------------------------------------------------------*/ 45 | #define ADS1015_REG_POINTER_MASK (0x03) 46 | #define ADS1015_REG_POINTER_CONVERT (0x00) 47 | #define ADS1015_REG_POINTER_CONFIG (0x01) 48 | #define ADS1015_REG_POINTER_LOWTHRESH (0x02) 49 | #define ADS1015_REG_POINTER_HITHRESH (0x03) 50 | /*=========================================================================*/ 51 | 52 | /*========================================================================= 53 | CONFIG REGISTER 54 | -----------------------------------------------------------------------*/ 55 | #define ADS1015_REG_CONFIG_OS_MASK (0x8000) 56 | #define ADS1015_REG_CONFIG_OS_SINGLE (0x8000) // Write: Set to start a single-conversion 57 | #define ADS1015_REG_CONFIG_OS_BUSY (0x0000) // Read: Bit = 0 when conversion is in progress 58 | #define ADS1015_REG_CONFIG_OS_NOTBUSY (0x8000) // Read: Bit = 1 when device is not performing a conversion 59 | 60 | #define ADS1015_REG_CONFIG_MUX_MASK (0x7000) 61 | #define ADS1015_REG_CONFIG_MUX_DIFF_0_1 (0x0000) // Differential P = AIN0, N = AIN1 (default) 62 | #define ADS1015_REG_CONFIG_MUX_DIFF_0_3 (0x1000) // Differential P = AIN0, N = AIN3 63 | #define ADS1015_REG_CONFIG_MUX_DIFF_1_3 (0x2000) // Differential P = AIN1, N = AIN3 64 | #define ADS1015_REG_CONFIG_MUX_DIFF_2_3 (0x3000) // Differential P = AIN2, N = AIN3 65 | #define ADS1015_REG_CONFIG_MUX_SINGLE_0 (0x4000) // Single-ended AIN0 66 | #define ADS1015_REG_CONFIG_MUX_SINGLE_1 (0x5000) // Single-ended AIN1 67 | #define ADS1015_REG_CONFIG_MUX_SINGLE_2 (0x6000) // Single-ended AIN2 68 | #define ADS1015_REG_CONFIG_MUX_SINGLE_3 (0x7000) // Single-ended AIN3 69 | 70 | #define ADS1015_REG_CONFIG_PGA_MASK (0x0E00) 71 | #define ADS1015_REG_CONFIG_PGA_6_144V (0x0000) // +/-6.144V range = Gain 2/3 72 | #define ADS1015_REG_CONFIG_PGA_4_096V (0x0200) // +/-4.096V range = Gain 1 73 | #define ADS1015_REG_CONFIG_PGA_2_048V (0x0400) // +/-2.048V range = Gain 2 (default) 74 | #define ADS1015_REG_CONFIG_PGA_1_024V (0x0600) // +/-1.024V range = Gain 4 75 | #define ADS1015_REG_CONFIG_PGA_0_512V (0x0800) // +/-0.512V range = Gain 8 76 | #define ADS1015_REG_CONFIG_PGA_0_256V (0x0A00) // +/-0.256V range = Gain 16 77 | 78 | #define ADS1015_REG_CONFIG_MODE_MASK (0x0100) 79 | #define ADS1015_REG_CONFIG_MODE_CONTIN (0x0000) // Continuous conversion mode 80 | #define ADS1015_REG_CONFIG_MODE_SINGLE (0x0100) // Power-down single-shot mode (default) 81 | 82 | #define ADS1015_REG_CONFIG_DR_MASK (0x00E0) 83 | #define ADS1015_REG_CONFIG_DR_128SPS (0x0000) // 128 samples per second 84 | #define ADS1015_REG_CONFIG_DR_250SPS (0x0020) // 250 samples per second 85 | #define ADS1015_REG_CONFIG_DR_490SPS (0x0040) // 490 samples per second 86 | #define ADS1015_REG_CONFIG_DR_920SPS (0x0060) // 920 samples per second 87 | #define ADS1015_REG_CONFIG_DR_1600SPS (0x0080) // 1600 samples per second (default) 88 | #define ADS1015_REG_CONFIG_DR_2400SPS (0x00A0) // 2400 samples per second 89 | #define ADS1015_REG_CONFIG_DR_3300SPS (0x00C0) // 3300 samples per second 90 | 91 | #define ADS1015_REG_CONFIG_CMODE_MASK (0x0010) 92 | #define ADS1015_REG_CONFIG_CMODE_TRAD (0x0000) // Traditional comparator with hysteresis (default) 93 | #define ADS1015_REG_CONFIG_CMODE_WINDOW (0x0010) // Window comparator 94 | 95 | #define ADS1015_REG_CONFIG_CPOL_MASK (0x0008) 96 | #define ADS1015_REG_CONFIG_CPOL_ACTVLOW (0x0000) // ALERT/RDY pin is low when active (default) 97 | #define ADS1015_REG_CONFIG_CPOL_ACTVHI (0x0008) // ALERT/RDY pin is high when active 98 | 99 | #define ADS1015_REG_CONFIG_CLAT_MASK (0x0004) // Determines if ALERT/RDY pin latches once asserted 100 | #define ADS1015_REG_CONFIG_CLAT_NONLAT (0x0000) // Non-latching comparator (default) 101 | #define ADS1015_REG_CONFIG_CLAT_LATCH (0x0004) // Latching comparator 102 | 103 | #define ADS1015_REG_CONFIG_CQUE_MASK (0x0003) 104 | #define ADS1015_REG_CONFIG_CQUE_1CONV (0x0000) // Assert ALERT/RDY after one conversions 105 | #define ADS1015_REG_CONFIG_CQUE_2CONV (0x0001) // Assert ALERT/RDY after two conversions 106 | #define ADS1015_REG_CONFIG_CQUE_4CONV (0x0002) // Assert ALERT/RDY after four conversions 107 | #define ADS1015_REG_CONFIG_CQUE_NONE (0x0003) // Disable the comparator and put ALERT/RDY in high state (default) 108 | /*=========================================================================*/ 109 | 110 | typedef enum 111 | { 112 | GAIN_TWOTHIRDS = ADS1015_REG_CONFIG_PGA_6_144V, 113 | GAIN_ONE = ADS1015_REG_CONFIG_PGA_4_096V, 114 | GAIN_TWO = ADS1015_REG_CONFIG_PGA_2_048V, 115 | GAIN_FOUR = ADS1015_REG_CONFIG_PGA_1_024V, 116 | GAIN_EIGHT = ADS1015_REG_CONFIG_PGA_0_512V, 117 | GAIN_SIXTEEN = ADS1015_REG_CONFIG_PGA_0_256V 118 | } adsGain_t; 119 | 120 | class Adafruit_ADS1015 121 | { 122 | protected: 123 | // Instance-specific properties 124 | uint8_t m_i2cAddress; 125 | uint8_t m_conversionDelay; 126 | uint8_t m_bitShift; 127 | adsGain_t m_gain; 128 | 129 | public: 130 | Adafruit_ADS1015(uint8_t i2cAddress = ADS1015_ADDRESS); 131 | void begin(void); 132 | uint16_t readADC_SingleEnded(uint8_t channel); 133 | int16_t readADC_Differential_0_1(void); 134 | int16_t readADC_Differential_2_3(void); 135 | void startComparator_SingleEnded(uint8_t channel, int16_t threshold); 136 | int16_t getLastConversionResults(); 137 | void setGain(adsGain_t gain); 138 | adsGain_t getGain(void); 139 | 140 | private: 141 | }; 142 | 143 | // Derive from ADS1105 & override construction to set properties 144 | class Adafruit_ADS1115 : public Adafruit_ADS1015 145 | { 146 | public: 147 | Adafruit_ADS1115(uint8_t i2cAddress = ADS1015_ADDRESS); 148 | 149 | private: 150 | }; 151 | -------------------------------------------------------------------------------- /pcb/ADS-Input.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 6 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Text HLabel 10950 4650 2 50 BiDi ~ 0 18 | GND 19 | Text HLabel 10950 3400 2 50 BiDi ~ 0 20 | SDA 21 | Text HLabel 10950 3300 2 50 Input ~ 0 22 | SCL 23 | Text HLabel 10950 2050 2 50 Input ~ 0 24 | 5V 25 | Wire Wire Line 26 | 6400 3700 6400 4650 27 | Wire Wire Line 28 | 6400 4650 7550 4650 29 | Text HLabel 10950 4200 2 50 Input ~ 0 30 | Addr 31 | Wire Wire Line 32 | 6800 4200 6800 3500 33 | $Comp 34 | L Device:C C19 35 | U 1 1 5C558E00 36 | P 7550 2200 37 | F 0 "C19" H 7665 2246 50 0000 L CNN 38 | F 1 "100n" H 7665 2155 50 0000 L CNN 39 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 7588 2050 50 0001 C CNN 40 | F 3 "~" H 7550 2200 50 0001 C CNN 41 | 1 7550 2200 42 | 1 0 0 -1 43 | $EndComp 44 | Wire Wire Line 45 | 6400 2050 6400 2800 46 | Wire Wire Line 47 | 7550 2350 7550 4650 48 | $Comp 49 | L Analog_ADC:ADS1115IDGS U4 50 | U 1 1 5C55ACA7 51 | P 6400 3300 52 | F 0 "U4" H 6400 3978 50 0000 C CNN 53 | F 1 "ADS1115IDGS" H 6400 3887 50 0000 C CNN 54 | F 2 "Package_SO:MSOP-10_3x3mm_P0.5mm" H 6400 2800 50 0001 C CNN 55 | F 3 "http://www.ti.com/lit/ds/symlink/ads1113.pdf" H 6350 2400 50 0001 C CNN 56 | 1 6400 3300 57 | 1 0 0 -1 58 | $EndComp 59 | NoConn ~ 6800 3100 60 | $Comp 61 | L Device:R R24 62 | U 1 1 5C56603C 63 | P 4150 3000 64 | F 0 "R24" V 3943 3000 50 0000 C CNN 65 | F 1 "47k" V 4034 3000 50 0000 C CNN 66 | F 2 "Resistor_SMD:R_0805_2012Metric" V 4080 3000 50 0001 C CNN 67 | F 3 "~" H 4150 3000 50 0001 C CNN 68 | 1 4150 3000 69 | 0 1 1 0 70 | $EndComp 71 | $Comp 72 | L Device:R R23 73 | U 1 1 5C5660E7 74 | P 3250 3200 75 | F 0 "R23" V 3043 3200 50 0000 C CNN 76 | F 1 "47k" V 3134 3200 50 0000 C CNN 77 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3180 3200 50 0001 C CNN 78 | F 3 "~" H 3250 3200 50 0001 C CNN 79 | 1 3250 3200 80 | 0 1 1 0 81 | $EndComp 82 | $Comp 83 | L Device:C C17 84 | U 1 1 5C56618F 85 | P 4400 3850 86 | F 0 "C17" H 4515 3896 50 0000 L CNN 87 | F 1 "1n" H 4515 3805 50 0000 L CNN 88 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4438 3700 50 0001 C CNN 89 | F 3 "~" H 4400 3850 50 0001 C CNN 90 | 1 4400 3850 91 | 1 0 0 -1 92 | $EndComp 93 | $Comp 94 | L Device:C C18 95 | U 1 1 5C566227 96 | P 4900 3850 97 | F 0 "C18" H 5015 3896 50 0000 L CNN 98 | F 1 "1n" H 5015 3805 50 0000 L CNN 99 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4938 3700 50 0001 C CNN 100 | F 3 "~" H 4900 3850 50 0001 C CNN 101 | 1 4900 3850 102 | 1 0 0 -1 103 | $EndComp 104 | Wire Wire Line 105 | 4400 4650 4400 4000 106 | Connection ~ 6400 4650 107 | Wire Wire Line 108 | 4900 4000 4900 4650 109 | Wire Wire Line 110 | 4400 4650 4900 4650 111 | Connection ~ 4900 4650 112 | Wire Wire Line 113 | 6400 2050 7550 2050 114 | Wire Wire Line 115 | 7550 2050 8100 2050 116 | Connection ~ 7550 2050 117 | $Comp 118 | L Device:C C20 119 | U 1 1 5CA415B4 120 | P 8100 2200 121 | F 0 "C20" H 8215 2246 50 0000 L CNN 122 | F 1 "22u" H 8215 2155 50 0000 L CNN 123 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 8138 2050 50 0001 C CNN 124 | F 3 "~" H 8100 2200 50 0001 C CNN 125 | 1 8100 2200 126 | 1 0 0 -1 127 | $EndComp 128 | Wire Wire Line 129 | 8100 2350 7550 2350 130 | Connection ~ 7550 2350 131 | $Comp 132 | L Device:R R2 133 | U 1 1 5CA41C10 134 | P 8800 2050 135 | F 0 "R2" V 8990 2050 50 0000 C CNN 136 | F 1 "24" V 8899 2050 50 0000 C CNN 137 | F 2 "Resistor_SMD:R_0805_2012Metric" H 8800 2050 50 0001 C CNN 138 | F 3 "~" H 8800 2050 50 0001 C CNN 139 | 1 8800 2050 140 | 0 -1 -1 0 141 | $EndComp 142 | Wire Wire Line 143 | 8100 2050 8650 2050 144 | Connection ~ 8100 2050 145 | Wire Wire Line 146 | 8950 2050 10950 2050 147 | Wire Wire Line 148 | 6800 3300 10950 3300 149 | Wire Wire Line 150 | 6800 3400 10950 3400 151 | Wire Wire Line 152 | 6800 4200 10950 4200 153 | $Comp 154 | L Device:R R25 155 | U 1 1 5CA430FD 156 | P 5400 2050 157 | F 0 "R25" V 5193 2050 50 0000 C CNN 158 | F 1 "120" V 5284 2050 50 0000 C CNN 159 | F 2 "Resistor_SMD:R_0805_2012Metric" V 5330 2050 50 0001 C CNN 160 | F 3 "~" H 5400 2050 50 0001 C CNN 161 | 1 5400 2050 162 | 0 1 1 0 163 | $EndComp 164 | Wire Wire Line 165 | 6400 2050 5550 2050 166 | Connection ~ 6400 2050 167 | Connection ~ 4400 4650 168 | Wire Wire Line 169 | 7550 4650 10950 4650 170 | Connection ~ 7550 4650 171 | Wire Wire Line 172 | 4900 4650 6400 4650 173 | $Comp 174 | L Device:C C16 175 | U 1 1 5CCCE578 176 | P 3900 3850 177 | F 0 "C16" H 4015 3896 50 0000 L CNN 178 | F 1 "1n" H 4015 3805 50 0000 L CNN 179 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 3938 3700 50 0001 C CNN 180 | F 3 "~" H 3900 3850 50 0001 C CNN 181 | 1 3900 3850 182 | 1 0 0 -1 183 | $EndComp 184 | $Comp 185 | L Device:R R22 186 | U 1 1 5CCCEF84 187 | P 2350 3400 188 | F 0 "R22" V 2143 3400 50 0000 C CNN 189 | F 1 "47k" V 2234 3400 50 0000 C CNN 190 | F 2 "Resistor_SMD:R_0805_2012Metric" V 2280 3400 50 0001 C CNN 191 | F 3 "~" H 2350 3400 50 0001 C CNN 192 | 1 2350 3400 193 | 0 1 1 0 194 | $EndComp 195 | Wire Wire Line 196 | 5200 2050 5200 3500 197 | Wire Wire Line 198 | 5200 3500 6000 3500 199 | Connection ~ 5200 2050 200 | Wire Wire Line 201 | 5200 2050 5250 2050 202 | Wire Wire Line 203 | 6000 3400 3900 3400 204 | Wire Wire Line 205 | 6000 3300 4400 3300 206 | Wire Wire Line 207 | 3400 3300 3400 3200 208 | Wire Wire Line 209 | 4300 3000 4300 3200 210 | Wire Wire Line 211 | 4300 3200 4900 3200 212 | Wire Wire Line 213 | 3900 4000 3900 4650 214 | Connection ~ 3900 4650 215 | Wire Wire Line 216 | 3900 4650 4400 4650 217 | Wire Wire Line 218 | 3900 3700 3900 3400 219 | Connection ~ 3900 3400 220 | Wire Wire Line 221 | 3900 3400 2500 3400 222 | Wire Wire Line 223 | 4400 3700 4400 3300 224 | Connection ~ 4400 3300 225 | Wire Wire Line 226 | 4400 3300 3400 3300 227 | Wire Wire Line 228 | 4900 3700 4900 3200 229 | Connection ~ 4900 3200 230 | Wire Wire Line 231 | 4900 3200 6000 3200 232 | $Comp 233 | L Connector_own:PTSM-Header-Horizontal-5 J5 234 | U 1 1 5CCCDB32 235 | P 1250 3300 236 | F 0 "J5" H 1250 3665 50 0000 C CNN 237 | F 1 "PTSM-Header-Horizontal-5" H 1250 3574 50 0000 C CNN 238 | F 2 "Connector_own:1814870" H 750 2800 50 0001 L CNN 239 | F 3 "https://media.digikey.com/pdf/Data%20Sheets/Phoenix%20Contact%20PDFs/1814870.pdf" H 750 3000 50 0001 L CNN 240 | F 4 "Phoenix Contact PTSM Series, 2.5mm Pitch 5 Way 1 Row Right Angle PCB Terminal Block, Solder Termination, 6A" H 750 2900 50 0001 L CNN "Description" 241 | F 5 "5" H 750 2300 50 0001 L CNN "Height" 242 | F 6 "651-1814870" H 750 2700 50 0001 L CNN "Mouser Part Number" 243 | F 7 "https://www.mouser.com/Search/Refine.aspx?Keyword=651-1814870" H 750 2400 50 0001 L CNN "Mouser Price/Stock" 244 | F 8 "Phoenix Contact" H 750 2600 50 0001 L CNN "Manufacturer_Name" 245 | F 9 "1814870" H 750 2500 50 0001 L CNN "Manufacturer_Part_Number" 246 | 1 1250 3300 247 | 1 0 0 -1 248 | $EndComp 249 | Wire Wire Line 250 | 850 3000 850 3200 251 | Wire Wire Line 252 | 1650 3200 3100 3200 253 | Wire Wire Line 254 | 600 4650 600 3300 255 | Wire Wire Line 256 | 600 3300 850 3300 257 | Wire Wire Line 258 | 600 4650 3900 4650 259 | Wire Wire Line 260 | 1700 2050 1700 3300 261 | Wire Wire Line 262 | 1700 3300 1650 3300 263 | Wire Wire Line 264 | 2200 3400 1650 3400 265 | Wire Wire Line 266 | 1650 3400 1650 3750 267 | Wire Wire Line 268 | 1650 3750 850 3750 269 | Wire Wire Line 270 | 850 3750 850 3400 271 | Wire Wire Line 272 | 1700 2050 5200 2050 273 | Wire Wire Line 274 | 850 3000 4000 3000 275 | $EndSCHEMATC 276 | -------------------------------------------------------------------------------- /pcb/bom/AllPartslist.csv: -------------------------------------------------------------------------------- 1 | Designator,Qty,MPN/Seeed SKU,type,value,detail,mouserNO.,DigikeyNO.,footprints 2 | "C1, C3, C4, C2, C8, C12, C19, C21, C27, C26, C28, C30, C29, C32, C39, C41, C36, C38, C45, C44, C46, C43, C42, C51, C49, C48, C35",26,302010165,C,100n,Unpolarized capacitor,603-CC805KRX7R9BB104,,Capacitor_SMD:C_0805_2012Metric 3 | "C5, C10, C11, C9, C20, C25, C37, ",7,302010171,C,22u,Unpolarized capacitor,963-LMK212BBJ226MG-T,,Capacitor_SMD:C_0805_2012Metric 4 | "C6, C13, C22, C33, ",4,-,CP,560u,Polarized capacitor,647-UCM1V561MNL1GS ,,Capacitor_SMD:CP_Elec_10x10.5 5 | "C7, C50, ",2,302010158,C,10u,Unpolarized capacitor,81-GRM21BR61E106MA3L,,Capacitor_SMD:C_0805_2012Metric 6 | "C14, C15, C17, C18, C16, C23, C24, ",7,CL21C102JBCNNNC,C,1n,Unpolarized capacitor,710-885012207033,,Capacitor_SMD:C_0805_2012Metric 7 | "C31, C40, ",2,302010148,C,2.2u,Unpolarized capacitor,963-LMK212BJ225KG-T,,Capacitor_SMD:C_0805_2012Metric 8 | "C34, ",1,202R18W102KV4E,C,1n/2000V,Unpolarized capacitor,605-202R18W102KV4E,,Capacitor_SMD:C_1206_3216Metric 9 | "C47, ",1,302010175,C,10n,Unpolarized capacitor,603-CC805KRX7R9BB103,,Capacitor_SMD:C_0805_2012Metric 10 | "D2, ",1,304090039,LED,LED/yellow(origin blue),Light emitting diode,710-150080BS75000,,LED_SMD:LED_0805_2012Metric 11 | "D5, ",1,304090046,LED,LED/red,Light emitting diode,710-150080VS75000,,LED_SMD:LED_0805_2012Metric 12 | "D9, ",1,304090057,LED,LED/green,Light emitting diode,710-150080RS75000,,LED_SMD:LED_0805_2012Metric 13 | "D7, D8, D11, ",3,SD0805S020S1R0,D,SD0805S020S1R0,Diode,581-SD0805S020S1R0,478-7800-1-ND,Diode_SMD:D_0805_2012Metric 14 | "D10, ",1,BAT54CLT1G,BAT54C,BAT54C,"dual schottky barrier diode, common cathode",863-BAT54CLT1G,BAT54CFSCT-ND,Package_TO_SOT_SMD:SOT-23 15 | "F1, ",1,3413.0329.22,Fuse,12A/slow,Fuse,693-3413.0329.22,486-1687-1-ND,ICs_own:Fuse_1206_3216Metric 16 | "FB1, ",1,1-1624117-7,Ferrite_Bead,600R/2A,Ferrite bead,571-1-1624117-7,A102078CT-ND,Inductor_SMD:L_0805_2012Metric 17 | "IC1, ",1,FXL6408UMX,FXL6408UMX,FXL6408UMX,Fully Configurable 8-Bit I2C-Controlled GPIO Expander,512-FXL6408UMX,FXL6408UMXCT-ND,ICs_own:QFN40P180X260X55-16N 18 | "IC2, ",1,ATA6561-GAQW-N,ATA6561-GAQW-N,ATA6561-GAQW-N,"MICROCHIP - ATA6561-GAQW-N - CAN TRANSCEIVER, 5MBPS, -40 TO 150DEG C",579-ATA6561-GAQW-N,ATA6561-GBQW-NCT-ND,ICs_own:SOIC127P600X175-8N 19 | "IC3, ",1,ICL3221EIVZ,ICL3221EIVZ-ND ,ICL3221EIVZ,"Intersil ICL3221EIVZ, Line Transceiver, EIA/TIA-232/ RS-232/ V.24/ V.28, 3.3 V, 5 V, 16-Pin TSSOP",968-ICL3221EIVZ,ICL3221EIVZ-ND,ICs_own:SOP65P640X120-16N 20 | "J1, ",1,-,PTSM-Header-Horizontal-6,PTSM-Header-Horizontal-6,,651-1814883,277-9960-1-ND,Connector_own:1814883 21 | "J3, ",1,-,PTSM-Header-Horizontal-7,PTSM-Header-Horizontal-7,,651-1814896,277-9961-1-ND,Connector_own:1814896 22 | "J4, ",1,-,277-16334-ND ,CCA-Header-Horizontal-4,,651-1836366 ,277-16334-ND,Connector_own:1836366 23 | "J5, ",1,-,PTSM-Header-Horizontal-5,PTSM-Header-Horizontal-5,,651-1814870,277-9959-1-ND,Connector_own:1814870 24 | "J7, ",1,-,Conn_01x04_Male,Conn_01x04_Male,"Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)",649-68016-404HLF,,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal 25 | "J8, ",1,-,Conn_01x04_Male,Conn_01x04_Male,"Generic connector, single row, 01x04, script generated (kicad-library-utils/schlib/autogen/connector/)",855-M20-9770446 ,,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical 26 | "J9, J10, J11, ",3,-,Conn_01x08_Female,Conn_01x08_Female,"Generic connector, single row, 01x08, script generated (kicad-library-utils/schlib/autogen/connector/)",855-M20-7820842,,Connector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_Vertical 27 | "J12, ",1,-,Conn_02x02_Odd_Even,Conn_02x02_Odd_Even,"Generic connector, double row, 02x02, odd/even pin numbering scheme (row 1 odd numbers, row 2 even numbers), script generated (kicad-library-utils/schlib/autogen/connector/)",649-68021-404HLF,,Connector_PinHeader_2.54mm:PinHeader_2x02_P2.54mm_Horizontal 28 | "J13, J17, ",2,-,SM04B-SRSS-TB(LF)(SN),SM04B-SRSS-TB(LF)(SN),"JST (JAPAN SOLDERLESS TERMINALS) - SM04B-SRSS-TB(LF)(SN) - CONNECTOR, HEADER, SMT, R/A, 1MM, 4WAY",474-PRT-14417,455-1804-1-ND,Connector_own:JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal 29 | "J14, ",1,105017-0001,USB_B_Micro,USB_B_Micro,USB Micro Type B connector,538-105017-0001,WM1399CT-ND ,Connector_own:USB_Micro-B_Molex-105017-0001 30 | "J15, ",1,-,RJ45_Amphenol_RJMG1BD3B8K1ANR,RJ45_Amphenol_RJMG1BD3B8K1ANR,"1 Port RJ45 Magjack Connector Through Hole 10/100 Base-T, AutoMDIX",523-RJMG1BD3B8K1ANR ,RJMG1BD3B8K1ANR-ND,Connector_own:RJ45_Amphenol_RJMG1BD3B8K1ANR 31 | "J16, ",1,-,DB9_Male_MountingHoles,DB9_Male_MountingHoles,"9-pin male D-SUB connector, Mounting Hole",649-LD09P33E4GV00LF ,609-5186-ND,Connector_own:LD09P33E4GV00LF 32 | "J18, ",1,-,PTSM-Header-Horizontal-2,PTSM-Header-Horizontal-2,,651-1814841,277-9956-1-ND,Connector_own:1814841 33 | "K1, K2, ",2,-,CP1SA-12V-Z,CP1SA-12V-Z,"PANASONIC ELECTRIC WORKS - CP1SA-12V-Z - RELAY, AUTOMOTIVE, SPDT, 14VDC, 20A",769-CP1SA-12V-Z,255-3417-1-ND,Relay_own:CP1SA12VZ 34 | "PS1, ",1,V78E05-1000-SMT-TR,V78E05-1000-SMT-TR,V78E05-1000-SMT-TR,,490-V78E05-1000SMTTR,102-5033-1-ND ,ICs_own:SOP254P1140X825-10N 35 | "Q2, Q1, ",2,"BC817-40,215","BC817-40,215","BC817-40,215","BC817; BC817W; BC337 - 45 V, 500 mA NPN general-purpose transistors",771-BC817-40-T/R,1727-2919-1-ND,ICs_own:SOT95P230X110-3N 36 | "R1, R25, R33, R39, R38, R41, ",6,301010351,R,120,Resistor,652-CR0805FX-1200ELF,,Resistor_SMD:R_0805_2012Metric 37 | "R3, R17, ",2,CRCW0805620RFKEAC,R,620,Resistor,71-CRCW0805620RFKEAC,,Resistor_SMD:R_0805_2012Metric 38 | "R10, R6, R18, R20, R24, R23, R22, R31, R35, ",9,CRCW080547K0FKEAC,R,47k,Resistor,71-CRCW080547K0FKEAC,,Resistor_SMD:R_0805_2012Metric 39 | "R11, R12, R13, R7, R8, R9, R36, R37, R40, ",9,301010311,R,1k,Resistor,71-CRCW08051K00FKEAC,,Resistor_SMD:R_0805_2012Metric 40 | "R14, R26, R27, R30, R29, R43, R50, R51, R52, R53, ",10,301012194,R,2.4k,Resistor,603-RC0805FR-072K4L,,Resistor_SMD:R_0805_2012Metric 41 | "R2, R16, R15, R54, ",4,RC0805FR-0724RL,R,24,Resistor,603-RC0805FR-0724RL,,Resistor_SMD:R_0805_2012Metric 42 | "R19, R21, R32, R48, ",4,RC0805FR-0712R1L,R,12.1k,Resistor,71-CRCW080512K1FKEAC,,Resistor_SMD:R_0805_2012Metric 43 | "R28, ",1,RC0805FR-07220KL,R,220k,Resistor,652-CR0805JW-224ELF,,Resistor_SMD:R_0805_2012Metric 44 | "R34, ",1,0805W8F2212T5E,R,22.1k,Resistor,652-CR0805FX-2212ELF,,Resistor_SMD:R_0805_2012Metric 45 | "R42, R44, ",2,301011479,R,0,Resistor,603-RC0805JR-070RL,,Resistor_SMD:R_0805_2012Metric 46 | "R45, R46, R47, R49, ",4,0805W8F499JT5E,R,49.9,Resistor,71-CRCW080549R9FKEAC,,Resistor_SMD:R_0805_2012Metric 47 | "SW1, ",1,PTS645SM43SMTR92LFS,SW_Push,SW_Push,"Push button switch, generic, two pins",611-PTS645SM43SMTR92,CKN9112CT-ND,Button_Switch_SMD:SW_SPST_PTS645 48 | "U1, ",1,ESP32-WROOM-32,ESP32-WROOM-32,ESP32-WROOM-32,"RF Module, ESP32-D0WDQ6 SoC, Wi-Fi 802.11b/g/n, Bluetooth, BLE, 32-bit, 2.7-3.6V, SMD",356-ESP-WROOM-32,1904-1023-1-ND ,RF_Module:ESP32-WROOM-32 49 | "U2, ",1,AZ1117IH-3.3TRG1,AZ1117-3.3,AZ1117-3.3,"1A 20V Fixed LDO Linear Regulator, 3.3V, SOT-89/SOT-223/TO-220/TO-252/TO-263",621-AZ1117IH-3.3TRG1 ,AZ1117EH-3.3TRG1DICT-ND,Package_TO_SOT_SMD:SOT-223-3_TabPin2 50 | "U3, U5, U9, ",3,VNH7070ASTR,497-17630-1-ND,VNH7070AS,The device is a full bridge motor driver intended for a wide range of automotive applications.,511-VNH7070ASTR,497-17630-1-ND,Package_SO:SOIC-16_3.9x9.9mm_P1.27mm 51 | "U4, ",1,ADS1115IDGSR,ADS1115IDGS,ADS1115IDGS,"Ultra-Small, Low-Power, I2C-Compatible, 860-SPS, 16-Bit ADCs With Internal Reference, Oscillator, and Programmable Comparator, VSSOP-10",595-ADS1115IDGSR,296-38849-1-ND,Package_SO:MSOP-10_3x3mm_P0.5mm 52 | "U6, ",1,PCA9306DCTR,PCA9306,PCA9306DCTR,Dual bidirectional I2C Bus and SMBus voltage level translator,595-PCA9306DCTR,296-18509-1-ND ,Package_SO:SSOP-8_2.95x2.8mm_P0.65mm 53 | "U7, ",1,TPD3E001DRLR,TPD3E001DRLR,TPD3E001DRLR,TPD3E001 Low-Capacitance 3-Channel ESD-Protection for High-Speed Data Interfaces,595-TPD3E001DRLR,296-21885-1-ND,Package_TO_SOT_SMD:SOT-553 54 | "U8, ",1,CP2102N-A01-GQFN24R,336-5887-ND,CP2102N-A01-GQFN24,USB to UART master bridge,634-CP02NA01GQFN24R,336-5887-ND,Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm 55 | "U10, ",1,NUD3124LT1G,NUD3124LT1G,NUD3124LT1G,"ON Semiconductor NUD3124LT1G, MOSFET Power Driver, 150mA, 3-Pin SOT-23",863-NUD3124LT1G,NUD3124LT1GOSCT-ND ,ICs_own:SOT95P237X100-3N 56 | "U11, ",1,LAN8720A-CP-TR-ABC,LAN8720A,LAN8720A,LAN8720 Ethernet PHY with RMII interface,579-LAN8720ACPTRABC,LAN8720A-CP-TR-ABCCT-ND ,Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm 57 | "U12, ",1,LSM9DS1TR,LSM9DS1,LSM9DS1,I2C SPI 9 axis IMU accelerometer gyroscope magnetometer,511-LSM9DS1TR,497-14946-1-ND ,Package_LGA:LGA-24L_3x3.5mm_P0.43mm 58 | -------------------------------------------------------------------------------- /pcb/gerber/mainPCB-PTH.drl: -------------------------------------------------------------------------------- 1 | M48 2 | METRIC,TZ 3 | T1C0.400 4 | T2C0.600 5 | T3C0.850 6 | T4C0.890 7 | T5C0.900 8 | T6C1.000 9 | T7C1.100 10 | T8C1.300 11 | T9C1.600 12 | T10C3.200 13 | % 14 | G90 15 | G05 16 | T1 17 | X19.525Y-90.645 18 | X20.828Y-92.075 19 | X21.702Y-84.938 20 | X21.717Y-83.439 21 | X21.717Y-86.614 22 | X21.844Y-92.964 23 | X22.098Y-97.409 24 | X22.098Y-104.013 25 | X22.225Y-87.757 26 | X22.86Y-93.98 27 | X24.066Y-90.551 28 | X24.066Y-91.885 29 | X24.13Y-52.324 30 | X24.13Y-56.134 31 | X24.13Y-57.404 32 | X24.32Y-73.343 33 | X24.32Y-74.549 34 | X24.384Y-72.009 35 | X24.384Y-80.137 36 | X24.384Y-84.836 37 | X25.617Y-63.119 38 | X25.654Y-68.135 39 | X25.654Y-97.346 40 | X27.114Y-54.864 41 | X27.178Y-91.948 42 | X27.305Y-56.134 43 | X27.305Y-57.404 44 | X27.305Y-90.424 45 | X27.432Y-73.279 46 | X27.432Y-74.549 47 | X27.813Y-93.091 48 | X27.859Y-75.849 49 | X28.003Y-58.674 50 | X28.067Y-89.281 51 | X28.321Y-52.324 52 | X28.956Y-57.023 53 | X29.083Y-74.549 54 | X29.21Y-72.009 55 | X29.21Y-89.281 56 | X29.591Y-91.948 57 | X31.115Y-63.246 58 | X31.115Y-68.135 59 | X31.432Y-97.282 60 | X32.258Y-80.137 61 | X32.258Y-84.836 62 | X32.512Y-91.694 63 | X33.528Y-52.197 64 | X33.528Y-53.594 65 | X33.655Y-63.246 66 | X33.655Y-65.405 67 | X33.655Y-67.437 68 | X34.925Y-93.091 69 | X35.029Y-74.216 70 | X35.052Y-57.277 71 | X35.052Y-75.819 72 | X35.115Y-58.674 73 | X35.179Y-95.631 74 | X35.179Y-97.282 75 | X35.179Y-104.14 76 | X35.306Y-80.137 77 | X35.306Y-82.614 78 | X35.306Y-84.836 79 | X35.306Y-91.694 80 | X39.751Y-94.615 81 | X41.529Y-69.342 82 | X41.656Y-63.5 83 | X41.656Y-66.294 84 | X41.783Y-94.615 85 | X41.91Y-77.597 86 | X41.91Y-82.867 87 | X41.91Y-84.836 88 | X41.91Y-91.821 89 | X41.91Y-97.536 90 | X41.974Y-73.533 91 | X41.974Y-74.93 92 | X41.974Y-78.994 93 | X41.974Y-81.216 94 | X42.291Y-86.614 95 | X43.624Y-73.533 96 | X43.624Y-86.614 97 | X44.069Y-52.578 98 | X45.148Y-73.533 99 | X45.148Y-86.55 100 | X46.355Y-52.197 101 | X46.355Y-69.469 102 | X46.355Y-94.615 103 | X46.418Y-78.994 104 | X46.418Y-81.216 105 | X46.482Y-54.864 106 | X46.482Y-63.373 107 | X46.482Y-66.167 108 | X46.482Y-91.821 109 | X46.482Y-97.536 110 | X46.609Y-86.36 111 | X46.799Y-73.533 112 | X48.26Y-52.197 113 | X48.26Y-54.864 114 | X48.26Y-94.615 115 | X48.387Y-63.344 116 | X48.392Y-66.197 117 | X48.641Y-71.691 118 | X50.292Y-52.121 119 | X50.292Y-53.137 120 | X50.292Y-54.204 121 | X50.546Y-106.299 122 | X51.435Y-71.628 123 | X51.435Y-76.073 124 | X51.562Y-67.31 125 | X51.773Y-101.176 126 | X53.086Y-67.246 127 | X53.149Y-75.946 128 | X53.33Y-107.594 129 | X53.614Y-104.145 130 | X54.483Y-71.628 131 | X54.61Y-67.437 132 | X54.864Y-75.946 133 | X54.915Y-45.847 134 | X54.915Y-47.117 135 | X54.915Y-48.387 136 | X54.915Y-49.632 137 | X55.138Y-101.961 138 | X55.181Y-98.234 139 | X56.325Y-67.31 140 | X56.337Y-49.657 141 | X56.54Y-45.847 142 | X56.642Y-75.946 143 | X56.769Y-71.501 144 | X57.641Y-69.596 145 | X57.658Y-49.657 146 | X57.912Y-45.847 147 | X58.593Y-68.644 148 | X59.182Y-45.847 149 | X59.182Y-47.752 150 | X59.182Y-49.657 151 | X59.81Y-87.038 152 | X59.81Y-89.535 153 | X60.008Y-69.913 154 | X60.452Y-47.752 155 | X60.452Y-49.657 156 | X60.579Y-45.847 157 | X60.96Y-71.247 158 | X60.96Y-94.615 159 | X61.087Y-73.279 160 | X61.087Y-74.549 161 | X61.214Y-75.819 162 | X61.377Y-85.471 163 | X62.484Y-84.364 164 | X66.675Y-94.361 165 | X66.802Y-91.821 166 | X67.818Y-91.821 167 | X67.818Y-94.361 168 | X69.088Y-53.467 169 | X69.723Y-69.342 170 | X69.85Y-71.247 171 | X72.136Y-96.52 172 | X72.263Y-94.488 173 | X73.061Y-83.107 174 | X73.731Y-101.707 175 | X74.231Y-81.407 176 | X74.231Y-95.504 177 | X75.084Y-99.318 178 | X75.936Y-96.119 179 | X76.475Y-96.961 180 | X76.599Y-84.836 181 | X76.708Y-94.488 182 | X77.44Y-88.499 183 | X77.592Y-107.701 184 | X77.962Y-102.108 185 | X78.76Y-95.357 186 | X79.184Y-85.026 187 | X79.185Y-93.916 188 | X80.002Y-97.347 189 | X80.015Y-83.414 190 | X80.772Y-76.581 191 | X80.821Y-96.774 192 | X80.835Y-82.132 193 | X81.546Y-98.044 194 | X81.978Y-71.628 195 | X81.978Y-79.692 196 | X82.271Y-105.679 197 | X82.296Y-109.474 198 | X83.121Y-104.394 199 | X83.566Y-88.01 200 | X83.693Y-89.535 201 | X83.697Y-95.784 202 | X84.461Y-88.736 203 | X84.501Y-92.969 204 | X84.582Y-108.077 205 | X84.582Y-106.934 206 | X84.645Y-103.124 207 | X84.645Y-99.377 208 | X84.646Y-100.584 209 | X85.084Y-86.487 210 | X85.788Y-87.212 211 | X86.741Y-80.454 212 | X87.82Y-80.454 213 | X89.027Y-80.454 214 | X89.281Y-67.437 215 | X90.17Y-109.474 216 | X90.297Y-80.454 217 | X90.932Y-58.293 218 | X91.567Y-80.454 219 | X91.694Y-48.705 220 | X92.964Y-80.454 221 | X94.996Y-70.485 222 | X94.996Y-82.132 223 | X95.006Y-71.485 224 | X95.758Y-73.152 225 | X96.139Y-69.977 226 | X96.852Y-67.564 227 | X99.822Y-68.707 228 | X99.822Y-109.474 229 | X101.409Y-91.948 230 | X101.854Y-64.262 231 | X101.981Y-69.977 232 | X101.981Y-71.501 233 | X102.616Y-76.073 234 | X103.505Y-69.977 235 | X103.505Y-71.501 236 | X103.822Y-76.073 237 | X104.365Y-85.344 238 | X104.365Y-92.9 239 | X104.648Y-109.474 240 | X105.219Y-95.313 241 | X105.268Y-83.104 242 | X105.574Y-74.613 243 | X105.994Y-71.248 244 | X106.426Y-69.747 245 | X107.061Y-107.315 246 | X107.137Y-73.579 247 | X107.569Y-67.691 248 | X107.569Y-69.178 249 | X107.746Y-70.485 250 | X107.759Y-97.409 251 | X107.762Y-76.789 252 | X109.347Y-78.994 253 | X109.347Y-96.203 254 | X109.347Y-109.093 255 | X110.934Y-73.215 256 | X111.225Y-71.628 257 | X111.867Y-61.722 258 | X112.141Y-67.31 259 | X112.828Y-58.515 260 | X113.447Y-50.648 261 | X114.046Y-109.093 262 | X121.641Y-50.866 263 | X121.773Y-93.975 264 | X122.773Y-102.337 265 | X122.819Y-48.021 266 | X123.509Y-86.604 267 | X124.042Y-84.264 268 | X124.236Y-49.596 269 | X124.767Y-90.17 270 | X124.904Y-106.172 271 | X125.106Y-83.509 272 | X125.603Y-82.614 273 | X125.92Y-77.724 274 | X125.928Y-106.172 275 | X126.428Y-45.72 276 | X126.873Y-100.748 277 | X126.936Y-106.172 278 | X127.063Y-81.471 279 | X128.841Y-53.53 280 | X128.841Y-92.139 281 | X128.841Y-101.536 282 | X128.841Y-104.775 283 | X129.451Y-75.265 284 | X129.553Y-68.199 285 | X130.048Y-102.87 286 | X130.81Y-62.293 287 | X131.282Y-42.964 288 | X131.508Y-75.501 289 | X132.588Y-54.165 290 | X133.604Y-54.102 291 | X134.493Y-84.899 292 | X134.493Y-92.456 293 | X135.763Y-82.105 294 | X136.525Y-68.453 295 | X136.588Y-75.565 296 | X136.652Y-83.629 297 | X137.096Y-90.17 298 | X138.367Y-103.632 299 | X138.369Y-75.789 300 | X138.43Y-50.673 301 | X140.653Y-75.755 302 | X140.97Y-60.579 303 | X140.97Y-106.717 304 | X142.177Y-91.313 305 | X142.179Y-77.729 306 | X142.43Y-68.77 307 | X142.494Y-75.565 308 | X143.256Y-60.706 309 | X143.378Y-96.728 310 | X144.059Y-48.519 311 | X144.069Y-87.294 312 | X144.369Y-104.775 313 | X144.59Y-72.801 314 | X145.041Y-87.531 315 | X145.288Y-40.767 316 | X145.561Y-105.992 317 | X145.715Y-88.549 318 | X147.31Y-82.744 319 | X147.34Y-75.392 320 | X147.879Y-81.922 321 | X148.052Y-80.879 322 | X148.854Y-87.432 323 | X149.572Y-82.325 324 | X150.312Y-69.794 325 | X150.317Y-108.234 326 | X150.939Y-60.373 327 | X151.13Y-94.361 328 | X151.305Y-77.671 329 | X153.099Y-55.128 330 | X153.954Y-49.85 331 | X154.544Y-86.053 332 | X154.94Y-106.108 333 | X154.96Y-100.741 334 | X155.56Y-77.607 335 | X155.766Y-55.816 336 | X155.778Y-57.328 337 | X156.019Y-106.108 338 | X156.273Y-61.658 339 | X156.964Y-107.005 340 | X157.21Y-62.422 341 | X157.29Y-55.816 342 | X157.29Y-57.277 343 | X157.48Y-64.643 344 | X159.385Y-90.361 345 | X160.447Y-100.741 346 | X160.719Y-66.103 347 | X164.633Y-45.034 348 | X165.1Y-96.837 349 | X165.862Y-94.361 350 | X167.761Y-55.437 351 | X168.003Y-53.919 352 | T3 353 | X172.891Y-51.292 354 | X172.891Y-56.292 355 | T4 356 | X96.164Y-45.144 357 | X98.704Y-43.624 358 | X106.274Y-45.144 359 | X108.814Y-43.624 360 | T5 361 | X71.617Y-44.976 362 | X74.117Y-44.976 363 | X76.617Y-44.976 364 | X79.117Y-44.976 365 | X81.617Y-44.976 366 | X84.117Y-44.976 367 | X86.617Y-44.976 368 | X98.044Y-57.404 369 | X99.314Y-54.864 370 | X100.584Y-57.404 371 | X101.854Y-54.864 372 | X103.124Y-57.404 373 | X104.394Y-54.864 374 | X105.664Y-57.404 375 | X106.934Y-54.864 376 | X130.006Y-45.031 377 | X132.506Y-45.031 378 | X135.006Y-45.031 379 | X137.506Y-45.031 380 | X140.006Y-45.031 381 | X142.506Y-45.031 382 | X152.744Y-45.006 383 | X155.244Y-45.006 384 | X157.744Y-45.006 385 | X160.244Y-45.006 386 | X162.744Y-45.006 387 | X116.845Y-44.715 388 | X119.345Y-44.715 389 | T6 390 | X121.602Y-58.864 391 | X121.602Y-61.404 392 | X124.142Y-58.864 393 | X124.142Y-61.404 394 | X163.449Y-85.471 395 | X163.449Y-88.011 396 | X163.449Y-90.551 397 | X163.449Y-93.091 398 | X163.449Y-95.631 399 | X163.449Y-98.171 400 | X163.449Y-100.711 401 | X163.449Y-103.251 402 | X115.189Y-67.691 403 | X115.189Y-70.231 404 | X115.189Y-72.771 405 | X115.189Y-75.311 406 | X115.189Y-77.851 407 | X115.189Y-80.391 408 | X115.189Y-82.931 409 | X115.189Y-85.471 410 | X71.196Y-75.016 411 | X73.736Y-75.016 412 | X76.276Y-75.016 413 | X78.816Y-75.016 414 | X134.556Y-99.695 415 | X137.096Y-99.695 416 | X139.636Y-99.695 417 | X142.177Y-99.695 418 | X163.449Y-63.627 419 | X163.449Y-66.167 420 | X163.449Y-68.707 421 | X163.449Y-71.247 422 | X163.449Y-73.787 423 | X163.449Y-76.327 424 | X163.449Y-78.867 425 | X163.449Y-81.407 426 | X167.66Y-60.559 427 | X170.2Y-60.559 428 | T7 429 | X168.18Y-74.251 430 | X168.18Y-76.991 431 | X168.18Y-79.731 432 | X168.18Y-82.471 433 | X168.18Y-85.211 434 | X171.02Y-75.621 435 | X171.02Y-78.361 436 | X171.02Y-81.101 437 | X171.02Y-83.841 438 | T8 439 | X41.563Y-47.578 440 | X46.563Y-47.578 441 | X51.563Y-47.578 442 | X56.563Y-47.578 443 | T9 444 | X94.714Y-51.574 445 | X110.264Y-51.574 446 | T10 447 | X169.6Y-67.236 448 | X169.6Y-92.226 449 | T2 450 | X175.241Y-50.292G85X175.941Y-50.292 451 | G05 452 | X175.941Y-57.292G85X175.241Y-57.292 453 | G05 454 | T0 455 | M30 456 | -------------------------------------------------------------------------------- /code/LSM9DS1-IronCompensation/LSM9DS1-IronCompensation.ino: -------------------------------------------------------------------------------- 1 | // calibration after https://appelsiini.net/2018/calibrate-magnetometer/ 2 | 3 | 4 | // IO pins -------------------------------- 5 | #define I2C_SDA 32 6 | #define I2C_SCL 33 7 | 8 | // includes 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // global variables 15 | float hardIron[3]; 16 | float softIron[3]; 17 | int gyros[3]; 18 | 19 | // instances 20 | LSM9DS1 imu; 21 | 22 | void setup() { 23 | //Initialize serial and wait for port to open: 24 | Serial.begin(115200); 25 | Serial.println("-------------------------------------"); 26 | Serial.println("ESP32 - LSM9DS1 Hard Iron calibration"); 27 | Serial.println("-------------------------------------"); 28 | Serial.println(""); 29 | Serial.println("After each step press any"); 30 | Serial.println("key is (over serial)"); 31 | Serial.println(""); 32 | // Setup IO 33 | 34 | // I2C 35 | Wire.begin(I2C_SDA, I2C_SCL, 400000); 36 | 37 | // Setup LSM9DS1 38 | Serial.println("Konfigure the LSM9DS1"); 39 | imu.settings.device.commInterface = IMU_MODE_I2C; 40 | imu.settings.device.mAddress = 0x1C; 41 | imu.settings.device.agAddress = 0x6A; 42 | imu.settings.mag.scale = 4; // Set mag scale to +/-12 Gs 43 | // [sampleRate] sets the output data rate (ODR) of the 44 | // magnetometer. 45 | // mag data rate can be 0-7: 46 | // 0 = 0.625 Hz 4 = 10 Hz 47 | // 1 = 1.25 Hz 5 = 20 Hz 48 | // 2 = 2.5 Hz 6 = 40 Hz 49 | // 3 = 5 Hz 7 = 80 Hz 50 | imu.settings.mag.sampleRate = 5; // Set OD rate to 20Hz 51 | // [tempCompensationEnable] enables or disables 52 | // temperature compensation of the magnetometer. 53 | imu.settings.mag.tempCompensationEnable = true; 54 | // [XYPerformance] sets the x and y-axis performance of the 55 | // magnetometer to either: 56 | // 0 = Low power mode 2 = high performance 57 | // 1 = medium performance 3 = ultra-high performance 58 | imu.settings.mag.XYPerformance = 3; // Ultra-high perform. 59 | // [ZPerformance] does the same thing, but only for the z 60 | imu.settings.mag.ZPerformance = 3; // Ultra-high perform. 61 | // [lowPowerEnable] enables or disables low power mode in 62 | // the magnetometer. 63 | imu.settings.mag.lowPowerEnable = false; 64 | if (!imu.begin()) { 65 | Serial.println("Failed to communicate with LSM9DS1."); 66 | } 67 | 68 | Serial.println("Leave board in position, no movement (gyro calibration)"); 69 | Serial.println("Press to continue"); 70 | while (Serial.read() == -1 ) { 71 | delay(1); 72 | } 73 | 74 | // read 256 Values, then shift 8 bit for correction values 75 | for (int i = 0; i < 256; i++) { 76 | imu.readGyro(); 77 | gyros[0] += imu.gx; 78 | gyros[1] += imu.gy; 79 | gyros[2] += imu.gz; 80 | delay(50); 81 | } 82 | gyros[0] = gyros[0] >> 8; 83 | gyros[1] = gyros[1] >> 8; 84 | gyros[2] = gyros[2] >> 8; 85 | 86 | // Hard iron calibration 87 | Serial.println("Now: Slowly turn around all axis (magnetometer - iron compensation)"); 88 | Serial.println("After enough turns press any key"); 89 | int calData[3][2] = {{32767, -32767}, {32767, -32767}, {32767, -32767}}; 90 | 91 | while (Serial.read() == -1 ) { 92 | delay(50); 93 | // To read from the magnetometer, you must first call the 94 | // readMag() function. When this exits, it'll update the 95 | // mx, my, and mz variables with the most current data. 96 | imu.readMag(); 97 | if (imu.mx < calData[0][0]) { 98 | calData[0][0] = imu.mx; 99 | } 100 | if (imu.mx > calData[0][1]) { 101 | calData[0][1] = imu.mx; 102 | } 103 | if (imu.my < calData[1][0]) { 104 | calData[1][0] = imu.my; 105 | } 106 | if (imu.my > calData[1][1]) { 107 | calData[1][1] = imu.my; 108 | } 109 | if (imu.mz < calData[2][0]) { 110 | calData[2][0] = imu.mz; 111 | } 112 | if (imu.mz > calData[2][1]) { 113 | calData[2][1] = imu.mz; 114 | } 115 | } 116 | 117 | // calculate hard iron compensation 118 | hardIron[0] = (calData[0][0] + calData[0][1]) / 2; 119 | hardIron[1] = (calData[1][0] + calData[1][1]) / 2; 120 | hardIron[2] = (calData[2][0] + calData[2][1]) / 2; 121 | 122 | 123 | // soft iron 124 | 125 | // apply the hard iron correction on the raw data 126 | calData[0][0] -= hardIron[0]; 127 | calData[1][0] -= hardIron[1]; 128 | calData[2][0] -= hardIron[2]; 129 | calData[0][1] -= hardIron[0]; 130 | calData[1][1] -= hardIron[1]; 131 | calData[2][1] -= hardIron[2]; 132 | 133 | 134 | // calculate soft iron data 135 | softIron[0] = float((calData[0][1] - calData[0][0])) / 2; 136 | softIron[1] = float((calData[1][1] - calData[1][0])) / 2; 137 | softIron[2] = float((calData[2][1] - calData[2][0])) / 2; 138 | 139 | float avgDelta = (softIron[0] + softIron[1] + softIron[3]) / 3; 140 | 141 | softIron[0] = avgDelta / softIron[0]; 142 | softIron[1] = avgDelta / softIron[1]; 143 | softIron[2] = avgDelta / softIron[2]; 144 | } 145 | 146 | int ironCorrction(byte axis, int rawValue) { 147 | return round((rawValue - hardIron[axis]) * softIron[axis]); 148 | } 149 | 150 | void loop() { 151 | printGyro(); // Print "G: gx, gy, gz" 152 | printAccel(); // Print "A: ax, ay, az" 153 | printMag(); // Print "M: mx, my, mz" 154 | 155 | // Print the heading and orientation for fun! 156 | // Call print attitude. The LSM9DS1's magnetometer x and y 157 | // axes are opposite to the accelerometer, so my and mx are 158 | // substituted for each other. 159 | printAttitude(imu.ax, imu.ay, imu.az, -1 * ironCorrction(1, imu.my), -1 * ironCorrction(0, imu.mx), -1 * ironCorrction(2, imu.mz)); 160 | Serial.println(); 161 | delay(500); 162 | 163 | } 164 | 165 | 166 | void printGyro() 167 | { 168 | // To read from the gyroscope, you must first call the 169 | // readGyro() function. When this exits, it'll update the 170 | // gx, gy, and gz variables with the most current data. 171 | imu.readGyro(); 172 | 173 | // Now we can use the gx, gy, and gz variables as we please. 174 | // Either print them as raw ADC values, or calculated in DPS. 175 | Serial.print("G: "); 176 | // If you want to print calculated values, you can use the 177 | // calcGyro helper function to convert a raw ADC value to 178 | // DPS. Give the function the value that you want to convert. 179 | Serial.print(imu.calcGyro(imu.gx - gyros[0]), 2); 180 | Serial.print(", "); 181 | Serial.print(imu.calcGyro(imu.gy - gyros[1]), 2); 182 | Serial.print(", "); 183 | Serial.print(imu.calcGyro(imu.gz - gyros[2]), 2); 184 | Serial.println(" deg/s"); 185 | } 186 | 187 | void printAccel() 188 | { 189 | // To read from the accelerometer, you must first call the 190 | // readAccel() function. When this exits, it'll update the 191 | // ax, ay, and az variables with the most current data. 192 | imu.readAccel(); 193 | 194 | // Now we can use the ax, ay, and az variables as we please. 195 | // Either print them as raw ADC values, or calculated in g's. 196 | Serial.print("A: "); 197 | // If you want to print calculated values, you can use the 198 | // calcAccel helper function to convert a raw ADC value to 199 | // g's. Give the function the value that you want to convert. 200 | Serial.print(imu.calcAccel(imu.ax), 2); 201 | Serial.print(", "); 202 | Serial.print(imu.calcAccel(imu.ay), 2); 203 | Serial.print(", "); 204 | Serial.print(imu.calcAccel(imu.az), 2); 205 | Serial.println(" g"); 206 | 207 | } 208 | 209 | void printMag() 210 | { 211 | // To read from the magnetometer, you must first call the 212 | // readMag() function. When this exits, it'll update the 213 | // mx, my, and mz variables with the most current data. 214 | imu.readMag(); 215 | 216 | // Now we can use the mx, my, and mz variables as we please. 217 | // Either print them as raw ADC values, or calculated in Gauss. 218 | Serial.print("M: "); 219 | // If you want to print calculated values, you can use the 220 | // calcMag helper function to convert a raw ADC value to 221 | // Gauss. Give the function the value that you want to convert. 222 | Serial.print(imu.calcMag(ironCorrction(0, imu.mx)), 2); 223 | Serial.print(", "); 224 | Serial.print(imu.calcMag(ironCorrction(1, imu.my)), 2); 225 | Serial.print(", "); 226 | Serial.print(imu.calcMag(ironCorrction(2, imu.mz)), 2); 227 | Serial.println(" gauss"); 228 | } 229 | 230 | // Calculate pitch, roll, and heading. 231 | // Pitch/roll calculations take from this app note: 232 | // http://cache.freescale.com/files/sensors/doc/app_note/AN3461.pdf?fpsp=1 233 | // Heading calculations taken from this app note: 234 | // http://www51.honeywell.com/aero/common/documents/myaerospacecatalog-documents/Defense_Brochures-documents/Magnetic__Literature_Application_notes-documents/AN203_Compass_Heading_Using_Magnetometers.pdf 235 | void printAttitude( 236 | float ax, float ay, float az, float mx, float my, float mz) 237 | { 238 | float roll = atan2(ay, az); 239 | float pitch = atan2(-ax, sqrt(ay * ay + az * az)); 240 | 241 | float heading; 242 | if (my == 0) 243 | heading = (mx < 0) ? 180.0 : 0; 244 | else 245 | heading = atan2(mx, my); 246 | 247 | // heading -= DECLINATION * PI / 180; 248 | 249 | if (heading > PI) heading -= (2 * PI); 250 | else if (heading < -PI) heading += (2 * PI); 251 | 252 | // Convert everything from radians to degrees: 253 | heading *= 180.0 / PI; 254 | pitch *= 180.0 / PI; 255 | roll *= 180.0 / PI; 256 | 257 | Serial.print("Pitch, Roll: "); 258 | Serial.print(pitch, 2); 259 | Serial.print(", "); 260 | Serial.println(roll, 2); 261 | Serial.print("Heading: "); Serial.println(heading, 2); 262 | } 263 | -------------------------------------------------------------------------------- /pcb/powerSupply.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 2 17 8 | Title "Power supply" 9 | Date "2019-01-19" 10 | Rev "0.1" 11 | Comp "" 12 | Comment1 "With protection against reverse polarity" 13 | Comment2 "With inrush reduction" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | Text HLabel 900 1000 0 50 Input ~ 0 18 | V_In_12V 19 | Text HLabel 750 4650 0 50 BiDi ~ 0 20 | GND 21 | Text HLabel 10650 1000 2 50 Output ~ 0 22 | V_Out_12V 23 | Text HLabel 10650 2150 2 50 Output ~ 0 24 | V_Out_5V 25 | Text HLabel 11100 3650 0 50 Output ~ 0 26 | V_Out_3.3V 27 | $Comp 28 | L Device:R R16 29 | U 1 1 5C429F3B 30 | P 3150 1100 31 | F 0 "R16" V 2943 1100 50 0000 C CNN 32 | F 1 "24" V 3034 1100 50 0000 C CNN 33 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3080 1100 50 0001 C CNN 34 | F 3 "~" H 3150 1100 50 0001 C CNN 35 | 1 3150 1100 36 | 0 1 1 0 37 | $EndComp 38 | $Comp 39 | L Device:D D7 40 | U 1 1 5C42A2E9 41 | P 3650 1000 42 | F 0 "D7" H 3650 784 50 0000 C CNN 43 | F 1 "SD0805S020S1R0" H 3650 875 50 0000 C CNN 44 | F 2 "Diode_SMD:D_0805_2012Metric" H 3650 1000 50 0001 C CNN 45 | F 3 "~" H 3650 1000 50 0001 C CNN 46 | 1 3650 1000 47 | -1 0 0 1 48 | $EndComp 49 | Wire Wire Line 50 | 3800 1000 4200 1000 51 | Wire Wire Line 52 | 4200 1000 4200 1500 53 | $Comp 54 | L Regulator_Linear:AZ1117-3.3 U2 55 | U 1 1 5C42B874 56 | P 9750 3050 57 | F 0 "U2" H 9750 3292 50 0000 C CNN 58 | F 1 "AZ1117-3.3" H 9750 3201 50 0000 C CNN 59 | F 2 "Package_TO_SOT_SMD:SOT-223-3_TabPin2" H 9750 3300 50 0001 C CIN 60 | F 3 "https://www.diodes.com/assets/Datasheets/AZ1117.pdf" H 9750 3050 50 0001 C CNN 61 | 1 9750 3050 62 | 1 0 0 -1 63 | $EndComp 64 | Wire Wire Line 65 | 9450 3050 9150 3050 66 | $Comp 67 | L Device:C C10 68 | U 1 1 5C42CDBC 69 | P 9150 3200 70 | F 0 "C10" H 9265 3246 50 0000 L CNN 71 | F 1 "22u" H 9265 3155 50 0000 L CNN 72 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 9188 3050 50 0001 C CNN 73 | F 3 "~" H 9150 3200 50 0001 C CNN 74 | 1 9150 3200 75 | 1 0 0 -1 76 | $EndComp 77 | Connection ~ 9150 3050 78 | Wire Wire Line 79 | 11100 3050 11100 3650 80 | Wire Wire Line 81 | 10600 3050 11100 3050 82 | Connection ~ 10600 3050 83 | $Comp 84 | L Device:C C11 85 | U 1 1 5C60E376 86 | P 10600 3200 87 | F 0 "C11" H 10715 3246 50 0000 L CNN 88 | F 1 "22u" H 10715 3155 50 0000 L CNN 89 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 10638 3050 50 0001 C CNN 90 | F 3 "~" H 10600 3200 50 0001 C CNN 91 | 1 10600 3200 92 | 1 0 0 -1 93 | $EndComp 94 | Wire Wire Line 95 | 8900 2150 8900 3050 96 | Wire Wire Line 97 | 8900 3050 9150 3050 98 | Wire Wire Line 99 | 10050 3050 10200 3050 100 | $Comp 101 | L Device:R R15 102 | U 1 1 5C4F6C9F 103 | P 3150 750 104 | F 0 "R15" V 2943 750 50 0000 C CNN 105 | F 1 "24" V 3034 750 50 0000 C CNN 106 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3080 750 50 0001 C CNN 107 | F 3 "~" H 3150 750 50 0001 C CNN 108 | 1 3150 750 109 | 0 1 1 0 110 | $EndComp 111 | Wire Wire Line 112 | 2850 1000 3000 1000 113 | Wire Wire Line 114 | 3000 1000 3000 1100 115 | Connection ~ 2850 1000 116 | Wire Wire Line 117 | 3000 1000 3000 750 118 | Connection ~ 3000 1000 119 | Wire Wire Line 120 | 3500 1000 3300 1000 121 | Wire Wire Line 122 | 3300 1000 3300 750 123 | Wire Wire Line 124 | 3300 1000 3300 1100 125 | Connection ~ 3300 1000 126 | Wire Wire Line 127 | 8900 2150 10650 2150 128 | $Comp 129 | L Device:Fuse F1 130 | U 1 1 5C989FC4 131 | P 1650 1000 132 | F 0 "F1" V 1453 1000 50 0000 C CNN 133 | F 1 "12A/slow" V 1544 1000 50 0000 C CNN 134 | F 2 "ICs_own:Fuse_1206_3216Metric" V 1580 1000 50 0001 C CNN 135 | F 3 "~" H 1650 1000 50 0001 C CNN 136 | 1 1650 1000 137 | 0 1 1 0 138 | $EndComp 139 | $Comp 140 | L Device:R R14 141 | U 1 1 5C98DB53 142 | P 1800 3050 143 | F 0 "R14" H 1730 3004 50 0000 R CNN 144 | F 1 "2.4k" H 1730 3095 50 0000 R CNN 145 | F 2 "Resistor_SMD:R_0805_2012Metric" V 1730 3050 50 0001 C CNN 146 | F 3 "~" H 1800 3050 50 0001 C CNN 147 | 1 1800 3050 148 | -1 0 0 1 149 | $EndComp 150 | $Comp 151 | L Device:LED D5 152 | U 1 1 5C98DB5A 153 | P 1800 1600 154 | F 0 "D5" V 1838 1483 50 0000 R CNN 155 | F 1 "LED/red" V 1747 1483 50 0000 R CNN 156 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 1800 1600 50 0001 C CNN 157 | F 3 "~" H 1800 1600 50 0001 C CNN 158 | 1 1800 1600 159 | 0 1 1 0 160 | $EndComp 161 | $Comp 162 | L Device:R R17 163 | U 1 1 5C98FE9B 164 | P 10200 3550 165 | F 0 "R17" H 10270 3596 50 0000 L CNN 166 | F 1 "620" H 10270 3505 50 0000 L CNN 167 | F 2 "Resistor_SMD:R_0805_2012Metric" V 10130 3550 50 0001 C CNN 168 | F 3 "~" H 10200 3550 50 0001 C CNN 169 | 1 10200 3550 170 | 1 0 0 -1 171 | $EndComp 172 | $Comp 173 | L Device:LED D9 174 | U 1 1 5C98FEA2 175 | P 10200 3850 176 | F 0 "D9" V 10238 3733 50 0000 R CNN 177 | F 1 "LED/green" V 10147 3733 50 0000 R CNN 178 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 10200 3850 50 0001 C CNN 179 | F 3 "~" H 10200 3850 50 0001 C CNN 180 | 1 10200 3850 181 | 0 -1 -1 0 182 | $EndComp 183 | Wire Wire Line 184 | 1800 1450 1800 1000 185 | $Comp 186 | L Regulator_Switching_own:V78E05-1000-SMT-TR PS1 187 | U 1 1 5C999BE8 188 | P 7500 1700 189 | F 0 "PS1" H 7500 2267 50 0000 C CNN 190 | F 1 "V78E05-1000-SMT-TR" H 7500 2176 50 0000 C CNN 191 | F 2 "ICs_own:SOP254P1140X825-10N" H 7650 2150 50 0001 L BNN 192 | F 3 "Manufacturer Recommendations" H 7650 2250 50 0001 L BNN 193 | F 4 "CUI Inc" H 7500 1700 50 0001 L BNN "Field4" 194 | 1 7500 1700 195 | 1 0 0 -1 196 | $EndComp 197 | Wire Wire Line 198 | 6900 1500 6100 1500 199 | Wire Wire Line 200 | 8100 1500 8400 1500 201 | Wire Wire Line 202 | 8900 1500 8900 2150 203 | Connection ~ 8900 2150 204 | Wire Wire Line 205 | 8100 2000 8400 2000 206 | Connection ~ 8400 4650 207 | $Comp 208 | L Device:C C9 209 | U 1 1 5C99B87A 210 | P 8400 1650 211 | F 0 "C9" H 8515 1696 50 0000 L CNN 212 | F 1 "22u" H 8515 1605 50 0000 L CNN 213 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 8438 1500 50 0001 C CNN 214 | F 3 "~" H 8400 1650 50 0001 C CNN 215 | 1 8400 1650 216 | 1 0 0 -1 217 | $EndComp 218 | Connection ~ 8400 1500 219 | Wire Wire Line 220 | 8400 1500 8900 1500 221 | $Comp 222 | L Device:C C8 223 | U 1 1 5C99B8F1 224 | P 6600 1950 225 | F 0 "C8" H 6715 1996 50 0000 L CNN 226 | F 1 "100n" H 6715 1905 50 0000 L CNN 227 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6638 1800 50 0001 C CNN 228 | F 3 "~" H 6600 1950 50 0001 C CNN 229 | 1 6600 1950 230 | 1 0 0 -1 231 | $EndComp 232 | $Comp 233 | L Device:C C7 234 | U 1 1 5C99B968 235 | P 6100 1650 236 | F 0 "C7" H 6215 1696 50 0000 L CNN 237 | F 1 "10u" H 6215 1605 50 0000 L CNN 238 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6138 1500 50 0001 C CNN 239 | F 3 "~" H 6100 1650 50 0001 C CNN 240 | 1 6100 1650 241 | 1 0 0 -1 242 | $EndComp 243 | Connection ~ 6100 1500 244 | Wire Wire Line 245 | 6100 1800 6100 2100 246 | Wire Wire Line 247 | 6100 2100 6600 2100 248 | Wire Wire Line 249 | 6100 2100 6100 4650 250 | Connection ~ 6100 2100 251 | Connection ~ 6100 4650 252 | Wire Wire Line 253 | 6100 4650 8400 4650 254 | Wire Wire Line 255 | 6900 1800 6600 1800 256 | Wire Wire Line 257 | 8400 1800 8400 2000 258 | Connection ~ 8400 2000 259 | $Comp 260 | L Device:D D8 261 | U 1 1 5C9A08BD 262 | P 4950 1500 263 | F 0 "D8" H 4950 1284 50 0000 C CNN 264 | F 1 "SD0805S020S1R0" H 4950 1375 50 0000 C CNN 265 | F 2 "Diode_SMD:D_0805_2012Metric" H 4950 1500 50 0001 C CNN 266 | F 3 "~" H 4950 1500 50 0001 C CNN 267 | 1 4950 1500 268 | -1 0 0 1 269 | $EndComp 270 | $Comp 271 | L Device:CP C6 272 | U 1 1 5C9A09A2 273 | P 5500 1650 274 | F 0 "C6" H 5618 1696 50 0000 L CNN 275 | F 1 "560u" H 5618 1605 50 0000 L CNN 276 | F 2 "Capacitor_SMD:CP_Elec_10x10.5" H 5538 1500 50 0001 C CNN 277 | F 3 "~" H 5500 1650 50 0001 C CNN 278 | 1 5500 1650 279 | 1 0 0 -1 280 | $EndComp 281 | Wire Wire Line 282 | 4800 1500 4200 1500 283 | Connection ~ 4200 1500 284 | Wire Wire Line 285 | 5100 1500 5500 1500 286 | Connection ~ 5500 1500 287 | Wire Wire Line 288 | 5500 1500 6100 1500 289 | Wire Wire Line 290 | 6100 2100 5500 2100 291 | Wire Wire Line 292 | 5500 2100 5500 1800 293 | Wire Wire Line 294 | 8400 2000 8400 4650 295 | $Comp 296 | L Relay_own:CP1SA-12V-Z K1 297 | U 1 1 5CB977B6 298 | P 2850 2200 299 | F 0 "K1" V 2804 2428 50 0000 L CNN 300 | F 1 "CP1SA-12V-Z" V 2895 2428 50 0000 L CNN 301 | F 2 "Relay_own:CP1SA12VZ" H 3200 2400 50 0001 L CNN 302 | F 3 "https://www.mouser.com/datasheet/2/315/cp-catalog-1299312.pdf" H 3200 2300 50 0001 L CNN 303 | F 4 "PANASONIC ELECTRIC WORKS - CP1SA-12V-Z - RELAY, AUTOMOTIVE, SPDT, 14VDC, 20A" H 3200 2200 50 0001 L CNN "Description" 304 | F 5 "10.5" H 3200 2100 50 0001 L CNN "Height" 305 | F 6 "769-CP1SA-12V-Z" H 3200 2000 50 0001 L CNN "Mouser Part Number" 306 | F 7 "Panasonic" H 3700 1700 50 0001 L CNN "Manufacturer_Name" 307 | F 8 "CP1SA-12V-Z" H 3700 1600 50 0001 L CNN "Manufacturer_Part_Number" 308 | 1 2850 2200 309 | 0 1 1 0 310 | $EndComp 311 | Wire Wire Line 312 | 4200 1500 4200 1700 313 | Wire Wire Line 314 | 10200 3050 10200 3400 315 | Connection ~ 1800 1000 316 | Wire Wire Line 317 | 1500 1000 900 1000 318 | Wire Wire Line 319 | 1800 1000 2850 1000 320 | Wire Wire Line 321 | 2850 1000 2850 1700 322 | Wire Wire Line 323 | 2950 2700 2950 4650 324 | Wire Wire Line 325 | 2950 1700 4200 1700 326 | Connection ~ 2950 4650 327 | Wire Wire Line 328 | 2750 1700 2750 1500 329 | Wire Wire Line 330 | 2750 1500 4200 1500 331 | Wire Wire Line 332 | 750 4650 1800 4650 333 | Wire Wire Line 334 | 10650 1000 4200 1000 335 | Connection ~ 4200 1000 336 | Wire Wire Line 337 | 1800 3200 1800 4650 338 | Connection ~ 1800 4650 339 | Wire Wire Line 340 | 1800 4650 2950 4650 341 | Wire Wire Line 342 | 8400 4650 9150 4650 343 | Wire Wire Line 344 | 10600 4650 10600 3350 345 | Wire Wire Line 346 | 9750 3350 9750 4650 347 | Connection ~ 9750 4650 348 | Wire Wire Line 349 | 9750 4650 10200 4650 350 | Wire Wire Line 351 | 9150 3350 9150 4650 352 | Connection ~ 9150 4650 353 | Wire Wire Line 354 | 9150 4650 9750 4650 355 | Connection ~ 10200 3050 356 | Wire Wire Line 357 | 10200 3050 10600 3050 358 | Wire Wire Line 359 | 2950 4650 6100 4650 360 | Wire Wire Line 361 | 10200 4000 10200 4650 362 | Connection ~ 10200 4650 363 | Wire Wire Line 364 | 10200 4650 10600 4650 365 | Wire Wire Line 366 | 1800 1750 1800 2900 367 | $EndSCHEMATC 368 | -------------------------------------------------------------------------------- /pcb/I2C-Signal.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 8 17 8 | Title "I2C - Levelconverter and connections" 9 | Date "2019-04-10" 10 | Rev "0.2" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Device:R R? 19 | U 1 1 5CA18ACF 20 | P 1750 1900 21 | AR Path="/5CA18ACF" Ref="R?" Part="1" 22 | AR Path="/5CA10EE5/5CA18ACF" Ref="R26" Part="1" 23 | F 0 "R26" H 1820 1946 50 0000 L CNN 24 | F 1 "2.4k" H 1820 1855 50 0000 L CNN 25 | F 2 "Resistor_SMD:R_0805_2012Metric" V 1680 1900 50 0001 C CNN 26 | F 3 "" H 1750 1900 50 0001 C CNN 27 | 1 1750 1900 28 | 1 0 0 -1 29 | $EndComp 30 | $Comp 31 | L Device:R R? 32 | U 1 1 5CA18AD7 33 | P 2200 1900 34 | AR Path="/5CA18AD7" Ref="R?" Part="1" 35 | AR Path="/5CA10EE5/5CA18AD7" Ref="R27" Part="1" 36 | F 0 "R27" H 2270 1946 50 0000 L CNN 37 | F 1 "2.4k" H 2270 1855 50 0000 L CNN 38 | F 2 "Resistor_SMD:R_0805_2012Metric" V 2130 1900 50 0001 C CNN 39 | F 3 "" H 2200 1900 50 0001 C CNN 40 | 1 2200 1900 41 | 1 0 0 -1 42 | $EndComp 43 | $Comp 44 | L Connector:Conn_01x04_Male J? 45 | U 1 1 5CA18AF1 46 | P 2350 2450 47 | AR Path="/5CA18AF1" Ref="J?" Part="1" 48 | AR Path="/5CA10EE5/5CA18AF1" Ref="J7" Part="1" 49 | F 0 "J7" V 2503 2163 50 0000 R CNN 50 | F 1 "Conn_01x04_Male" V 2412 2163 50 0000 R CNN 51 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal" H 2350 2450 50 0001 C CNN 52 | F 3 "" H 2350 2450 50 0001 C CNN 53 | 1 2350 2450 54 | 1 0 0 -1 55 | $EndComp 56 | $Comp 57 | L Interface:PCA9306 U? 58 | U 1 1 5CA193BD 59 | P 4800 3650 60 | AR Path="/5C531571/5CA193BD" Ref="U?" Part="1" 61 | AR Path="/5CA10EE5/5CA193BD" Ref="U6" Part="1" 62 | F 0 "U6" H 4800 3064 50 0000 C CNN 63 | F 1 "PCA9306DCTR" H 4800 2973 50 0000 C CNN 64 | F 2 "Package_SO:SSOP-8_2.95x2.8mm_P0.65mm" H 4400 4000 50 0001 C CNN 65 | F 3 "http://www.ti.com/lit/ds/symlink/pca9306.pdf" H 4500 4100 50 0001 C CNN 66 | 1 4800 3650 67 | -1 0 0 -1 68 | $EndComp 69 | Wire Wire Line 70 | 4400 3550 4400 3150 71 | Wire Wire Line 72 | 4400 3150 4700 3150 73 | $Comp 74 | L Device:R R? 75 | U 1 1 5CA193CC 76 | P 4700 2550 77 | AR Path="/5C531571/5CA193CC" Ref="R?" Part="1" 78 | AR Path="/5CA10EE5/5CA193CC" Ref="R28" Part="1" 79 | F 0 "R28" H 4770 2596 50 0000 L CNN 80 | F 1 "220k" H 4770 2505 50 0000 L CNN 81 | F 2 "Resistor_SMD:R_0805_2012Metric" V 4630 2550 50 0001 C CNN 82 | F 3 "~" H 4700 2550 50 0001 C CNN 83 | 1 4700 2550 84 | 1 0 0 -1 85 | $EndComp 86 | $Comp 87 | L Device:C C? 88 | U 1 1 5CA193D5 89 | P 4400 2700 90 | AR Path="/5C531571/5CA193D5" Ref="C?" Part="1" 91 | AR Path="/5CA10EE5/5CA193D5" Ref="C23" Part="1" 92 | F 0 "C23" V 4148 2700 50 0000 C CNN 93 | F 1 "1n" V 4239 2700 50 0000 C CNN 94 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 4438 2550 50 0001 C CNN 95 | F 3 "~" H 4400 2700 50 0001 C CNN 96 | 1 4400 2700 97 | 0 1 1 0 98 | $EndComp 99 | Wire Wire Line 100 | 4550 2700 4700 2700 101 | Wire Wire Line 102 | 4700 2700 4700 3150 103 | Connection ~ 4700 2700 104 | Connection ~ 4700 3150 105 | $Comp 106 | L Connector:Conn_01x04_Male J? 107 | U 1 1 5CA1A349 108 | P 7050 2400 109 | AR Path="/5C531571/5CA1A349" Ref="J?" Part="1" 110 | AR Path="/5CA10EE5/5CA1A349" Ref="J8" Part="1" 111 | F 0 "J8" V 7110 2540 50 0000 L CNN 112 | F 1 "Conn_01x04_Male" V 7201 2540 50 0000 L CNN 113 | F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" H 7050 2400 50 0001 C CNN 114 | F 3 "~" H 7050 2400 50 0001 C CNN 115 | 1 7050 2400 116 | 1 0 0 -1 117 | $EndComp 118 | $Comp 119 | L Device:R R? 120 | U 1 1 5CA1A35E 121 | P 6700 1950 122 | AR Path="/5C531571/5CA1A35E" Ref="R?" Part="1" 123 | AR Path="/5CA10EE5/5CA1A35E" Ref="R30" Part="1" 124 | F 0 "R30" V 6493 1950 50 0000 C CNN 125 | F 1 "2.4k" V 6584 1950 50 0000 C CNN 126 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6630 1950 50 0001 C CNN 127 | F 3 "~" H 6700 1950 50 0001 C CNN 128 | 1 6700 1950 129 | 1 0 0 -1 130 | $EndComp 131 | $Comp 132 | L Device:R R? 133 | U 1 1 5CA1A367 134 | P 6300 1950 135 | AR Path="/5C531571/5CA1A367" Ref="R?" Part="1" 136 | AR Path="/5CA10EE5/5CA1A367" Ref="R29" Part="1" 137 | F 0 "R29" V 6093 1950 50 0000 C CNN 138 | F 1 "2.4k" V 6184 1950 50 0000 C CNN 139 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6230 1950 50 0001 C CNN 140 | F 3 "~" H 6300 1950 50 0001 C CNN 141 | 1 6300 1950 142 | 1 0 0 -1 143 | $EndComp 144 | Text HLabel 1100 5100 0 50 Input ~ 0 145 | I2C_3_SDA 146 | Text HLabel 1100 5250 0 50 Input ~ 0 147 | I2C_3_SCL 148 | Text HLabel 1000 1150 0 50 Input ~ 0 149 | +3V3 150 | Text HLabel 1000 950 0 50 Input ~ 0 151 | +5V 152 | Text HLabel 1100 5800 0 50 UnSpc ~ 0 153 | GND 154 | Text HLabel 1200 3750 0 50 Input ~ 0 155 | I2C_5_SDA 156 | Text HLabel 1200 3650 0 50 Input ~ 0 157 | I2C_5_SCL 158 | Wire Wire Line 159 | 1200 3650 2200 3650 160 | Wire Wire Line 161 | 1200 3750 1750 3750 162 | Wire Wire Line 163 | 4900 1150 1000 1150 164 | Wire Wire Line 165 | 4900 1150 4900 3150 166 | Wire Wire Line 167 | 1000 950 1750 950 168 | Wire Wire Line 169 | 4700 950 4700 2400 170 | Wire Wire Line 171 | 1100 5800 2750 5800 172 | Wire Wire Line 173 | 4250 5800 4250 2700 174 | Wire Wire Line 175 | 1750 1750 1750 950 176 | Connection ~ 1750 950 177 | Wire Wire Line 178 | 1750 950 2200 950 179 | Wire Wire Line 180 | 2200 1750 2200 950 181 | Connection ~ 2200 950 182 | Wire Wire Line 183 | 2200 950 2550 950 184 | Wire Wire Line 185 | 2200 2050 2200 3650 186 | Connection ~ 2200 3650 187 | Wire Wire Line 188 | 2200 3650 2650 3650 189 | Wire Wire Line 190 | 1750 2050 1750 3750 191 | Connection ~ 1750 3750 192 | Wire Wire Line 193 | 1750 3750 2550 3750 194 | Wire Wire Line 195 | 6700 1150 6700 1800 196 | Connection ~ 4900 1150 197 | Wire Wire Line 198 | 6300 1800 6300 1150 199 | Wire Wire Line 200 | 7350 1150 7350 2300 201 | Wire Wire Line 202 | 7350 2300 7250 2300 203 | Wire Wire Line 204 | 7250 2400 7650 2400 205 | Wire Wire Line 206 | 7650 2400 7650 5800 207 | Wire Wire Line 208 | 7650 5800 4800 5800 209 | Connection ~ 4250 5800 210 | Wire Wire Line 211 | 1100 5100 7850 5100 212 | Wire Wire Line 213 | 7850 5100 7850 4350 214 | Wire Wire Line 215 | 1100 5250 8000 5250 216 | Wire Wire Line 217 | 8000 5250 8000 3650 218 | Wire Wire Line 219 | 7250 2600 7250 3750 220 | Connection ~ 7250 3750 221 | Wire Wire Line 222 | 7250 3750 7850 3750 223 | Wire Wire Line 224 | 7450 3650 7450 2500 225 | Wire Wire Line 226 | 7450 2500 7250 2500 227 | Connection ~ 7450 3650 228 | Wire Wire Line 229 | 7450 3650 8000 3650 230 | Wire Wire Line 231 | 4900 1150 6300 1150 232 | Connection ~ 6300 1150 233 | Connection ~ 6700 1150 234 | Wire Wire Line 235 | 6700 1150 7350 1150 236 | Wire Wire Line 237 | 6300 1150 6700 1150 238 | Wire Wire Line 239 | 5200 3650 6700 3650 240 | Wire Wire Line 241 | 5200 3750 6300 3750 242 | Wire Wire Line 243 | 6300 2100 6300 3750 244 | Connection ~ 6300 3750 245 | Wire Wire Line 246 | 6300 3750 7250 3750 247 | Wire Wire Line 248 | 6700 2100 6700 3650 249 | Connection ~ 6700 3650 250 | Wire Wire Line 251 | 6700 3650 7450 3650 252 | Wire Wire Line 253 | 2550 2650 2550 3750 254 | Connection ~ 2550 3750 255 | Wire Wire Line 256 | 2550 3750 4400 3750 257 | Wire Wire Line 258 | 2550 2550 2650 2550 259 | Wire Wire Line 260 | 2650 2550 2650 3650 261 | Connection ~ 2650 3650 262 | Wire Wire Line 263 | 2650 3650 4400 3650 264 | Wire Wire Line 265 | 2550 2450 2750 2450 266 | Wire Wire Line 267 | 2750 2450 2750 5800 268 | Connection ~ 2750 5800 269 | Wire Wire Line 270 | 2750 5800 4250 5800 271 | Wire Wire Line 272 | 2550 2350 2550 950 273 | Connection ~ 2550 950 274 | Wire Wire Line 275 | 2550 950 4700 950 276 | $Comp 277 | L Connector_own:SM04B-SRSS-TB(LF)(SN) J13 278 | U 1 1 5CC11751 279 | P 8950 2400 280 | F 0 "J13" V 8996 2222 50 0000 R CNN 281 | F 1 "SM04B-SRSS-TB(LF)(SN)" V 8905 2222 50 0000 R CNN 282 | F 2 "Connector_own:JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal" H 8200 2150 50 0001 L CNN 283 | F 3 "http://www.jst-mfg.com/product/pdf/eng/eSH.pdf" H 8200 2050 50 0001 L CNN 284 | F 4 "JST (JAPAN SOLDERLESS TERMINALS) - SM04B-SRSS-TB(LF)(SN) - CONNECTOR, HEADER, SMT, R/A, 1MM, 4WAY" H 8200 1950 50 0001 L CNN "Description" 285 | F 5 "JST (JAPAN SOLDERLESS TERMINALS)" H 8200 1850 50 0001 L CNN "Manufacturer_Name" 286 | F 6 "SM04B-SRSS-TB(LF)(SN)" H 8200 1750 50 0001 L CNN "Manufacturer_Part_Number" 287 | 1 8950 2400 288 | 0 -1 -1 0 289 | $EndComp 290 | $Comp 291 | L Connector_own:SM04B-SRSS-TB(LF)(SN) J17 292 | U 1 1 5CC131AA 293 | P 9900 2400 294 | F 0 "J17" V 9946 2222 50 0000 R CNN 295 | F 1 "SM04B-SRSS-TB(LF)(SN)" V 9855 2222 50 0000 R CNN 296 | F 2 "Connector_own:JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal" H 9150 2150 50 0001 L CNN 297 | F 3 "http://www.jst-mfg.com/product/pdf/eng/eSH.pdf" H 9150 2050 50 0001 L CNN 298 | F 4 "JST (JAPAN SOLDERLESS TERMINALS) - SM04B-SRSS-TB(LF)(SN) - CONNECTOR, HEADER, SMT, R/A, 1MM, 4WAY" H 9150 1950 50 0001 L CNN "Description" 299 | F 5 "JST (JAPAN SOLDERLESS TERMINALS)" H 9150 1850 50 0001 L CNN "Manufacturer_Name" 300 | F 6 "SM04B-SRSS-TB(LF)(SN)" H 9150 1750 50 0001 L CNN "Manufacturer_Part_Number" 301 | 1 9900 2400 302 | 0 -1 -1 0 303 | $EndComp 304 | Wire Wire Line 305 | 8900 2800 8900 5800 306 | Wire Wire Line 307 | 8900 5800 7650 5800 308 | Connection ~ 7650 5800 309 | Wire Wire Line 310 | 9850 2800 9850 5800 311 | Wire Wire Line 312 | 9850 5800 8900 5800 313 | Connection ~ 8900 5800 314 | Wire Wire Line 315 | 7350 1150 8900 1150 316 | Wire Wire Line 317 | 9850 1150 9850 2000 318 | Connection ~ 7350 1150 319 | Wire Wire Line 320 | 8900 2000 8900 1150 321 | Connection ~ 8900 1150 322 | Wire Wire Line 323 | 8900 1150 9850 1150 324 | Wire Wire Line 325 | 8000 3650 8000 1600 326 | Wire Wire Line 327 | 8000 1600 9000 1600 328 | Wire Wire Line 329 | 9950 1600 9950 2000 330 | Connection ~ 8000 3650 331 | Wire Wire Line 332 | 9000 2000 9000 1600 333 | Connection ~ 9000 1600 334 | Wire Wire Line 335 | 9000 1600 9950 1600 336 | Wire Wire Line 337 | 7850 4350 9000 4350 338 | Wire Wire Line 339 | 9950 4350 9950 2800 340 | Connection ~ 7850 4350 341 | Wire Wire Line 342 | 7850 4350 7850 3750 343 | Wire Wire Line 344 | 9000 2800 9000 4350 345 | Connection ~ 9000 4350 346 | Wire Wire Line 347 | 9000 4350 9950 4350 348 | Wire Wire Line 349 | 4800 4150 4800 5800 350 | Connection ~ 4800 5800 351 | Wire Wire Line 352 | 4800 5800 4250 5800 353 | $EndSCHEMATC 354 | -------------------------------------------------------------------------------- /pcb/usbUart.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 12 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Connector:USB_B_Micro J14 19 | U 1 1 5CAF5B2C 20 | P 1700 1100 21 | F 0 "J14" H 1755 1567 50 0000 C CNN 22 | F 1 "USB_B_Micro" H 1755 1476 50 0000 C CNN 23 | F 2 "Connector_own:USB_Micro-B_Molex-105017-0001" H 1850 1050 50 0001 C CNN 24 | F 3 "~" H 1850 1050 50 0001 C CNN 25 | 1 1700 1100 26 | 1 0 0 -1 27 | $EndComp 28 | Wire Wire Line 29 | 2000 900 2050 900 30 | Wire Wire Line 31 | 2950 2300 2300 2300 32 | Wire Wire Line 33 | 1700 2300 1700 1600 34 | Wire Wire Line 35 | 1600 1500 1600 1600 36 | Wire Wire Line 37 | 1600 1600 1700 1600 38 | Connection ~ 1700 1600 39 | Wire Wire Line 40 | 1700 1600 1700 1500 41 | $Comp 42 | L Device:C C28 43 | U 1 1 5CAF5DCC 44 | P 2300 2150 45 | F 0 "C28" H 2415 2196 50 0000 L CNN 46 | F 1 "100n" H 2415 2105 50 0000 L CNN 47 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 2338 2000 50 0001 C CNN 48 | F 3 "~" H 2300 2150 50 0001 C CNN 49 | 1 2300 2150 50 | 1 0 0 -1 51 | $EndComp 52 | Connection ~ 2300 2300 53 | Wire Wire Line 54 | 2300 2300 1700 2300 55 | $Comp 56 | L Power_Protection:TPD3E001DRLR U7 57 | U 1 1 5CAF5C53 58 | P 2950 2000 59 | F 0 "U7" H 2950 2367 50 0000 C CNN 60 | F 1 "TPD3E001DRLR" H 2950 2276 50 0000 C CNN 61 | F 2 "Package_TO_SOT_SMD:SOT-553" H 2250 1700 50 0001 C CNN 62 | F 3 "http://www.ti.com/lit/ds/symlink/tpd3e001.pdf" H 2750 2250 50 0001 C CNN 63 | 1 2950 2000 64 | 1 0 0 -1 65 | $EndComp 66 | Wire Wire Line 67 | 2550 2000 2300 2000 68 | Wire Wire Line 69 | 2300 2000 2300 900 70 | Connection ~ 2300 2000 71 | $Comp 72 | L Interface_USB:CP2102N-A01-GQFN24 U8 73 | U 1 1 5CAF5FF2 74 | P 5650 2200 75 | F 0 "U8" V 5400 1300 50 0000 L CNN 76 | F 1 "CP2102N-A01-GQFN24" V 5250 500 50 0000 L CNN 77 | F 2 "Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm" H 6100 1400 50 0001 L CNN 78 | F 3 "http://www.silabs.com/support%20documents/technicaldocs/cp2102n-datasheet.pdf" H 5700 1150 50 0001 C CNN 79 | 1 5650 2200 80 | 0 1 1 0 81 | $EndComp 82 | Wire Wire Line 83 | 2950 2300 4750 2300 84 | Connection ~ 2950 2300 85 | Connection ~ 4750 2300 86 | Wire Wire Line 87 | 4750 2200 4750 2300 88 | Wire Wire Line 89 | 2000 1100 3550 1100 90 | Wire Wire Line 91 | 5250 1100 5250 1600 92 | Wire Wire Line 93 | 5150 1200 5150 1600 94 | Connection ~ 3550 1100 95 | Wire Wire Line 96 | 3550 1100 5250 1100 97 | Text HLabel 10850 5950 2 50 BiDi ~ 0 98 | 3V3 99 | Text HLabel 10850 6150 2 50 BiDi ~ 0 100 | 5V 101 | Text HLabel 10850 6350 2 50 BiDi ~ 0 102 | GND 103 | Connection ~ 1700 2300 104 | Wire Wire Line 105 | 5650 1600 5650 1300 106 | Wire Wire Line 107 | 5650 1300 6250 1300 108 | Wire Wire Line 109 | 6800 1300 6800 1700 110 | Wire Wire Line 111 | 6800 2100 6550 2100 112 | Wire Wire Line 113 | 6800 2100 6800 2200 114 | Wire Wire Line 115 | 6800 2200 6550 2200 116 | Connection ~ 6800 2100 117 | $Comp 118 | L Device:R R36 119 | U 1 1 5CAF7560 120 | P 6250 1450 121 | F 0 "R36" H 6320 1496 50 0000 L CNN 122 | F 1 "1k" H 6320 1405 50 0000 L CNN 123 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6180 1450 50 0001 C CNN 124 | F 3 "~" H 6250 1450 50 0001 C CNN 125 | 1 6250 1450 126 | 1 0 0 -1 127 | $EndComp 128 | Connection ~ 6250 1300 129 | Wire Wire Line 130 | 6250 1300 6800 1300 131 | $Comp 132 | L Device:C C31 133 | U 1 1 5CAF797E 134 | P 6950 2100 135 | F 0 "C31" V 6698 2100 50 0000 C CNN 136 | F 1 "2.2u" V 6789 2100 50 0000 C CNN 137 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6988 1950 50 0001 C CNN 138 | F 3 "~" H 6950 2100 50 0001 C CNN 139 | 1 6950 2100 140 | 0 1 1 0 141 | $EndComp 142 | $Comp 143 | L Device:C C30 144 | U 1 1 5CAF7A25 145 | P 6950 1700 146 | F 0 "C30" V 6698 1700 50 0000 C CNN 147 | F 1 "100n" V 6789 1700 50 0000 C CNN 148 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 6988 1550 50 0001 C CNN 149 | F 3 "~" H 6950 1700 50 0001 C CNN 150 | 1 6950 1700 151 | 0 1 1 0 152 | $EndComp 153 | Connection ~ 6800 1700 154 | Wire Wire Line 155 | 6800 1700 6800 2100 156 | $Comp 157 | L Device:C C29 158 | U 1 1 5CAF7B08 159 | P 5650 1150 160 | F 0 "C29" H 5765 1196 50 0000 L CNN 161 | F 1 "100n" H 5765 1105 50 0000 L CNN 162 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5688 1000 50 0001 C CNN 163 | F 3 "~" H 5650 1150 50 0001 C CNN 164 | 1 5650 1150 165 | 1 0 0 -1 166 | $EndComp 167 | Connection ~ 5650 1300 168 | Wire Wire Line 169 | 1700 2300 1700 6350 170 | Wire Wire Line 171 | 1700 6350 7100 6350 172 | Wire Wire Line 173 | 5650 1000 7100 1000 174 | Wire Wire Line 175 | 7100 1000 7100 1700 176 | Connection ~ 7100 6350 177 | Wire Wire Line 178 | 7100 6350 10850 6350 179 | Connection ~ 7100 1700 180 | Wire Wire Line 181 | 7100 1700 7100 2100 182 | Connection ~ 7100 2100 183 | Wire Wire Line 184 | 7100 2100 7100 6350 185 | Wire Wire Line 186 | 6800 2200 6800 5950 187 | Wire Wire Line 188 | 6800 5950 10850 5950 189 | Connection ~ 6800 2200 190 | Wire Wire Line 191 | 2050 900 2050 6150 192 | Wire Wire Line 193 | 2050 6150 4600 6150 194 | Connection ~ 2050 900 195 | Wire Wire Line 196 | 2050 900 2300 900 197 | $Comp 198 | L Device:R R35 199 | U 1 1 5CAF9809 200 | P 5500 900 201 | F 0 "R35" V 5293 900 50 0000 C CNN 202 | F 1 "47k" V 5384 900 50 0000 C CNN 203 | F 2 "Resistor_SMD:R_0805_2012Metric" V 5430 900 50 0001 C CNN 204 | F 3 "~" H 5500 900 50 0001 C CNN 205 | 1 5500 900 206 | 0 1 1 0 207 | $EndComp 208 | $Comp 209 | L Device:R R34 210 | U 1 1 5CAF98CE 211 | P 5200 900 212 | F 0 "R34" V 4993 900 50 0000 C CNN 213 | F 1 "22.1k" V 5084 900 50 0000 C CNN 214 | F 2 "Resistor_SMD:R_0805_2012Metric" V 5130 900 50 0001 C CNN 215 | F 3 "~" H 5200 900 50 0001 C CNN 216 | 1 5200 900 217 | 0 1 1 0 218 | $EndComp 219 | Wire Wire Line 220 | 5650 1000 5650 900 221 | Connection ~ 5650 1000 222 | Wire Wire Line 223 | 5350 900 5350 1600 224 | Connection ~ 5350 900 225 | Wire Wire Line 226 | 5050 900 2300 900 227 | Connection ~ 2300 900 228 | Text HLabel 10950 3200 2 50 BiDi ~ 0 229 | TX 230 | Text HLabel 10950 3050 2 50 BiDi ~ 0 231 | RX 232 | Text HLabel 10950 3350 2 50 BiDi ~ 0 233 | EN 234 | Text HLabel 10900 4900 2 50 BiDi ~ 0 235 | IO0 236 | Text HLabel 10950 5500 2 50 BiDi ~ 0 237 | IO2 238 | Wire Wire Line 239 | 5950 2800 5950 3050 240 | Wire Wire Line 241 | 5950 3050 9000 3050 242 | $Comp 243 | L Device:R R39 244 | U 1 1 5CAFC106 245 | P 9150 3050 246 | F 0 "R39" V 8943 3050 50 0000 C CNN 247 | F 1 "120" V 9034 3050 50 0000 C CNN 248 | F 2 "Resistor_SMD:R_0805_2012Metric" V 9080 3050 50 0001 C CNN 249 | F 3 "~" H 9150 3050 50 0001 C CNN 250 | 1 9150 3050 251 | 0 1 1 0 252 | $EndComp 253 | $Comp 254 | L Device:R R38 255 | U 1 1 5CAFC175 256 | P 8800 3200 257 | F 0 "R38" V 8593 3200 50 0000 C CNN 258 | F 1 "120" V 8684 3200 50 0000 C CNN 259 | F 2 "Resistor_SMD:R_0805_2012Metric" V 8730 3200 50 0001 C CNN 260 | F 3 "~" H 8800 3200 50 0001 C CNN 261 | 1 8800 3200 262 | 0 1 1 0 263 | $EndComp 264 | Wire Wire Line 265 | 8650 3200 5850 3200 266 | Wire Wire Line 267 | 5850 3200 5850 2800 268 | Wire Wire Line 269 | 10950 3050 9300 3050 270 | Wire Wire Line 271 | 8950 3200 10950 3200 272 | $Comp 273 | L Diode:BAT54C D10 274 | U 1 1 5CAFFC1B 275 | P 10450 5200 276 | F 0 "D10" V 10404 5287 50 0000 L CNN 277 | F 1 "BAT54C" V 10495 5287 50 0000 L CNN 278 | F 2 "Package_TO_SOT_SMD:SOT-23" H 10525 5325 50 0001 L CNN 279 | F 3 "http://www.diodes.com/_files/datasheets/ds11005.pdf" H 10370 5200 50 0001 C CNN 280 | 1 10450 5200 281 | 0 1 1 0 282 | $EndComp 283 | Wire Wire Line 284 | 10900 4900 10450 4900 285 | Wire Wire Line 286 | 10950 5500 10450 5500 287 | $Comp 288 | L Device:R R41 289 | U 1 1 5CB011F3 290 | P 9950 5200 291 | F 0 "R41" V 9743 5200 50 0000 C CNN 292 | F 1 "120" V 9834 5200 50 0000 C CNN 293 | F 2 "Resistor_SMD:R_0805_2012Metric" V 9880 5200 50 0001 C CNN 294 | F 3 "~" H 9950 5200 50 0001 C CNN 295 | 1 9950 5200 296 | 0 1 1 0 297 | $EndComp 298 | Wire Wire Line 299 | 10100 5200 10250 5200 300 | $Comp 301 | L Transistor_BJT_own:BC817-40,215 Q2 302 | U 1 1 5CB02B3A 303 | P 9750 3650 304 | F 0 "Q2" H 10288 3696 50 0000 L CNN 305 | F 1 "BC817-40,215" H 10288 3605 50 0000 L CNN 306 | F 2 "ICs_own:SOT95P230X110-3N" H 10300 3500 50 0001 L CNN 307 | F 3 "https://componentsearchengine.com/Datasheets/1/BC817-40,215.pdf" H 10300 3400 50 0001 L CNN 308 | F 4 "BC817; BC817W; BC337 - 45 V, 500 mA NPN general-purpose transistors" H 10300 3300 50 0001 L CNN "Description" 309 | F 5 "1.1" H 10300 3200 50 0001 L CNN "Height" 310 | F 6 "771-BC817-40-T/R" H 10300 3100 50 0001 L CNN "Mouser Part Number" 311 | F 7 "https://www.mouser.com/Search/Refine.aspx?Keyword=771-BC817-40-T%2FR" H 10300 3000 50 0001 L CNN "Mouser Price/Stock" 312 | F 8 "Nexperia" H 10300 2900 50 0001 L CNN "Manufacturer_Name" 313 | F 9 "BC817-40,215" H 10300 2800 50 0001 L CNN "Manufacturer_Part_Number" 314 | 1 9750 3650 315 | 1 0 0 -1 316 | $EndComp 317 | $Comp 318 | L Transistor_BJT_own:BC817-40,215 Q1 319 | U 1 1 5CB02C43 320 | P 8650 4900 321 | F 0 "Q1" H 9188 4854 50 0000 L CNN 322 | F 1 "BC817-40,215" H 9188 4945 50 0000 L CNN 323 | F 2 "ICs_own:SOT95P230X110-3N" H 9200 4750 50 0001 L CNN 324 | F 3 "https://componentsearchengine.com/Datasheets/1/BC817-40,215.pdf" H 9200 4650 50 0001 L CNN 325 | F 4 "BC817; BC817W; BC337 - 45 V, 500 mA NPN general-purpose transistors" H 9200 4550 50 0001 L CNN "Description" 326 | F 5 "1.1" H 9200 4450 50 0001 L CNN "Height" 327 | F 6 "771-BC817-40-T/R" H 9200 4350 50 0001 L CNN "Mouser Part Number" 328 | F 7 "https://www.mouser.com/Search/Refine.aspx?Keyword=771-BC817-40-T%2FR" H 9200 4250 50 0001 L CNN "Mouser Price/Stock" 329 | F 8 "Nexperia" H 9200 4150 50 0001 L CNN "Manufacturer_Name" 330 | F 9 "BC817-40,215" H 9200 4050 50 0001 L CNN "Manufacturer_Part_Number" 331 | 1 8650 4900 332 | 1 0 0 1 333 | $EndComp 334 | Wire Wire Line 335 | 9800 5200 9050 5200 336 | $Comp 337 | L Device:R R37 338 | U 1 1 5CB043E8 339 | P 8350 4900 340 | F 0 "R37" V 8143 4900 50 0000 C CNN 341 | F 1 "1k" V 8234 4900 50 0000 C CNN 342 | F 2 "Resistor_SMD:R_0805_2012Metric" V 8280 4900 50 0001 C CNN 343 | F 3 "~" H 8350 4900 50 0001 C CNN 344 | 1 8350 4900 345 | 0 1 1 0 346 | $EndComp 347 | Wire Wire Line 348 | 8500 4900 8650 4900 349 | $Comp 350 | L Device:R R40 351 | U 1 1 5CB085E3 352 | P 9450 3650 353 | F 0 "R40" V 9243 3650 50 0000 C CNN 354 | F 1 "1k" V 9334 3650 50 0000 C CNN 355 | F 2 "Resistor_SMD:R_0805_2012Metric" V 9380 3650 50 0001 C CNN 356 | F 3 "~" H 9450 3650 50 0001 C CNN 357 | 1 9450 3650 358 | 0 1 1 0 359 | $EndComp 360 | Wire Wire Line 361 | 9600 3650 9750 3650 362 | Wire Wire Line 363 | 5650 3650 5650 2800 364 | Wire Wire Line 365 | 5650 3650 9050 3650 366 | Wire Wire Line 367 | 8200 3950 10150 3950 368 | Connection ~ 8200 3950 369 | Wire Wire Line 370 | 8200 3950 8200 4900 371 | Wire Wire Line 372 | 9050 4600 9050 3650 373 | Connection ~ 9050 3650 374 | Wire Wire Line 375 | 9050 3650 9300 3650 376 | Wire Wire Line 377 | 8200 3950 6050 3950 378 | Wire Wire Line 379 | 6050 2800 6050 3950 380 | Wire Wire Line 381 | 10150 3350 10950 3350 382 | Wire Wire Line 383 | 2000 1300 3450 1300 384 | Wire Wire Line 385 | 3350 2000 3550 2000 386 | Wire Wire Line 387 | 3550 2000 3550 1100 388 | Wire Wire Line 389 | 2000 1200 3650 1200 390 | Wire Wire Line 391 | 3350 1900 3450 1900 392 | Wire Wire Line 393 | 3450 1900 3450 1300 394 | Wire Wire Line 395 | 3650 1200 3650 2100 396 | Wire Wire Line 397 | 3650 2100 3350 2100 398 | Connection ~ 3650 1200 399 | Wire Wire Line 400 | 3650 1200 5150 1200 401 | $Comp 402 | L Device:D D11 403 | U 1 1 5CB59D7C 404 | P 4750 6150 405 | F 0 "D11" H 4750 5934 50 0000 C CNN 406 | F 1 "SD0805S020S1R0" H 4750 6025 50 0000 C CNN 407 | F 2 "Diode_SMD:D_0805_2012Metric" H 4750 6150 50 0001 C CNN 408 | F 3 "~" H 4750 6150 50 0001 C CNN 409 | 1 4750 6150 410 | -1 0 0 1 411 | $EndComp 412 | Wire Wire Line 413 | 4900 6150 10850 6150 414 | $EndSCHEMATC 415 | -------------------------------------------------------------------------------- /code/Load-Test/Adafruit_ADS1015.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file Adafruit_ADS1015.cpp 4 | @author K.Townsend (Adafruit Industries) 5 | @license BSD (see license.txt) 6 | 7 | Driver for the ADS1015/ADS1115 ADC 8 | 9 | This is a library for the Adafruit MPL115A2 breakout 10 | ----> https://www.adafruit.com/products/??? 11 | 12 | Adafruit invests time and resources providing this open source code, 13 | please support Adafruit and open-source hardware by purchasing 14 | products from Adafruit! 15 | 16 | @section HISTORY 17 | 18 | v1.0 - First release 19 | */ 20 | /**************************************************************************/ 21 | #if ARDUINO >= 100 22 | #include "Arduino.h" 23 | #else 24 | #include "WProgram.h" 25 | #endif 26 | 27 | #include 28 | 29 | #include "Adafruit_ADS1015.h" 30 | 31 | /**************************************************************************/ 32 | /*! 33 | @brief Abstract away platform differences in Arduino wire library 34 | */ 35 | /**************************************************************************/ 36 | static uint8_t i2cread(void) { 37 | #if ARDUINO >= 100 38 | return Wire.read(); 39 | #else 40 | return Wire.receive(); 41 | #endif 42 | } 43 | 44 | /**************************************************************************/ 45 | /*! 46 | @brief Abstract away platform differences in Arduino wire library 47 | */ 48 | /**************************************************************************/ 49 | static void i2cwrite(uint8_t x) { 50 | #if ARDUINO >= 100 51 | Wire.write((uint8_t)x); 52 | #else 53 | Wire.send(x); 54 | #endif 55 | } 56 | 57 | /**************************************************************************/ 58 | /*! 59 | @brief Writes 16-bits to the specified destination register 60 | */ 61 | /**************************************************************************/ 62 | static void writeRegister(uint8_t i2cAddress, uint8_t reg, uint16_t value) { 63 | Wire.beginTransmission(i2cAddress); 64 | i2cwrite((uint8_t)reg); 65 | i2cwrite((uint8_t)(value>>8)); 66 | i2cwrite((uint8_t)(value & 0xFF)); 67 | Wire.endTransmission(); 68 | } 69 | 70 | /**************************************************************************/ 71 | /*! 72 | @brief Writes 16-bits to the specified destination register 73 | */ 74 | /**************************************************************************/ 75 | static uint16_t readRegister(uint8_t i2cAddress, uint8_t reg) { 76 | Wire.beginTransmission(i2cAddress); 77 | i2cwrite(ADS1015_REG_POINTER_CONVERT); 78 | Wire.endTransmission(); 79 | Wire.requestFrom(i2cAddress, (uint8_t)2); 80 | return ((i2cread() << 8) | i2cread()); 81 | } 82 | 83 | /**************************************************************************/ 84 | /*! 85 | @brief Instantiates a new ADS1015 class w/appropriate properties 86 | */ 87 | /**************************************************************************/ 88 | Adafruit_ADS1015::Adafruit_ADS1015(uint8_t i2cAddress) 89 | { 90 | m_i2cAddress = i2cAddress; 91 | m_conversionDelay = ADS1015_CONVERSIONDELAY; 92 | m_bitShift = 4; 93 | m_gain = GAIN_TWOTHIRDS; /* +/- 6.144V range (limited to VDD +0.3V max!) */ 94 | } 95 | 96 | /**************************************************************************/ 97 | /*! 98 | @brief Instantiates a new ADS1115 class w/appropriate properties 99 | */ 100 | /**************************************************************************/ 101 | Adafruit_ADS1115::Adafruit_ADS1115(uint8_t i2cAddress) 102 | { 103 | m_i2cAddress = i2cAddress; 104 | m_conversionDelay = ADS1115_CONVERSIONDELAY; 105 | m_bitShift = 0; 106 | m_gain = GAIN_TWOTHIRDS; /* +/- 6.144V range (limited to VDD +0.3V max!) */ 107 | } 108 | 109 | /**************************************************************************/ 110 | /*! 111 | @brief Sets up the HW (reads coefficients values, etc.) 112 | */ 113 | /**************************************************************************/ 114 | void Adafruit_ADS1015::begin() { 115 | Wire.begin(); 116 | } 117 | 118 | /**************************************************************************/ 119 | /*! 120 | @brief Sets the gain and input voltage range 121 | */ 122 | /**************************************************************************/ 123 | void Adafruit_ADS1015::setGain(adsGain_t gain) 124 | { 125 | m_gain = gain; 126 | } 127 | 128 | /**************************************************************************/ 129 | /*! 130 | @brief Gets a gain and input voltage range 131 | */ 132 | /**************************************************************************/ 133 | adsGain_t Adafruit_ADS1015::getGain() 134 | { 135 | return m_gain; 136 | } 137 | 138 | /**************************************************************************/ 139 | /*! 140 | @brief Gets a single-ended ADC reading from the specified channel 141 | */ 142 | /**************************************************************************/ 143 | uint16_t Adafruit_ADS1015::readADC_SingleEnded(uint8_t channel) { 144 | if (channel > 3) 145 | { 146 | return 0; 147 | } 148 | 149 | // Start with default values 150 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 151 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 152 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 153 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 154 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 155 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 156 | 157 | // Set PGA/voltage range 158 | config |= m_gain; 159 | 160 | // Set single-ended input channel 161 | switch (channel) 162 | { 163 | case (0): 164 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_0; 165 | break; 166 | case (1): 167 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_1; 168 | break; 169 | case (2): 170 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_2; 171 | break; 172 | case (3): 173 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_3; 174 | break; 175 | } 176 | 177 | // Set 'start single-conversion' bit 178 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 179 | 180 | // Write config register to the ADC 181 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 182 | 183 | // Wait for the conversion to complete 184 | delay(m_conversionDelay); 185 | 186 | // Read the conversion results 187 | // Shift 12-bit results right 4 bits for the ADS1015 188 | return readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 189 | } 190 | 191 | /**************************************************************************/ 192 | /*! 193 | @brief Reads the conversion results, measuring the voltage 194 | difference between the P (AIN0) and N (AIN1) input. Generates 195 | a signed value since the difference can be either 196 | positive or negative. 197 | */ 198 | /**************************************************************************/ 199 | int16_t Adafruit_ADS1015::readADC_Differential_0_1() { 200 | // Start with default values 201 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 202 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 203 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 204 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 205 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 206 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 207 | 208 | // Set PGA/voltage range 209 | config |= m_gain; 210 | 211 | // Set channels 212 | config |= ADS1015_REG_CONFIG_MUX_DIFF_0_1; // AIN0 = P, AIN1 = N 213 | 214 | // Set 'start single-conversion' bit 215 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 216 | 217 | // Write config register to the ADC 218 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 219 | 220 | // Wait for the conversion to complete 221 | delay(m_conversionDelay); 222 | 223 | // Read the conversion results 224 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 225 | if (m_bitShift == 0) 226 | { 227 | return (int16_t)res; 228 | } 229 | else 230 | { 231 | // Shift 12-bit results right 4 bits for the ADS1015, 232 | // making sure we keep the sign bit intact 233 | if (res > 0x07FF) 234 | { 235 | // negative number - extend the sign to 16th bit 236 | res |= 0xF000; 237 | } 238 | return (int16_t)res; 239 | } 240 | } 241 | 242 | /**************************************************************************/ 243 | /*! 244 | @brief Reads the conversion results, measuring the voltage 245 | difference between the P (AIN2) and N (AIN3) input. Generates 246 | a signed value since the difference can be either 247 | positive or negative. 248 | */ 249 | /**************************************************************************/ 250 | int16_t Adafruit_ADS1015::readADC_Differential_2_3() { 251 | // Start with default values 252 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 253 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 254 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 255 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 256 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 257 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 258 | 259 | // Set PGA/voltage range 260 | config |= m_gain; 261 | 262 | // Set channels 263 | config |= ADS1015_REG_CONFIG_MUX_DIFF_2_3; // AIN2 = P, AIN3 = N 264 | 265 | // Set 'start single-conversion' bit 266 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 267 | 268 | // Write config register to the ADC 269 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 270 | 271 | // Wait for the conversion to complete 272 | delay(m_conversionDelay); 273 | 274 | // Read the conversion results 275 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 276 | if (m_bitShift == 0) 277 | { 278 | return (int16_t)res; 279 | } 280 | else 281 | { 282 | // Shift 12-bit results right 4 bits for the ADS1015, 283 | // making sure we keep the sign bit intact 284 | if (res > 0x07FF) 285 | { 286 | // negative number - extend the sign to 16th bit 287 | res |= 0xF000; 288 | } 289 | return (int16_t)res; 290 | } 291 | } 292 | 293 | /**************************************************************************/ 294 | /*! 295 | @brief Sets up the comparator to operate in basic mode, causing the 296 | ALERT/RDY pin to assert (go from high to low) when the ADC 297 | value exceeds the specified threshold. 298 | 299 | This will also set the ADC in continuous conversion mode. 300 | */ 301 | /**************************************************************************/ 302 | void Adafruit_ADS1015::startComparator_SingleEnded(uint8_t channel, int16_t threshold) 303 | { 304 | // Start with default values 305 | uint16_t config = ADS1015_REG_CONFIG_CQUE_1CONV | // Comparator enabled and asserts on 1 match 306 | ADS1015_REG_CONFIG_CLAT_LATCH | // Latching mode 307 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 308 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 309 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 310 | ADS1015_REG_CONFIG_MODE_CONTIN | // Continuous conversion mode 311 | ADS1015_REG_CONFIG_MODE_CONTIN; // Continuous conversion mode 312 | 313 | // Set PGA/voltage range 314 | config |= m_gain; 315 | 316 | // Set single-ended input channel 317 | switch (channel) 318 | { 319 | case (0): 320 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_0; 321 | break; 322 | case (1): 323 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_1; 324 | break; 325 | case (2): 326 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_2; 327 | break; 328 | case (3): 329 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_3; 330 | break; 331 | } 332 | 333 | // Set the high threshold register 334 | // Shift 12-bit results left 4 bits for the ADS1015 335 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_HITHRESH, threshold << m_bitShift); 336 | 337 | // Write config register to the ADC 338 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 339 | } 340 | 341 | /**************************************************************************/ 342 | /*! 343 | @brief In order to clear the comparator, we need to read the 344 | conversion results. This function reads the last conversion 345 | results without changing the config value. 346 | */ 347 | /**************************************************************************/ 348 | int16_t Adafruit_ADS1015::getLastConversionResults() 349 | { 350 | // Wait for the conversion to complete 351 | delay(m_conversionDelay); 352 | 353 | // Read the conversion results 354 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 355 | if (m_bitShift == 0) 356 | { 357 | return (int16_t)res; 358 | } 359 | else 360 | { 361 | // Shift 12-bit results right 4 bits for the ADS1015, 362 | // making sure we keep the sign bit intact 363 | if (res > 0x07FF) 364 | { 365 | // negative number - extend the sign to 16th bit 366 | res |= 0xF000; 367 | } 368 | return (int16_t)res; 369 | } 370 | } 371 | -------------------------------------------------------------------------------- /code/HW-Test/Adafruit_ADS1015.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************/ 2 | /*! 3 | @file Adafruit_ADS1015.cpp 4 | @author K.Townsend (Adafruit Industries) 5 | @license BSD (see license.txt) 6 | 7 | Driver for the ADS1015/ADS1115 ADC 8 | 9 | This is a library for the Adafruit MPL115A2 breakout 10 | ----> https://www.adafruit.com/products/??? 11 | 12 | Adafruit invests time and resources providing this open source code, 13 | please support Adafruit and open-source hardware by purchasing 14 | products from Adafruit! 15 | 16 | @section HISTORY 17 | 18 | v1.0 - First release 19 | */ 20 | /**************************************************************************/ 21 | #if ARDUINO >= 100 22 | #include "Arduino.h" 23 | #else 24 | #include "WProgram.h" 25 | #endif 26 | 27 | #include 28 | 29 | #include "Adafruit_ADS1015.h" 30 | 31 | /**************************************************************************/ 32 | /*! 33 | @brief Abstract away platform differences in Arduino wire library 34 | */ 35 | /**************************************************************************/ 36 | static uint8_t i2cread(void) { 37 | #if ARDUINO >= 100 38 | return Wire.read(); 39 | #else 40 | return Wire.receive(); 41 | #endif 42 | } 43 | 44 | /**************************************************************************/ 45 | /*! 46 | @brief Abstract away platform differences in Arduino wire library 47 | */ 48 | /**************************************************************************/ 49 | static void i2cwrite(uint8_t x) { 50 | #if ARDUINO >= 100 51 | Wire.write((uint8_t)x); 52 | #else 53 | Wire.send(x); 54 | #endif 55 | } 56 | 57 | /**************************************************************************/ 58 | /*! 59 | @brief Writes 16-bits to the specified destination register 60 | */ 61 | /**************************************************************************/ 62 | static void writeRegister(uint8_t i2cAddress, uint8_t reg, uint16_t value) { 63 | Wire.beginTransmission(i2cAddress); 64 | i2cwrite((uint8_t)reg); 65 | i2cwrite((uint8_t)(value>>8)); 66 | i2cwrite((uint8_t)(value & 0xFF)); 67 | Wire.endTransmission(); 68 | } 69 | 70 | /**************************************************************************/ 71 | /*! 72 | @brief Writes 16-bits to the specified destination register 73 | */ 74 | /**************************************************************************/ 75 | static uint16_t readRegister(uint8_t i2cAddress, uint8_t reg) { 76 | Wire.beginTransmission(i2cAddress); 77 | i2cwrite(ADS1015_REG_POINTER_CONVERT); 78 | Wire.endTransmission(); 79 | Wire.requestFrom(i2cAddress, (uint8_t)2); 80 | return ((i2cread() << 8) | i2cread()); 81 | } 82 | 83 | /**************************************************************************/ 84 | /*! 85 | @brief Instantiates a new ADS1015 class w/appropriate properties 86 | */ 87 | /**************************************************************************/ 88 | Adafruit_ADS1015::Adafruit_ADS1015(uint8_t i2cAddress) 89 | { 90 | m_i2cAddress = i2cAddress; 91 | m_conversionDelay = ADS1015_CONVERSIONDELAY; 92 | m_bitShift = 4; 93 | m_gain = GAIN_TWOTHIRDS; /* +/- 6.144V range (limited to VDD +0.3V max!) */ 94 | } 95 | 96 | /**************************************************************************/ 97 | /*! 98 | @brief Instantiates a new ADS1115 class w/appropriate properties 99 | */ 100 | /**************************************************************************/ 101 | Adafruit_ADS1115::Adafruit_ADS1115(uint8_t i2cAddress) 102 | { 103 | m_i2cAddress = i2cAddress; 104 | m_conversionDelay = ADS1115_CONVERSIONDELAY; 105 | m_bitShift = 0; 106 | m_gain = GAIN_TWOTHIRDS; /* +/- 6.144V range (limited to VDD +0.3V max!) */ 107 | } 108 | 109 | /**************************************************************************/ 110 | /*! 111 | @brief Sets up the HW (reads coefficients values, etc.) 112 | */ 113 | /**************************************************************************/ 114 | void Adafruit_ADS1015::begin() { 115 | Wire.begin(); 116 | } 117 | 118 | /**************************************************************************/ 119 | /*! 120 | @brief Sets the gain and input voltage range 121 | */ 122 | /**************************************************************************/ 123 | void Adafruit_ADS1015::setGain(adsGain_t gain) 124 | { 125 | m_gain = gain; 126 | } 127 | 128 | /**************************************************************************/ 129 | /*! 130 | @brief Gets a gain and input voltage range 131 | */ 132 | /**************************************************************************/ 133 | adsGain_t Adafruit_ADS1015::getGain() 134 | { 135 | return m_gain; 136 | } 137 | 138 | /**************************************************************************/ 139 | /*! 140 | @brief Gets a single-ended ADC reading from the specified channel 141 | */ 142 | /**************************************************************************/ 143 | uint16_t Adafruit_ADS1015::readADC_SingleEnded(uint8_t channel) { 144 | if (channel > 3) 145 | { 146 | return 0; 147 | } 148 | 149 | // Start with default values 150 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 151 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 152 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 153 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 154 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 155 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 156 | 157 | // Set PGA/voltage range 158 | config |= m_gain; 159 | 160 | // Set single-ended input channel 161 | switch (channel) 162 | { 163 | case (0): 164 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_0; 165 | break; 166 | case (1): 167 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_1; 168 | break; 169 | case (2): 170 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_2; 171 | break; 172 | case (3): 173 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_3; 174 | break; 175 | } 176 | 177 | // Set 'start single-conversion' bit 178 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 179 | 180 | // Write config register to the ADC 181 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 182 | 183 | // Wait for the conversion to complete 184 | delay(m_conversionDelay); 185 | 186 | // Read the conversion results 187 | // Shift 12-bit results right 4 bits for the ADS1015 188 | return readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 189 | } 190 | 191 | /**************************************************************************/ 192 | /*! 193 | @brief Reads the conversion results, measuring the voltage 194 | difference between the P (AIN0) and N (AIN1) input. Generates 195 | a signed value since the difference can be either 196 | positive or negative. 197 | */ 198 | /**************************************************************************/ 199 | int16_t Adafruit_ADS1015::readADC_Differential_0_1() { 200 | // Start with default values 201 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 202 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 203 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 204 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 205 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 206 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 207 | 208 | // Set PGA/voltage range 209 | config |= m_gain; 210 | 211 | // Set channels 212 | config |= ADS1015_REG_CONFIG_MUX_DIFF_0_1; // AIN0 = P, AIN1 = N 213 | 214 | // Set 'start single-conversion' bit 215 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 216 | 217 | // Write config register to the ADC 218 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 219 | 220 | // Wait for the conversion to complete 221 | delay(m_conversionDelay); 222 | 223 | // Read the conversion results 224 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 225 | if (m_bitShift == 0) 226 | { 227 | return (int16_t)res; 228 | } 229 | else 230 | { 231 | // Shift 12-bit results right 4 bits for the ADS1015, 232 | // making sure we keep the sign bit intact 233 | if (res > 0x07FF) 234 | { 235 | // negative number - extend the sign to 16th bit 236 | res |= 0xF000; 237 | } 238 | return (int16_t)res; 239 | } 240 | } 241 | 242 | /**************************************************************************/ 243 | /*! 244 | @brief Reads the conversion results, measuring the voltage 245 | difference between the P (AIN2) and N (AIN3) input. Generates 246 | a signed value since the difference can be either 247 | positive or negative. 248 | */ 249 | /**************************************************************************/ 250 | int16_t Adafruit_ADS1015::readADC_Differential_2_3() { 251 | // Start with default values 252 | uint16_t config = ADS1015_REG_CONFIG_CQUE_NONE | // Disable the comparator (default val) 253 | ADS1015_REG_CONFIG_CLAT_NONLAT | // Non-latching (default val) 254 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 255 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 256 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 257 | ADS1015_REG_CONFIG_MODE_SINGLE; // Single-shot mode (default) 258 | 259 | // Set PGA/voltage range 260 | config |= m_gain; 261 | 262 | // Set channels 263 | config |= ADS1015_REG_CONFIG_MUX_DIFF_2_3; // AIN2 = P, AIN3 = N 264 | 265 | // Set 'start single-conversion' bit 266 | config |= ADS1015_REG_CONFIG_OS_SINGLE; 267 | 268 | // Write config register to the ADC 269 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 270 | 271 | // Wait for the conversion to complete 272 | delay(m_conversionDelay); 273 | 274 | // Read the conversion results 275 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 276 | if (m_bitShift == 0) 277 | { 278 | return (int16_t)res; 279 | } 280 | else 281 | { 282 | // Shift 12-bit results right 4 bits for the ADS1015, 283 | // making sure we keep the sign bit intact 284 | if (res > 0x07FF) 285 | { 286 | // negative number - extend the sign to 16th bit 287 | res |= 0xF000; 288 | } 289 | return (int16_t)res; 290 | } 291 | } 292 | 293 | /**************************************************************************/ 294 | /*! 295 | @brief Sets up the comparator to operate in basic mode, causing the 296 | ALERT/RDY pin to assert (go from high to low) when the ADC 297 | value exceeds the specified threshold. 298 | 299 | This will also set the ADC in continuous conversion mode. 300 | */ 301 | /**************************************************************************/ 302 | void Adafruit_ADS1015::startComparator_SingleEnded(uint8_t channel, int16_t threshold) 303 | { 304 | // Start with default values 305 | uint16_t config = ADS1015_REG_CONFIG_CQUE_1CONV | // Comparator enabled and asserts on 1 match 306 | ADS1015_REG_CONFIG_CLAT_LATCH | // Latching mode 307 | ADS1015_REG_CONFIG_CPOL_ACTVLOW | // Alert/Rdy active low (default val) 308 | ADS1015_REG_CONFIG_CMODE_TRAD | // Traditional comparator (default val) 309 | ADS1015_REG_CONFIG_DR_1600SPS | // 1600 samples per second (default) 310 | ADS1015_REG_CONFIG_MODE_CONTIN | // Continuous conversion mode 311 | ADS1015_REG_CONFIG_MODE_CONTIN; // Continuous conversion mode 312 | 313 | // Set PGA/voltage range 314 | config |= m_gain; 315 | 316 | // Set single-ended input channel 317 | switch (channel) 318 | { 319 | case (0): 320 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_0; 321 | break; 322 | case (1): 323 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_1; 324 | break; 325 | case (2): 326 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_2; 327 | break; 328 | case (3): 329 | config |= ADS1015_REG_CONFIG_MUX_SINGLE_3; 330 | break; 331 | } 332 | 333 | // Set the high threshold register 334 | // Shift 12-bit results left 4 bits for the ADS1015 335 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_HITHRESH, threshold << m_bitShift); 336 | 337 | // Write config register to the ADC 338 | writeRegister(m_i2cAddress, ADS1015_REG_POINTER_CONFIG, config); 339 | } 340 | 341 | /**************************************************************************/ 342 | /*! 343 | @brief In order to clear the comparator, we need to read the 344 | conversion results. This function reads the last conversion 345 | results without changing the config value. 346 | */ 347 | /**************************************************************************/ 348 | int16_t Adafruit_ADS1015::getLastConversionResults() 349 | { 350 | // Wait for the conversion to complete 351 | delay(m_conversionDelay); 352 | 353 | // Read the conversion results 354 | uint16_t res = readRegister(m_i2cAddress, ADS1015_REG_POINTER_CONVERT) >> m_bitShift; 355 | if (m_bitShift == 0) 356 | { 357 | return (int16_t)res; 358 | } 359 | else 360 | { 361 | // Shift 12-bit results right 4 bits for the ADS1015, 362 | // making sure we keep the sign bit intact 363 | if (res > 0x07FF) 364 | { 365 | // negative number - extend the sign to 16th bit 366 | res |= 0xF000; 367 | } 368 | return (int16_t)res; 369 | } 370 | } 371 | 372 | -------------------------------------------------------------------------------- /pcb/LAN8720.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 4 2 | LIBS:mainPCB-cache 3 | EELAYER 26 0 4 | EELAYER END 5 | $Descr A4 11693 8268 6 | encoding utf-8 7 | Sheet 15 17 8 | Title "" 9 | Date "" 10 | Rev "" 11 | Comp "" 12 | Comment1 "" 13 | Comment2 "" 14 | Comment3 "" 15 | Comment4 "" 16 | $EndDescr 17 | $Comp 18 | L Connector:RJ45_Amphenol_RJMG1BD3B8K1ANR J15 19 | U 1 1 5CBB02E0 20 | P 1650 3450 21 | F 0 "J15" H 1650 4082 50 0000 C CNN 22 | F 1 "RJ45_Amphenol_RJMG1BD3B8K1ANR" H 1650 4173 50 0000 C CNN 23 | F 2 "Connector_own:RJ45_Amphenol_RJMG1BD3B8K1ANR" H 1650 4150 50 0001 C CNN 24 | F 3 "https://www.amphenolcanada.com/ProductSearch/Drawings/AC/RJMG1BD3B8K1ANR.PDF" H 1650 4250 50 0001 C CNN 25 | 1 1650 3450 26 | -1 0 0 1 27 | $EndComp 28 | $Comp 29 | L Interface_Ethernet:LAN8720A U11 30 | U 1 1 5CBB0420 31 | P 5300 3350 32 | F 0 "U11" H 5250 2072 50 0000 C CNN 33 | F 1 "LAN8720A" H 5250 2163 50 0000 C CNN 34 | F 2 "Package_DFN_QFN:QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm" H 5350 2300 50 0001 L CNN 35 | F 3 "http://ww1.microchip.com/downloads/en/DeviceDoc/8720a.pdf" H 5100 2400 50 0001 C CNN 36 | 1 5300 3350 37 | -1 0 0 1 38 | $EndComp 39 | Wire Wire Line 40 | 4200 3450 4200 3550 41 | Wire Wire Line 42 | 4200 3550 4600 3550 43 | Wire Wire Line 44 | 4200 3950 4200 3850 45 | Wire Wire Line 46 | 4200 3850 4600 3850 47 | $Comp 48 | L Device:C C34 49 | U 1 1 5CBBAAC6 50 | P 750 2600 51 | F 0 "C34" H 865 2646 50 0000 L CNN 52 | F 1 "1n/2000V" H 865 2555 50 0000 L CNN 53 | F 2 "Capacitor_SMD:C_1206_3216Metric" H 788 2450 50 0001 C CNN 54 | F 3 "~" H 750 2600 50 0001 C CNN 55 | 1 750 2600 56 | 1 0 0 -1 57 | $EndComp 58 | $Comp 59 | L Device:R R42 60 | U 1 1 5CBBABC7 61 | P 2150 2450 62 | F 0 "R42" V 1943 2450 50 0000 C CNN 63 | F 1 "0" V 2034 2450 50 0000 C CNN 64 | F 2 "Resistor_SMD:R_0805_2012Metric" V 2080 2450 50 0001 C CNN 65 | F 3 "~" H 2150 2450 50 0001 C CNN 66 | 1 2150 2450 67 | 0 1 1 0 68 | $EndComp 69 | Wire Wire Line 70 | 750 3050 750 2750 71 | Wire Wire Line 72 | 1650 2750 1650 2450 73 | Connection ~ 1650 2450 74 | Wire Wire Line 75 | 1650 2450 2000 2450 76 | Wire Wire Line 77 | 2550 3550 2750 3550 78 | Wire Wire Line 79 | 2750 3550 2750 3850 80 | Wire Wire Line 81 | 2550 3850 2750 3850 82 | Wire Wire Line 83 | 2750 3850 2750 4650 84 | $Comp 85 | L Device:R R48 86 | U 1 1 5CBBAF87 87 | P 3900 2400 88 | F 0 "R48" H 3970 2446 50 0000 L CNN 89 | F 1 "12.1k" H 3970 2355 50 0000 L CNN 90 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3830 2400 50 0001 C CNN 91 | F 3 "~" H 3900 2400 50 0001 C CNN 92 | 1 3900 2400 93 | 1 0 0 -1 94 | $EndComp 95 | $Comp 96 | L Device:C C35 97 | U 1 1 5CBBB4BC 98 | P 2900 4650 99 | F 0 "C35" V 2648 4650 50 0000 C CNN 100 | F 1 "100n/16V" V 2739 4650 50 0000 C CNN 101 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 2938 4500 50 0001 C CNN 102 | F 3 "~" H 2900 4650 50 0001 C CNN 103 | 1 2900 4650 104 | 0 1 1 0 105 | $EndComp 106 | Connection ~ 2750 4650 107 | Wire Wire Line 108 | 2750 4650 2750 4950 109 | $Comp 110 | L power:GND #PWR053 111 | U 1 1 5CBBB533 112 | P 3150 4650 113 | F 0 "#PWR053" H 3150 4400 50 0001 C CNN 114 | F 1 "GND" H 3155 4477 50 0000 C CNN 115 | F 2 "" H 3150 4650 50 0001 C CNN 116 | F 3 "" H 3150 4650 50 0001 C CNN 117 | 1 3150 4650 118 | 1 0 0 -1 119 | $EndComp 120 | Wire Wire Line 121 | 3050 4650 3150 4650 122 | $Comp 123 | L Device:R R44 124 | U 1 1 5CBBB976 125 | P 2750 5100 126 | F 0 "R44" H 2820 5146 50 0000 L CNN 127 | F 1 "0" H 2820 5055 50 0000 L CNN 128 | F 2 "Resistor_SMD:R_0805_2012Metric" V 2680 5100 50 0001 C CNN 129 | F 3 "~" H 2750 5100 50 0001 C CNN 130 | 1 2750 5100 131 | 1 0 0 -1 132 | $EndComp 133 | $Comp 134 | L Device:R R45 135 | U 1 1 5CBBB9D7 136 | P 3500 5100 137 | F 0 "R45" H 3570 5146 50 0000 L CNN 138 | F 1 "49.9" H 3570 5055 50 0000 L CNN 139 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3430 5100 50 0001 C CNN 140 | F 3 "~" H 3500 5100 50 0001 C CNN 141 | 1 3500 5100 142 | 1 0 0 -1 143 | $EndComp 144 | $Comp 145 | L Device:R R46 146 | U 1 1 5CBBBA75 147 | P 3650 4800 148 | F 0 "R46" H 3720 4846 50 0000 L CNN 149 | F 1 "49.9" H 3720 4755 50 0000 L CNN 150 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3580 4800 50 0001 C CNN 151 | F 3 "~" H 3650 4800 50 0001 C CNN 152 | 1 3650 4800 153 | 1 0 0 -1 154 | $EndComp 155 | $Comp 156 | L Device:R R47 157 | U 1 1 5CBBBAB1 158 | P 3800 5100 159 | F 0 "R47" H 3870 5146 50 0000 L CNN 160 | F 1 "49.9" H 3870 5055 50 0000 L CNN 161 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3730 5100 50 0001 C CNN 162 | F 3 "~" H 3800 5100 50 0001 C CNN 163 | 1 3800 5100 164 | 1 0 0 -1 165 | $EndComp 166 | $Comp 167 | L Device:R R49 168 | U 1 1 5CBBBAE7 169 | P 3950 4800 170 | F 0 "R49" H 4020 4846 50 0000 L CNN 171 | F 1 "49.9" H 4020 4755 50 0000 L CNN 172 | F 2 "Resistor_SMD:R_0805_2012Metric" V 3880 4800 50 0001 C CNN 173 | F 3 "~" H 3950 4800 50 0001 C CNN 174 | 1 3950 4800 175 | 1 0 0 -1 176 | $EndComp 177 | Wire Wire Line 178 | 2750 5250 3500 5250 179 | Connection ~ 3500 5250 180 | Wire Wire Line 181 | 3500 5250 3650 5250 182 | Connection ~ 3800 5250 183 | Wire Wire Line 184 | 3800 5250 3950 5250 185 | Wire Wire Line 186 | 5200 4550 5200 4750 187 | Wire Wire Line 188 | 5200 4750 5300 4750 189 | Connection ~ 5300 4750 190 | Wire Wire Line 191 | 5300 4750 5300 4550 192 | Wire Wire Line 193 | 3950 4950 3950 5250 194 | Connection ~ 3950 5250 195 | Wire Wire Line 196 | 3950 5250 4300 5250 197 | Wire Wire Line 198 | 3650 4950 3650 5250 199 | Connection ~ 3650 5250 200 | Wire Wire Line 201 | 3650 5250 3800 5250 202 | Wire Wire Line 203 | 3950 4650 3950 3450 204 | Wire Wire Line 205 | 3650 4650 3650 3650 206 | Wire Wire Line 207 | 3800 4950 3800 3750 208 | Wire Wire Line 209 | 750 2450 1650 2450 210 | $Comp 211 | L Device:R R43 212 | U 1 1 5CBC41B5 213 | P 2750 2450 214 | F 0 "R43" V 2543 2450 50 0000 C CNN 215 | F 1 "2.4k" V 2634 2450 50 0000 C CNN 216 | F 2 "Resistor_SMD:R_0805_2012Metric" V 2680 2450 50 0001 C CNN 217 | F 3 "~" H 2750 2450 50 0001 C CNN 218 | 1 2750 2450 219 | 0 1 1 0 220 | $EndComp 221 | $Comp 222 | L Device:R R50 223 | U 1 1 5CBC4D0A 224 | P 4300 5100 225 | F 0 "R50" H 4370 5146 50 0000 L CNN 226 | F 1 "2.4k" H 4370 5055 50 0000 L CNN 227 | F 2 "Resistor_SMD:R_0805_2012Metric" V 4230 5100 50 0001 C CNN 228 | F 3 "~" H 4300 5100 50 0001 C CNN 229 | 1 4300 5100 230 | 1 0 0 -1 231 | $EndComp 232 | Wire Wire Line 233 | 2550 3050 4600 3050 234 | Wire Wire Line 235 | 2550 2950 3200 2950 236 | Wire Wire Line 237 | 3200 2950 3200 2450 238 | Wire Wire Line 239 | 4600 2950 4100 2950 240 | Wire Wire Line 241 | 4100 2950 4100 3150 242 | Wire Wire Line 243 | 4100 3150 2550 3150 244 | Wire Wire Line 245 | 4300 4950 4300 3350 246 | Wire Wire Line 247 | 4300 3350 2550 3350 248 | Wire Wire Line 249 | 2550 3350 2550 3250 250 | Wire Wire Line 251 | 4600 3250 3900 3250 252 | Wire Wire Line 253 | 3900 3250 3900 2550 254 | $Comp 255 | L Device:C C39 256 | U 1 1 5CBCE451 257 | P 5800 4750 258 | F 0 "C39" V 5548 4750 50 0000 C CNN 259 | F 1 "100n" V 5639 4750 50 0000 C CNN 260 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5838 4600 50 0001 C CNN 261 | F 3 "~" H 5800 4750 50 0001 C CNN 262 | 1 5800 4750 263 | 0 1 1 0 264 | $EndComp 265 | $Comp 266 | L Device:C C40 267 | U 1 1 5CBD0082 268 | P 5800 4950 269 | F 0 "C40" V 5548 4950 50 0000 C CNN 270 | F 1 "2.2u" V 5639 4950 50 0000 C CNN 271 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5838 4800 50 0001 C CNN 272 | F 3 "~" H 5800 4950 50 0001 C CNN 273 | 1 5800 4950 274 | 0 1 1 0 275 | $EndComp 276 | $Comp 277 | L Device:C C41 278 | U 1 1 5CBD00BC 279 | P 5800 5350 280 | F 0 "C41" V 5548 5350 50 0000 C CNN 281 | F 1 "100n" V 5639 5350 50 0000 C CNN 282 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5838 5200 50 0001 C CNN 283 | F 3 "~" H 5800 5350 50 0001 C CNN 284 | 1 5800 5350 285 | 0 1 1 0 286 | $EndComp 287 | Connection ~ 3500 3950 288 | Connection ~ 3800 3750 289 | Connection ~ 3650 3650 290 | Connection ~ 3950 3450 291 | Connection ~ 2750 3850 292 | Wire Wire Line 293 | 3500 3950 4200 3950 294 | Wire Wire Line 295 | 2550 3950 3500 3950 296 | Wire Wire Line 297 | 3800 3750 4600 3750 298 | Wire Wire Line 299 | 2550 3750 3800 3750 300 | Wire Wire Line 301 | 3650 3650 4600 3650 302 | Wire Wire Line 303 | 2550 3650 3650 3650 304 | Wire Wire Line 305 | 3950 3450 4200 3450 306 | Wire Wire Line 307 | 2550 3450 3950 3450 308 | Wire Wire Line 309 | 5300 5550 5200 5550 310 | Wire Wire Line 311 | 4300 5550 4300 5250 312 | Wire Wire Line 313 | 5300 4750 5300 4950 314 | Connection ~ 4300 5250 315 | $Comp 316 | L Device:C C36 317 | U 1 1 5CBD2ED9 318 | P 5050 4750 319 | F 0 "C36" V 4798 4750 50 0000 C CNN 320 | F 1 "100n" V 4889 4750 50 0000 C CNN 321 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5088 4600 50 0001 C CNN 322 | F 3 "~" H 5050 4750 50 0001 C CNN 323 | 1 5050 4750 324 | 0 1 1 0 325 | $EndComp 326 | Connection ~ 5200 4750 327 | $Comp 328 | L Device:C C37 329 | U 1 1 5CBD2F37 330 | P 5150 4950 331 | F 0 "C37" V 4898 4950 50 0000 C CNN 332 | F 1 "22u" V 4989 4950 50 0000 C CNN 333 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5188 4800 50 0001 C CNN 334 | F 3 "~" H 5150 4950 50 0001 C CNN 335 | 1 5150 4950 336 | 0 1 1 0 337 | $EndComp 338 | Connection ~ 5300 4950 339 | Wire Wire Line 340 | 5300 4950 5300 5350 341 | $Comp 342 | L Device:C C38 343 | U 1 1 5CBD2F95 344 | P 5150 5350 345 | F 0 "C38" V 4898 5350 50 0000 C CNN 346 | F 1 "100n" V 4989 5350 50 0000 C CNN 347 | F 2 "Capacitor_SMD:C_0805_2012Metric" H 5188 5200 50 0001 C CNN 348 | F 3 "~" H 5150 5350 50 0001 C CNN 349 | 1 5150 5350 350 | 0 1 1 0 351 | $EndComp 352 | Connection ~ 5300 5350 353 | Wire Wire Line 354 | 5300 5350 5300 5550 355 | $Comp 356 | L power:GND #PWR054 357 | U 1 1 5CBD2FE3 358 | P 4900 4950 359 | F 0 "#PWR054" H 4900 4700 50 0001 C CNN 360 | F 1 "GND" H 4905 4777 50 0000 C CNN 361 | F 2 "" H 4900 4950 50 0001 C CNN 362 | F 3 "" H 4900 4950 50 0001 C CNN 363 | 1 4900 4950 364 | 1 0 0 -1 365 | $EndComp 366 | $Comp 367 | L power:GND #PWR055 368 | U 1 1 5CBD3016 369 | P 6050 4950 370 | F 0 "#PWR055" H 6050 4700 50 0001 C CNN 371 | F 1 "GND" H 6055 4777 50 0000 C CNN 372 | F 2 "" H 6050 4950 50 0001 C CNN 373 | F 3 "" H 6050 4950 50 0001 C CNN 374 | 1 6050 4950 375 | 1 0 0 -1 376 | $EndComp 377 | Wire Wire Line 378 | 4900 4750 4900 4950 379 | Wire Wire Line 380 | 5000 4950 4900 4950 381 | Connection ~ 4900 4950 382 | Wire Wire Line 383 | 5000 4950 5000 5350 384 | Connection ~ 5000 4950 385 | Wire Wire Line 386 | 5950 5350 5950 4950 387 | Wire Wire Line 388 | 5950 4950 6050 4950 389 | Connection ~ 5950 4950 390 | Wire Wire Line 391 | 5500 5900 10650 5900 392 | Wire Wire Line 393 | 5200 5900 5200 5550 394 | Connection ~ 5200 5550 395 | Wire Wire Line 396 | 5200 5550 4300 5550 397 | $Comp 398 | L Device:Ferrite_Bead FB1 399 | U 1 1 5CBDDBE5 400 | P 5350 5900 401 | F 0 "FB1" V 5076 5900 50 0000 C CNN 402 | F 1 "600R/2A" V 5167 5900 50 0000 C CNN 403 | F 2 "Inductor_SMD:L_0805_2012Metric" V 5280 5900 50 0001 C CNN 404 | F 3 "~" H 5350 5900 50 0001 C CNN 405 | 1 5350 5900 406 | 0 1 1 0 407 | $EndComp 408 | Text HLabel 10050 2650 2 50 BiDi ~ 0 409 | EMAC_CLK_OUT_180:GPIO17 410 | Text HLabel 10050 3950 2 50 BiDi ~ 0 411 | EMAC_TXD0:GPIO19 412 | Text HLabel 10050 3850 2 50 BiDi ~ 0 413 | EMAC_TXD1:GPIO22 414 | Text HLabel 10050 3750 2 50 BiDi ~ 0 415 | EMAC_TX_EN:GPIO21 416 | Text HLabel 10650 5900 2 50 BiDi ~ 0 417 | +3V3 418 | Text HLabel 10050 2950 2 50 BiDi ~ 0 419 | PHY_RST: 420 | NoConn ~ 6100 2550 421 | NoConn ~ 6100 2850 422 | Text HLabel 10050 3150 2 50 BiDi ~ 0 423 | MDC:GPIO23 424 | Text HLabel 10100 1100 2 50 BiDi ~ 0 425 | GND 426 | $Comp 427 | L power:GND #PWR052 428 | U 1 1 5CC058D1 429 | P 700 1100 430 | F 0 "#PWR052" H 700 850 50 0001 C CNN 431 | F 1 "GND" H 705 927 50 0000 C CNN 432 | F 2 "" H 700 1100 50 0001 C CNN 433 | F 3 "" H 700 1100 50 0001 C CNN 434 | 1 700 1100 435 | 1 0 0 -1 436 | $EndComp 437 | Wire Wire Line 438 | 700 1100 2450 1100 439 | Text Label 5200 5550 2 50 ~ 0 440 | +3V3LAN 441 | Wire Wire Line 442 | 6100 2650 10050 2650 443 | Wire Wire Line 444 | 6100 2950 10050 2950 445 | Wire Wire Line 446 | 10050 3150 6100 3150 447 | Wire Wire Line 448 | 10050 3750 6100 3750 449 | Wire Wire Line 450 | 10050 3850 6100 3850 451 | Wire Wire Line 452 | 6100 3950 10050 3950 453 | Connection ~ 5500 5900 454 | Wire Wire Line 455 | 5950 4750 5950 4950 456 | Wire Wire Line 457 | 5500 4550 5500 5350 458 | Wire Wire Line 459 | 5400 4550 5400 4750 460 | Wire Wire Line 461 | 5400 4750 5650 4750 462 | Wire Wire Line 463 | 5650 4950 5400 4950 464 | Wire Wire Line 465 | 5400 4950 5400 4750 466 | Connection ~ 5400 4750 467 | Wire Wire Line 468 | 5650 5350 5500 5350 469 | Connection ~ 5500 5350 470 | Wire Wire Line 471 | 5500 5350 5500 5900 472 | Wire Wire Line 473 | 3900 2250 4700 2250 474 | Wire Wire Line 475 | 4700 2250 4700 1100 476 | Connection ~ 4700 2250 477 | Wire Wire Line 478 | 4700 2250 5300 2250 479 | Connection ~ 4700 1100 480 | Wire Wire Line 481 | 4700 1100 6750 1100 482 | Wire Wire Line 483 | 2300 2450 2450 2450 484 | Wire Wire Line 485 | 2450 2450 2450 1100 486 | Connection ~ 2450 2450 487 | Wire Wire Line 488 | 2450 2450 2600 2450 489 | Connection ~ 2450 1100 490 | Wire Wire Line 491 | 2450 1100 4700 1100 492 | Wire Wire Line 493 | 6100 3650 6500 3650 494 | Wire Wire Line 495 | 6100 3550 6950 3550 496 | Wire Wire Line 497 | 6100 3350 7400 3350 498 | Text HLabel 10050 3350 2 50 BiDi ~ 0 499 | EMAC_RX_CRS_DV:GPIO27 500 | Text HLabel 10050 3650 2 50 BiDi ~ 0 501 | EMAC_RXD0:GPIO25 502 | Text HLabel 10050 3550 2 50 BiDi ~ 0 503 | EMAC_RXD1:GPIO26 504 | Text Label 10150 5450 0 50 ~ 0 505 | +3V3LAN 506 | Wire Wire Line 507 | 10150 5450 7400 5450 508 | $Comp 509 | L Device:R R51 510 | U 1 1 5CC2CDF4 511 | P 6500 5300 512 | F 0 "R51" H 6570 5346 50 0000 L CNN 513 | F 1 "2.4k" H 6570 5255 50 0000 L CNN 514 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6430 5300 50 0001 C CNN 515 | F 3 "~" H 6500 5300 50 0001 C CNN 516 | 1 6500 5300 517 | 1 0 0 -1 518 | $EndComp 519 | $Comp 520 | L Device:R R52 521 | U 1 1 5CC2CEBC 522 | P 6950 5300 523 | F 0 "R52" H 7020 5346 50 0000 L CNN 524 | F 1 "2.4k" H 7020 5255 50 0000 L CNN 525 | F 2 "Resistor_SMD:R_0805_2012Metric" V 6880 5300 50 0001 C CNN 526 | F 3 "~" H 6950 5300 50 0001 C CNN 527 | 1 6950 5300 528 | 1 0 0 -1 529 | $EndComp 530 | Connection ~ 6950 5450 531 | Wire Wire Line 532 | 6950 5450 6500 5450 533 | $Comp 534 | L Device:R R53 535 | U 1 1 5CC2CF0E 536 | P 7400 5300 537 | F 0 "R53" H 7470 5346 50 0000 L CNN 538 | F 1 "2.4k" H 7470 5255 50 0000 L CNN 539 | F 2 "Resistor_SMD:R_0805_2012Metric" V 7330 5300 50 0001 C CNN 540 | F 3 "~" H 7400 5300 50 0001 C CNN 541 | 1 7400 5300 542 | 1 0 0 -1 543 | $EndComp 544 | Connection ~ 7400 5450 545 | Wire Wire Line 546 | 7400 5450 6950 5450 547 | Wire Wire Line 548 | 6500 5150 6500 3650 549 | Connection ~ 6500 3650 550 | Wire Wire Line 551 | 6500 3650 10050 3650 552 | Wire Wire Line 553 | 6950 5150 6950 3550 554 | Connection ~ 6950 3550 555 | Wire Wire Line 556 | 6950 3550 10050 3550 557 | Wire Wire Line 558 | 7400 5150 7400 3350 559 | Connection ~ 7400 3350 560 | Wire Wire Line 561 | 7400 3350 10050 3350 562 | Wire Wire Line 563 | 2900 2450 3200 2450 564 | Wire Wire Line 565 | 6100 3450 6750 3450 566 | Wire Wire Line 567 | 6750 3450 6750 1100 568 | Connection ~ 6750 1100 569 | Wire Wire Line 570 | 6750 1100 10100 1100 571 | Wire Wire Line 572 | 3500 3950 3500 4950 573 | Text Label 2550 3450 0 50 ~ 0 574 | RD- 575 | Text Label 2550 3650 0 50 ~ 0 576 | RD+ 577 | Text Label 2550 3750 0 50 ~ 0 578 | TD- 579 | Text HLabel 10050 3250 2 50 BiDi ~ 0 580 | MDIO 581 | Wire Wire Line 582 | 10050 3250 6100 3250 583 | $EndSCHEMATC 584 | -------------------------------------------------------------------------------- /pcb/bom/mainPCB-all.pos: -------------------------------------------------------------------------------- 1 | ### Module positions - created on So 25 Aug 2019 16:20:08 CEST ### 2 | ### Printed by Pcbnew version kicad 5.0.2-bee76a0~70~ubuntu18.04.1 3 | ## Unit = mm, Angle = deg. 4 | ## Side : top 5 | # Ref Val Package PosX PosY Rot Side 6 | C1 100n C_0805_2012Metric 125.6843 60.3682 180.0000 top 7 | C2 100n C_0805_2012Metric 56.8018 16.1087 0.0000 top 8 | C3 100n C_0805_2012Metric 93.0453 2.4412 270.0000 top 9 | C4 100n C_0805_2012Metric 88.4733 2.3927 270.0000 top 10 | C5 22u C_0805_2012Metric 90.7593 2.3927 270.0000 top 11 | C6 560u CP_Elec_10x10.5 26.6243 8.7337 90.0000 top 12 | C7 10u C_0805_2012Metric 41.1023 15.9817 0.0000 top 13 | C8 100n C_0805_2012Metric 41.6588 31.3487 0.0000 top 14 | C9 22u C_0805_2012Metric 46.1038 15.9817 180.0000 top 15 | C10 10u C_0805_2012Metric 64.5338 33.0482 270.0000 top 16 | C11 22u C_0805_2012Metric 64.5338 36.6677 90.0000 top 17 | C12 100n C_0805_2012Metric 16.2103 54.7652 90.0000 top 18 | C13 560u CP_Elec_10x10.5 26.6243 51.4147 270.0000 top 19 | C14 1n C_0805_2012Metric 124.0833 36.3386 0.0000 top 20 | C15 1n C_0805_2012Metric 120.0328 36.3017 180.0000 top 21 | C16 1n C_0805_2012Metric 131.9073 60.7342 90.0000 top 22 | C17 1n C_0805_2012Metric 137.5588 60.7342 90.0000 top 23 | C18 1n C_0805_2012Metric 143.0198 60.7492 90.0000 top 24 | C19 100n C_0805_2012Metric 119.7673 59.0001 90.0000 top 25 | C20 22u C_0805_2012Metric 117.4928 58.9862 90.0000 top 26 | C21 100n C_0805_2012Metric 16.4643 37.3177 90.0000 top 27 | C22 560u CP_Elec_10x10.5 26.6243 37.4447 90.0000 top 28 | C23 1n C_0805_2012Metric 116.3068 28.4947 0.0000 top 29 | C24 1n C_0805_2012Metric 113.0221 36.4795 180.0000 top 30 | C25 22u C_0805_2012Metric 112.7938 59.0197 270.0000 top 31 | C26 100n C_0805_2012Metric 110.6348 59.0197 270.0000 top 32 | C27 100n C_0805_2012Metric 105.5245 62.8853 180.0000 top 33 | C28 100n C_0805_2012Metric 152.4635 54.2646 0.0000 top 34 | C29 100n C_0805_2012Metric 142.3213 50.2082 180.0000 top 35 | C30 100n C_0805_2012Metric 142.3363 48.1127 180.0000 top 36 | C31 2.2u C_0805_2012Metric 142.3063 45.9537 180.0000 top 37 | C32 100n C_0805_2012Metric 16.4643 19.9672 90.0000 top 38 | C33 560u CP_Elec_10x10.5 26.6243 23.0937 270.0000 top 39 | C34 1n/2000V C_1206_3216Metric 74.2493 58.9107 90.0000 top 40 | C35 100n/16V C_0805_2012Metric 97.3036 52.0817 0.0000 top 41 | C36 100n C_0805_2012Metric 80.3453 41.8897 180.0000 top 42 | C37 22u C_0805_2012Metric 92.2048 43.2867 0.0000 top 43 | C38 100n C_0805_2012Metric 92.2048 41.1277 0.0000 top 44 | C39 100n C_0805_2012Metric 80.4238 38.4607 0.0000 top 45 | C40 2.2u C_0805_2012Metric 80.4238 36.3017 0.0000 top 46 | C41 100n C_0805_2012Metric 86.2023 35.9842 180.0000 top 47 | C42 100n C_0805_2012Metric 133.6853 18.1892 270.0000 top 48 | C43 100n C_0805_2012Metric 135.9228 21.1252 0.0000 top 49 | C44 100n C_0805_2012Metric 139.4488 21.1252 0.0000 top 50 | C45 100n C_0805_2012Metric 141.9403 18.1892 90.0000 top 51 | C46 100n C_0805_2012Metric 140.3373 9.8552 0.0000 top 52 | C47 10n C_0805_2012Metric 134.9885 24.6075 180.0000 top 53 | C48 100n C_0805_2012Metric 135.0035 26.8300 180.0000 top 54 | C49 100n C_0805_2012Metric 131.7650 30.5615 270.0000 top 55 | C50 10u C_0805_2012Metric 136.0195 30.5958 270.0000 top 56 | C51 100n C_0805_2012Metric 133.8605 30.5791 270.0000 top 57 | D2 LED/blue C_0805_2012Metric 58.4505 3.8151 90.0000 top 58 | D5 LED/red C_0805_2012Metric 46.3578 62.0827 0.0000 top 59 | D7 SD0805S020S1R0 D_0805_2012Metric 50.1978 55.2247 180.0000 top 60 | D8 SD0805S020S1R0 D_0805_2012Metric 36.3248 15.8547 180.0000 top 61 | D9 LED/green C_0805_2012Metric 61.7906 3.8382 90.0000 top 62 | D10 BAT54C SOT-23 131.7422 36.8605 0.0000 top 63 | D11 SD0805S020S1R0 D_0805_2012Metric 148.1300 60.1066 0.0000 top 64 | F1 12A/slow Fuse_1206_3216Metric 35.6383 57.3837 180.0000 top 65 | FB1 600R/2A L_0805_2012Metric 92.1563 38.9687 180.0000 top 66 | IC1 FXL6408UMX QFN40P180X260X55-16N 56.0883 12.6797 0.0000 top 67 | IC2 ATA6561-GAQW-N SOIC127P600X175-8N 105.6183 59.0982 180.0000 top 68 | IC3 ICL3221EIVZ SOP65P640X120-16N 137.8128 15.5372 270.0000 top 69 | J13 SM04B-SRSS-TB(LF)(SN) JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal 108.9838 3.7897 0.0000 top 70 | J14 USB_B_Micro USB_Micro-B_Molex-105017-0001 156.9085 56.8046 90.0000 top 71 | J17 SM04B-SRSS-TB(LF)(SN) JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal 139.0193 3.7262 0.0000 top 72 | K1 CP1SA-12V-Z CP1SA12VZ 41.4833 44.2527 90.0000 top 73 | K2 CP1SA-12V-Z CP1SA12VZ 64.5973 49.0017 180.0000 top 74 | PS1 V78E05-1000-SMT-TR SOP254P1140X825-10N 42.4993 23.9827 90.0000 top 75 | Q1 BC817-40,215 SOT95P230X110-3N 136.9873 41.9049 270.0000 top 76 | Q2 BC817-40,215 SOT95P230X110-3N 131.5898 41.9049 270.0000 top 77 | R1 120 R_0805_2012Metric 125.6993 58.2727 180.0000 top 78 | R2 24 R_0805_2012Metric 115.2144 58.9788 90.0000 top 79 | R3 620 R_0805_2012Metric 58.4505 7.4496 90.0000 top 80 | R6 47k R_0805_2012Metric 60.4063 13.3632 270.0000 top 81 | R7 1k R_0805_2012Metric 40.5943 2.1387 0.0000 top 82 | R8 1k R_0805_2012Metric 40.5458 4.2977 0.0000 top 83 | R9 1k R_0805_2012Metric 40.5712 10.8255 0.0000 top 84 | R10 47k R_0805_2012Metric 95.3313 2.4412 90.0000 top 85 | R11 1k R_0805_2012Metric 40.5712 6.4567 0.0000 top 86 | R12 1k R_0805_2012Metric 40.5712 8.6157 0.0000 top 87 | R13 1k R_0805_2012Metric 40.5712 12.9845 0.0000 top 88 | R14 2.4k R_0805_2012Metric 50.6273 58.7807 180.0000 top 89 | R15 24 R_0805_2012Metric 46.2083 55.2970 180.0000 top 90 | R16 24 R_0805_2012Metric 46.2628 58.7400 180.0000 top 91 | R17 620 R_0805_2012Metric 61.7906 7.5847 270.0000 top 92 | R18 47k R_0805_2012Metric 124.0968 40.8102 0.0000 top 93 | R19 12.1k R_0805_2012Metric 124.0833 38.5476 0.0000 top 94 | R20 47k R_0805_2012Metric 120.0478 40.8102 180.0000 top 95 | R21 12.1k R_0805_2012Metric 120.0478 38.5242 180.0000 top 96 | R22 47k R_0805_2012Metric 134.1933 60.7492 90.0000 top 97 | R23 47k R_0805_2012Metric 139.7813 60.7642 90.0000 top 98 | R24 47k R_0805_2012Metric 145.2423 60.7642 90.0000 top 99 | R25 120 R_0805_2012Metric 122.3188 58.9862 270.0000 top 100 | R26 2.4k R_0805_2012Metric 121.5568 18.1407 180.0000 top 101 | R27 2.4k R_0805_2012Metric 121.6203 20.4267 180.0000 top 102 | R28 220k R_0805_2012Metric 116.3013 30.7772 180.0000 top 103 | R29 2.4k R_0805_2012Metric 105.2223 20.4267 0.0000 top 104 | R30 2.4k R_0805_2012Metric 105.2373 18.3947 0.0000 top 105 | R31 47k R_0805_2012Metric 113.0328 40.9372 180.0000 top 106 | R32 12.1k R_0805_2012Metric 113.0328 38.7147 180.0000 top 107 | R33 120 R_0805_2012Metric 102.2733 54.7472 180.0000 top 108 | R34 22.1k R_0805_2012Metric 148.2875 54.2646 0.0000 top 109 | R35 47k R_0805_2012Metric 148.2575 56.4236 180.0000 top 110 | R36 1k R_0805_2012Metric 143.0198 53.3047 90.0000 top 111 | R37 1k R_0805_2012Metric 134.3688 48.5089 180.0000 top 112 | R38 120 R_0805_2012Metric 125.8113 52.5727 90.0000 top 113 | R39 120 R_0805_2012Metric 123.5253 52.5727 90.0000 top 114 | R40 1k R_0805_2012Metric 134.3203 46.1594 0.0000 top 115 | R41 120 R_0805_2012Metric 136.2022 36.8605 0.0000 top 116 | R42 0 R_0805_2012Metric 74.2493 54.4142 90.0000 top 117 | R43 2.4k R_0805_2012Metric 74.2493 63.8457 270.0000 top 118 | R44 0 R_0805_2012Metric 97.3521 48.9067 180.0000 top 119 | R45 49.9 R_0805_2012Metric 90.4268 48.8747 0.0000 top 120 | R46 49.9 R_0805_2012Metric 80.3453 46.3347 180.0000 top 121 | R47 49.9 R_0805_2012Metric 90.3783 45.5727 0.0000 top 122 | R48 12.1k R_0805_2012Metric 80.2668 44.1757 0.0000 top 123 | R49 49.9 R_0805_2012Metric 80.2968 49.5097 180.0000 top 124 | R50 2.4k R_0805_2012Metric 96.0018 62.1007 270.0000 top 125 | R51 2.4k R_0805_2012Metric 93.5533 33.9522 0.0000 top 126 | R52 2.4k R_0805_2012Metric 93.6018 31.7297 0.0000 top 127 | R53 2.4k R_0805_2012Metric 93.5533 36.1112 0.0000 top 128 | R54 24 R_0805_2012Metric 138.1150 30.6250 270.0000 top 129 | REF*1 Fiducial Fiducial_1mm_Dia_2mm_Outer 2.2352 70.8660 0.0000 top 130 | REF*2 Fiducial Fiducial_1mm_Dia_2mm_Outer 157.6324 70.9168 0.0000 top 131 | REF*3 Fiducial Fiducial_1mm_Dia_2mm_Outer 1.7272 1.8796 0.0000 top 132 | REF*4 Fiducial Fiducial_1mm_Dia_2mm_Outer 157.9372 1.9304 0.0000 top 133 | SW1 SW_Push SW_SPST_PTS645 56.2712 25.2400 180.0000 top 134 | U1 ESP32-WROOM-32 ESP32-WROOM-32 77.1703 9.3777 180.0000 top 135 | U2 AZ1117-3.3 SOT-223-3_TabPin2 70.2160 34.9941 0.0000 top 136 | U3 VNH7070AS SOIC-16_3.9x9.9mm_P1.27mm 10.8763 53.8277 0.0000 top 137 | U4 ADS1115IDGS MSOP-10_3x3mm_P0.5mm 115.3338 50.6527 90.0000 top 138 | U5 VNH7070AS SOIC-16_3.9x9.9mm_P1.27mm 11.0033 36.6827 0.0000 top 139 | U6 PCA9306DCTR SSOP-8_2.95x2.8mm_P0.65mm 111.3188 27.3072 0.0000 top 140 | U7 TPD3E001DRLR SOT-553 151.8920 56.6776 270.0000 top 141 | U8 CP2102N-A01-GQFN24 QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm 139.0828 54.0182 90.0000 top 142 | U9 VNH7070AS SOIC-16_3.9x9.9mm_P1.27mm 11.0033 19.4107 0.0000 top 143 | U10 NUD3124LT1G SOT95P237X100-3N 54.8183 40.3657 0.0000 top 144 | U11 LAN8720A QFN-24-1EP_4x4mm_P0.5mm_EP2.6x2.6mm 85.3133 39.8727 0.0000 top 145 | U12 LSM9DS1 LGA-24L_3x3.5mm_P0.43mm 131.1935 25.6870 270.0000 top 146 | ## End 147 | --------------------------------------------------------------------------------