1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-28 17:49:53 +02:00

Added ESP32 camera.

This commit is contained in:
Chris Palmer
2023-05-01 12:18:12 +01:00
parent fbd8d8c7cd
commit 5e24a32a0b
7 changed files with 93 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 KiB

After

Width:  |  Height:  |  Size: 972 KiB

View File

@@ -711,6 +711,7 @@ PCB cameras.
### Vitamins
| Qty | Module call | BOM entry |
| ---:|:--- |:---|
| 1 | `camera(ESP32_CAM)` | ESP32-CAM Camera module |
| 1 | `camera(rpi_camera_v1)` | Raspberry Pi camera V1 |
| 1 | `camera(rpi_camera_v2)` | Raspberry Pi camera V2 |
| 1 | `camera(rpi_camera)` | Raspberry Pi focusable camera |
@@ -2534,7 +2535,7 @@ PCBs and perfboard with optional components. The shape can be a rectangle with o
| 1 | `smd_capacitor(CAP0603)` | SMD capacitor 0603 10nF |
| 1 | `smd_capacitor(CAP0805)` | SMD capacitor 0805 100nF |
| 1 | `smd_capacitor(CAP1206)` | SMD capacitor 1206 1uF |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax type: U_FL_R_SMT_1 |
| 1 | `smd_coax(U_FL_R_SMT_1)` | SMD coax connector type: U_FL_R_SMT_1 |
| 1 | `smd_resistor(RES0402, 1)` | SMD resistor 0402 1 0.0625W |
| 1 | `smd_resistor(RES0502, 10)` | SMD resistor 0502 10 0.05W |
| 1 | `smd_resistor(RES0603, 100)` | SMD resistor 0603 100 0.1W |

View File

@@ -26,7 +26,8 @@ include <../vitamins/cameras.scad>
use <../vitamins/pcb.scad>
module camera_housings()
layout([for(c = cameras) pcb_length(camera_pcb(c))], 15, false) let(c = cameras[$i])
layout([for(c = cameras) pcb_length(camera_pcb(c))], 10, false) let(c = cameras[$i])
if(pcb_screw(camera_pcb(c)))
camera_fastened_assembly(c, 3);
if($preview)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -91,7 +91,7 @@ module camera(type, show_lens = true, fov_distance = 0, fov = undef) {
color("orange")
hull() {
translate_z(flex.y /2)
translate(camera_lens_offset(type) + [0, camera_lens(type)[0][0].y / 2])
translate(camera_lens_offset(type) + [0, sign(pos.y) * camera_lens(type)[0][0].y / 2, 0])
cube([flex.x, eps, flex.y], center = true);
translate_z(conn.z - flex.y)

View File

@@ -70,6 +70,92 @@ rpi_camera = ["rpi_camera", "Raspberry Pi focusable camera", rpi_camera_pcb, [0,
[0, 18 - 1.5 - 2.5], [8, 5, 1.6]
];
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera];
esp32_cam_x = 1; // Seems to vary as mine is offset but pictures on the web show it more centered.
ESP32_module = ["", "", 18, 26, 0.8, 0, 0.7, [1.1, 1.1, 0, gold], grey(18), false, [
for(x = [0,1], y = [0:13]) [x * 18, y * 1.27 + 1.4], // Hole positions on the edge
for(x = [0:9]) [18 / 2 + (x - 4.5) * 1.27, 0],
],
[
[18 / 2, 9.7 - 3.4 / 2 , 0, "block", 15.75, 17.6 - 3.4, 2.2, silver, false, 0.3, 0.3], // can
[18 / 2 - 2.65, 9.7 , 0, "block", 10.4, 17.6, 2.2, silver, false, 0.3, 0.3], // can
[12.7, -6.5, 45, "smd_res", RES0502],
[15.15, -8.3, -90, "smd_coax", U_FL_R_SMT_1],
// Antenna
let(x = [0.9, 3.2, 5.7, 8.1, 10.6, 12.8, 15, 15.2])
each [
for(i = [0, 5,6,7]) [x[i], -2.8, 0, "block", 0.6, 4.8, 0.2, gold], // long verticals
for(i = [1: 4]) [x[i], -2.05, 0, "block", 0.6, 3.3, 0.2, gold], // short verticals
for(i = [0, 2, 4,5])[(x[i] + x[i + 1]) / 2, -0.7, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // top horizontals
for(i = [1, 3]) [(x[i] + x[i + 1]) / 2, -3.4, 0, "block", x[i + 1] - x[i], 0.6, 0.2, gold], // lower horizontals
]
],
];
ESP32_CAM_pcb = ["", "", 27, 40, 1.7, 2.5, 0, 0, grey(15), false, [],
[
[27 / 2, 26 / 2, 0, "-pcb", 0, ESP32_module],
for(side = [-1, 1]) [side * inch(0.45) + 27 / 2, -(4.2 + inch(.35)), 0, "-2p54header", 1, 8],
[ 27 / 2, -8, 90, "uSD", [14.85, 14.65, 1.8]],
[ 27 / 2 + 1, 15, 0, "flat_flex", false],
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 3, 3, 0.8, grey(90)],
[ 27 / 2 + inch(0.45), 10.5, 0, "block", 2.9, 2.9, 0.81, "yellow", true, 2.9 / 2 - eps],
[ 27 / 2, 3, 0, "text", 15, 2, "ESP32-CAM", "Liberation Sans:style=Bold"],
[0.5, -(4.7 + inch(.35)), 90, "text", inch(0.75), 0.9, "IO4 IO2 IO14 IO15 IO13 IO12 GND 5V", "Liberation Sans:style=Bold"],
[26.5, -(4.6 + inch(.35)), -90, "text", inch(0.77), 0.9, "3V3 1O16 IO0 GND VCC U0R U0T GND", "Liberation Sans:style=Bold"],
[5.5, -3.3, 90, "-chip", 4, 3, 1.6, silver], // Mock button surround
[5.5, -3.3, 90, "-chip", 1.8,0, 2.0, grey(20)], // Mock button
[10, -10.8, 0, "-smd_led", LED0603, "red"],
[-6.5, -5, 0, "-smd_soic", SOIC8],
[12.2, -4.5, 180, "-smd_sot", SOT223, "AMS1117"],
[25.3, 14, 0, "smd_sot", SOT23],
[3.0, 14, 0, "smd_sot", SOT23],
[8, 20, 90, "smd_sot", SOT23],
[16, 20, 90, "smd_sot", SOT23],
[3.0, 11.5,0, "smd_res", RES0502],
[2.9, 10.3,0, "smd_res", RES0502],
[5.4, 20, 90, "smd_cap", CAP0603, 0.5],
[11.5, 20, 90, "smd_cap", CAP0603, 0.5],
[18.7, 20, 90, "smd_cap", CAP0603, 0.5],
[19.9, 20, 90, "smd_cap", CAP0402, 0.3],
for(i = [0, 1, 2, 4]) [7.6 + i * 1.09, 8.8, 90, "smd_res", RES0502],
for(i = [0 : 3]) [-4.8, 20 + i * 1.09, 0, "smd_res", RES0502],
for(i = [3, 5, 8]) [7.6 + i * 1.09, 8.8, 90, "smd_cap", CAP0502, 0.5],
[-8.1, 23, 90, "smd_res", RES0502],
[-9.2, 23, 90, "smd_res", RES0502],
[-6.3, 23.3, 180, "text", 0.8, 0.7, "5V", "Liberation Sans:style=Bold"],
[-6.5, 22.2, 180, "text", 1.2, 0.7, "3V3", "Liberation Sans:style=Bold"],
[8, -3.3, 90, "-smd_cap", CAP0603, 0.5],
[2, -2, 0, "-text", 2.3, 1, "RST", "Liberation Sans:style=Bold"],
[10,-9.4, 0, "-text", 3.1, 1, "LED1", "Liberation Sans:style=Bold"],
[12.4, -10.8, 0, "-smd_res", RES0502],
[13.7, -9.4, 0, "-smd_cap", CAP0603, 0.5],
[17.2,-9.4, 0, "-smd_cap", CAP0502, 0.4],
[22.1, -10.8, 0, "-smd_res", RES0502],
[16.9, -4.8, 90, "-smd_res", RES0502],
[2.2, 9.0, 90, "-smd_cap", CAP0502, 0.4],
[2.2, 11.6, 90, "-smd_cap", CAP0502, 0.4],
[2.2, 14.2, 90, "-smd_res", RES0502],
[5.9, -9.4, 90, "-smd_tant", TANT_B, "107A"],
],
[],
[(27 - inch(0.9)) / 2, 40 - 4.2 - inch(0.7), 2, 8, silver, inch(0.9), inch(0.1)], // 8x2 grid of holes
];
ESP32_CAM = ["ESP32_CAM", "ESP32-CAM Camera module", ESP32_CAM_pcb, [esp32_cam_x, pcb_width(ESP32_CAM_pcb) / 2 - 12, 1.8],
[
[[8, 8, 2.4], 0],
[[0, 0, 4.2], 4],
[[0, 0, 6.3], 3.5, [1, 1, 0.5]],
],
[1, -4], [15, 2.2, 1],
[54, 41] // FOV
];
cameras = [rpi_camera_v1, rpi_camera_v2, rpi_camera, ESP32_CAM];
use <camera.scad>