working simple temp control - WIP

This commit is contained in:
Marcus 2023-08-06 19:35:21 +02:00
parent 65465c37b7
commit 50cd264db3
16 changed files with 1920 additions and 68 deletions

View file

@ -0,0 +1,2 @@
(kicad_pcb (version 20221018) (generator pcbnew)
)

View file

@ -0,0 +1,77 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "arduino-fridge-powercontrol.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}

View file

@ -0,0 +1,332 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"other_line_width": 0.15,
"silk_line_width": 0.15,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15
},
"diff_pair_dimensions": [],
"drc_exclusions": [],
"rules": {
"min_copper_edge_clearance": 0.0,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0
},
"track_widths": [],
"via_dimensions": []
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "arduino-fridge-powercontrol.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "",
"page_layout_descr_file": "",
"plot_directory": "",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"634a97e3-ab17-488c-8786-a456affdc40d",
""
]
],
"text_variables": {}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,169 @@
144800
Connector
Banana_Cliff_FCR7350x_S16N-PC_Horizontal
Cliff single 4mm shrouded banana panel socket, through-hole, horizontal, https://www.cliffuk.co.uk/products/testleads/sockets/S16NPC.pdf
cliff 4mm socket jack banana
0
1
1
Connector
Banana_Jack_1Pin
Single banana socket, footprint - 6mm drill
banana socket
0
1
1
Connector
Banana_Jack_2Pin
Dual banana socket, footprint - 2 x 6mm drills
banana socket
0
2
2
Connector
Banana_Jack_3Pin
Triple banana socket, footprint - 3 x 6mm drills
banana socket
0
3
3
Connector
CUI_PD-30
3 pin connector, PD-30, http://www.cui.com/product/resource/pd-30.pdf
connector 3-pin PD-30 power DIN
0
4
4
Connector
CUI_PD-30S
3-pin nonstandard DIN connector, shielded, PD-30S, http://www.cui.com/product/resource/pd-30s.pdf
connector 3-pin PD-30S power DIN shielded
0
8
5
Connector
CUI_PD-30S_CircularHoles
3-pin nonstandard DIN connector, shielded, PD-30S, http://www.cui.com/product/resource/pd-30s.pdf
connector 3-pin PD-30S power DIN shielded
0
8
5
Connector
CalTest_CT3151
Right-angle standard banana jack, http://www.caltestelectronics.com/images/attachments/P315100rH_drawing.pdf
banana jack horizontal
0
4
1
Connector
Connector_SFP_and_Cage
https://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=2227302&DocType=Customer+Drawing&DocLang=English
SFP+ SFP
0
40
21
Connector
DTF13-12Px
http://www.te.com/usa-en/product-DTF13-12PA-G003.html
DEUTSCH DT header 12 pin
0
12
12
Connector
FanPinHeader_1x03_P2.54mm_Vertical
3-pin CPU fan Through hole pin header, see http://www.formfactors.org/developer%5Cspecs%5Crev1_2_public.pdf
pin header 3-pin CPU fan
0
3
3
Connector
FanPinHeader_1x04_P2.54mm_Vertical
4-pin CPU fan Through hole pin header, e.g. for Wieson part number 2366C888-007 Molex 47053-1000, Foxconn HF27040-M1, Tyco 1470947-1 or equivalent, see http://www.formfactors.org/developer%5Cspecs%5Crev1_2_public.pdf
pin header 4-pin CPU fan
0
4
4
Connector
GB042-34S-H10
http://www.lsmtron.com/pdf/Connector&Antenna_catalog.PDF
34pin SMD connector
0
34
34
Connector
IHI_B6A-PCB-45_Vertical
https://lugsdirect.com/PDF_Webprint/B6A-PCB-45-XX(-X).pdf
connector IHI B6A-PCB-45
0
49
1
Connector
JWT_A3963_1x02_P3.96mm_Vertical
JWT A3963, 3.96mm pitch Pin head connector (http://www.jwt.com.tw/pro_pdf/A3963.pdf)
connector JWT A3963 pinhead
0
2
2
Connector
Joint-Tech_C5080WR-04P_1x04_P5.08mm_Vertical
C5080 SERIES 90° Wafer, (https://datasheet.lcsc.com/lcsc/1912261836_HR-Joint-Tech-Elec-C5080WR-04P_C477015.pdf)
connector side-entry ATA PATA IDE 5.25 inch floppy drive power
0
6
5
Connector
NS-Tech_Grove_1x04_P2mm_Vertical
https://statics3.seeedstudio.com/images/opl/datasheet/3470130P1.pdf
Grove-1x04
0
4
4
Connector
SpringContact_Harwin_S1941-46R
7.25mm SMT Multi-directional Spring Contact (T+R), https://cdn.harwin.com/pdfs/S1941R.pdf
spring contact emi emc shield
0
1
1
Connector
Tag-Connect_TC2030-IDC-FP_2x03_P1.27mm_Vertical
Tag-Connect programming header; http://www.tag-connect.com/Materials/TC2030-IDC.pdf
tag connect programming header pogo pins
0
6
6
Connector
Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_Vertical
Tag-Connect programming header; http://www.tag-connect.com/Materials/TC2030-IDC-NL.pdf
tag connect programming header pogo pins
0
6
6
Connector
Tag-Connect_TC2050-IDC-FP_2x05_P1.27mm_Vertical
Tag-Connect programming header; http://www.tag-connect.com/Materials/TC2050-IDC-430%20Datasheet.pdf
tag connect programming header pogo pins
0
10
10
Connector
Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical
Tag-Connect programming header; http://www.tag-connect.com/Materials/TC2050-IDC-NL%20Datasheet.pdf
tag connect programming header pogo pins
0
10
10
Connector
Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical_with_bottom_clip
Tag-Connect programming header with bottom courtyard for TC2050-NL Clip board ; https://www.tag-connect.com/wp-content/uploads/bsk-pdf-manager/TC2050-IDC-NL_Datasheet_8.pdf https://www.tag-connect.com/wp-content/uploads/bsk-pdf-manager/TC2050-CLIP_Datasheet_25.pdf
tag connect programming header pogo pins
0
10
10
Connector
Tag-Connect_TC2070-IDC-FP_2x07_P1.27mm_Vertical
Tag-Connect programming header; http://www.tag-connect.com/Materials/TC2070-IDC%20Datasheet.pdf
tag connect programming header pogo pins
0
14
14

View file

@ -0,0 +1 @@
{"hostname":"B550","username":"marcus"}

View file

@ -1,87 +1,75 @@
#include "ArduinoJson.h"
int analogPin = 3;
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is conntec to the Arduino digital pin 4
#define ONE_WIRE_BUS 2
#define MOSFET 3
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
int analogPin = 2;
int data = 0;
char userInput;
char* commandVer;
float tempSensor1;
float tempSensor2;
float HTemp1 = 12.0;
float HTemp2;
float LTemp1 = 10.0;
float LTemp2;
// countLowTemp
int cLTemp1 = 0;
int cLTemp2 = 0;
// countHighTemp
int cHTemp1 = 0;
int cHTemp2 = 0;
// loops to count temp before switching state
int cTemp = 5;
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
pinMode(MOSFET, OUTPUT);
Serial.begin(9600);
sensors.begin();
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()>0) {
//if(Serial.available()>0) {
//userInput = Serial.read();
sensors.requestTemperatures();
Serial.print("Sens 1 ");
Serial.print("Celsius temperature: ");
// Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
Serial.print(sensors.getTempCByIndex(0));
Serial.print(" - Fahrenheit temperature: ");
Serial.println(sensors.getTempFByIndex(0));
// String input;
//{ "command": "switch", "arg": "one", "state": "off", "ver":"1690931931"}
StaticJsonDocument<96> jsonin;
DeserializationError error = deserializeJson(jsonin, Serial);
if (error) {
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.f_str());
return;
}
const char* command = jsonin["command"]; // "switch"
const char* arg = jsonin["arg"]; // "one"
const char* state = jsonin["state"]; // "off"
const char* ver = jsonin["ver"]; // "1690931931"
StaticJsonDocument<96> jsonout;
jsonout["command"] = "lol";
jsonout["arg"] = "rofl";
jsonout["state"] = "on";
jsonout["ver"] = "1690931337";
serializeJson(jsonout, Serial);
/*
Serial.print(command);
Serial.print(" - ");
Serial.print(arg);
Serial.print(" - ");
Serial.print(state);
Serial.print(" - ");
Serial.println(ver);
if(userInput == 'g') {
data = analogRead(analogPin);
*/
/*
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(200);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(200);
//delay(2000);
Serial.println(data);
*/
//}
tempSensor1 = sensors.getTempCByIndex(0);
if(tempSensor1 > HTemp1) {
digitalWrite(MOSFET, HIGH);
} else if(tempSensor1 < LTemp1) {
digitalWrite(MOSFET, LOW);
}
/*
digitalWrite(MOSFET, HIGH);
delay(2000);
digitalWrite(MOSFET, LOW);
delay(2000);
*/
delay(1000);
// }
}