-
Notifications
You must be signed in to change notification settings - Fork 15
SparkFun Tristimulus Color Sensor - OPT4048DTSR #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ArnavK-09
wants to merge
32
commits into
main
Choose a base branch
from
A1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
bb894ee
Initial commit for SparkFun Tristimulus Color Sensor - OPT4048DTSR bo…
ArnavK-09 f50940d
format
ArnavK-09 4d1e8f3
c
ArnavK-09 c49f98d
d
ArnavK-09 390143b
f
ArnavK-09 9168c7b
Discard changes to boards/SparkFun HMC6343 Breakout/SparkFun-HMC6343-…
ArnavK-09 ab93b91
Discard changes to boards/SparkFun I2C DAC Breakout - MCP4725/SparkFu…
ArnavK-09 58fb443
revert
ArnavK-09 aa47b6a
delete snapsjots
ArnavK-09 1e45877
use latest cli to avoid snapshot er
ArnavK-09 a601f15
remove napshots
ArnavK-09 87011cc
deps update
ArnavK-09 39ec416
ds
ArnavK-09 9535570
Discard changes to package.json
ArnavK-09 478941e
Discard changes to bun.lock
ArnavK-09 530b805
sd
ArnavK-09 22831fd
update tscircuit to test for build
ArnavK-09 c737663
test
ArnavK-09 dba105d
fix
ArnavK-09 51fb0f8
Discard changes to package.json
ArnavK-09 3d79b33
Discard changes to bun.lock
ArnavK-09 48e063b
Merge branch 'main' into A1
ArnavK-09 c77163a
done
ArnavK-09 40b4988
Merge branch 'main' into A1
ArnavK-09 95a5804
feat(board): add mounting holes and update component layouts
ArnavK-09 c2ab7b3
chore: remove LICENSE file from OPT4048DTSR board
ArnavK-09 330c65a
refactor(OPT4048DTSR): improve type imports and simplify connectors
ArnavK-09 938ddff
chore: update circuit schematic diff image for OPT4048DTSR sensor
ArnavK-09 a28aa4a
Merge branch 'main' into A1
ArnavK-09 0206d80
Merge branch 'main' into A1
ArnavK-09 6fb267f
Merge branch 'main' into A1
ArnavK-09 e575958
Merge branch 'main' into A1
ArnavK-09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # SparkFun Tristimulus Color Sensor - OPT4048DTSR | ||
|
|
||
| For more information about this board, visit the official SparkFun product page: | ||
|
|
||
| [https://www.sparkfun.com/sparkfun-tristimulus-color-sensor-opt4048dtsr-qwiic.html](https://www.sparkfun.com/sparkfun-tristimulus-color-sensor-opt4048dtsr-qwiic.html) |
14 changes: 14 additions & 0 deletions
14
...us Color Sensor - OPT4048DTSR/SparkFun Tristimulus Color Sensor - OPT4048DTSR.circuit.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import manualEdits from "./manual-edits.json" | ||
| import Jumpers from "./jumpers" | ||
| import Sensor from "./color-sensor" | ||
| import Address from "./address" | ||
| import Connectors from "./connectors" | ||
|
|
||
| export default () => ( | ||
| <board width="25.4mm" height="25.4mm" manualEdits={manualEdits}> | ||
| <Sensor x={2} y={2} /> | ||
| <Jumpers x={8} y={5} /> | ||
| <Address x={8} y={0} /> | ||
| <Connectors x={2} y={-2} /> | ||
| </board> | ||
| ) | ||
1 change: 1 addition & 0 deletions
1
...napshots__/SparkFun Tristimulus Color Sensor - OPT4048DTSR.circuit-pcb.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
146 changes: 146 additions & 0 deletions
146
...ts__/SparkFun Tristimulus Color Sensor - OPT4048DTSR.circuit-schematic.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions
67
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/address.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| interface DisplacementProps { | ||
| x?: number | ||
| y?: number | ||
| } | ||
|
|
||
| export default ({ x = 0, y = 0 }: DisplacementProps) => ( | ||
| <group name="addresses" schY={y} schX={x}> | ||
| <resistor | ||
| footprint={"0402"} | ||
| name="R5" | ||
| resistance={"10k"} | ||
| schRotation={90} | ||
| connections={{ | ||
| pin2: "net.V3_3", | ||
| }} | ||
| schY={1} | ||
| /> | ||
| <trace from=".R5 > .pin1" to=".OX45 > .pin1" /> | ||
| <solderjumper | ||
| name="OX45" | ||
| pinLabels={{ | ||
| pin1: "ADDR_1", | ||
| pin2: "VCC", | ||
| }} | ||
| pinCount={2} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={180} | ||
| schX={-0.6} | ||
| schY={0.11} | ||
| /> | ||
| <solderjumper | ||
| name="OX46" | ||
| pinLabels={{ | ||
| pin1: "ADDR_2", | ||
| pin2: "SDA", | ||
| }} | ||
| pinCount={2} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={180} | ||
| schX={-0.6} | ||
| schY={-0.6} | ||
| /> | ||
| <trace from=".OX46 > .pin1" to="net.SDA" /> | ||
| <solderjumper | ||
| name="OX44" | ||
| pinLabels={{ | ||
| pin1: "GND", | ||
| pin2: "ADDR_0", | ||
| }} | ||
| pinCount={2} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={180} | ||
| schX={-0.6} | ||
| schY={-1.3} | ||
| /> | ||
| <netlabel | ||
| net="GND" | ||
| schX={0.6} | ||
| schY={-1.3} | ||
| connection="OX44.pin1" | ||
| anchorSide="top" | ||
| /> | ||
| <trace from=".OX44 > .pin2" to="net.ADDR" /> | ||
| <trace from=".OX45 > .pin2" to="net.ADDR" /> | ||
| <trace from=".OX46 > .pin2" to="net.ADDR" /> | ||
| </group> | ||
| ) |
96 changes: 96 additions & 0 deletions
96
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/color-sensor.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| import type { ChipProps } from "@tscircuit/props" | ||
| import { sel } from "@tscircuit/core" | ||
|
|
||
| interface DisplacementProps { | ||
| x?: number | ||
| y?: number | ||
| } | ||
|
|
||
| const pinLabels: Record<`pin${number}`, string> = { | ||
| pin1: "VDD", | ||
| pin2: "ADDR", | ||
| pin3: "NC", | ||
| pin4: "GND", | ||
| pin5: "SCL", | ||
| pin6: "NC", | ||
| pin7: "INT", | ||
| pin8: "SDA", | ||
| } | ||
|
|
||
| const OPT4048DTSR = (props: ChipProps<typeof pinLabels>) => ( | ||
| <chip | ||
| {...props} | ||
| pinLabels={pinLabels} | ||
| footprint={"soic8"} | ||
| manufacturerPartNumber="OPT4048" | ||
| /> | ||
| ) | ||
| export default ({ x = 0, y = 0 }: DisplacementProps) => ( | ||
| <group name="sensor" schX={x} schY={y}> | ||
| <schematictext | ||
| fontSize={0.3} | ||
| text="VDD Range: 1.71V - 3.6V" | ||
| schX={-3} | ||
| schY={4} | ||
| anchor="center_left" | ||
| /> | ||
| <OPT4048DTSR | ||
| name="U1" | ||
| schPinArrangement={{ | ||
| leftSide: { direction: "top-to-bottom", pins: ["VDD", "GND"] }, | ||
| rightSide: { | ||
| direction: "bottom-to-top", | ||
| pins: ["SCL", "SDA", "ADDR", "INT"], | ||
| }, | ||
| }} | ||
| schPinStyle={{ | ||
| VDD: { marginBottom: 1 }, | ||
| GND: { marginBottom: 0 }, | ||
| ADDR: { marginBottom: 0.65 }, | ||
| }} | ||
| connections={{ | ||
| SCL: sel.net.SCL, | ||
| SDA: sel.net.SDA, | ||
| ADDR: "net.ADDR", | ||
| INT: "net.INT", | ||
| }} | ||
| /> | ||
| <netlabel | ||
| net="GND" | ||
| schX={-1.5} | ||
| schY={-0.6} | ||
| connection=".U1 > .GND" | ||
| anchorSide="top" | ||
| /> | ||
| <netlabel | ||
| net="V3_3" | ||
| schX={-1.5} | ||
| schY={0.6} | ||
| connection=".U1 > .VDD" | ||
| anchorSide="bottom" | ||
| /> | ||
| <resistor | ||
| name="R3" | ||
| footprint="0402" | ||
| resistance={"10K"} | ||
| connections={{ | ||
| pin1: sel.net.V3_3, | ||
| pin2: "net.INT", | ||
| }} | ||
| schRotation="270deg" | ||
| schX={1} | ||
| schY={1.8} | ||
| /> | ||
| <capacitor | ||
| footprint="0402" | ||
| connections={{ | ||
| pin1: sel.net.GND, | ||
| pin2: sel.net.V3_3, | ||
| }} | ||
| schX={-2.5} | ||
| name="C1" | ||
| schRotation="90deg" | ||
| capacitance={"0.0000001F"} | ||
| /> | ||
| </group> | ||
| ) |
81 changes: 81 additions & 0 deletions
81
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/connectors.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| import { sel } from "@tscircuit/core" | ||
|
|
||
| interface DisplacementProps { | ||
| x?: number | ||
| y?: number | ||
| } | ||
|
|
||
| const pinLabelsJ2: Record<`pin${number}`, string> = { | ||
| pin4: "SCL", | ||
| pin3: "SDA", | ||
| pin2: "VCC", | ||
| pin1: "GND", | ||
| } | ||
| const pinLabelsJ3: Record<`pin${number}`, string> = { | ||
| pin4: "SCL", | ||
| pin3: "SDA", | ||
| pin2: "VCC", | ||
| pin1: "GND", | ||
| } | ||
|
|
||
| export default ({ x = 0, y = 0 }: DisplacementProps) => ( | ||
| <group schX={x} schY={y}> | ||
| <jumper | ||
| name="J3" | ||
| schX={-3} | ||
| pcbRotation={-90} | ||
| footprint="pinrow5_pinlabeltextalignright_pinlabelorthogonal_pinlabelverticallyinverted_doublesidedpinlabel" | ||
| /> | ||
| <trace from=".J3 > .pin5" to="net.INT" /> | ||
| <trace from=".J3 > .pin4" to="net.SCL" /> | ||
| <trace from=".J3 > .pin3" to="net.SDA" /> | ||
| <netlabel | ||
| net="V3_3" | ||
| schX={-2} | ||
| schY={1} | ||
| connection=".J3 > .pin2" | ||
| anchorSide="bottom" | ||
| /> | ||
| <netlabel | ||
| net="GND" | ||
| schX={-2} | ||
| schY={-1} | ||
| connection=".J3 > .pin1" | ||
| anchorSide="top" | ||
| /> | ||
|
|
||
| <jumper | ||
| manufacturerPartNumber="QWIIC_RIGHT_ANGLE" | ||
| name="J2" | ||
| pinLabels={pinLabelsJ2} | ||
| schY={1} | ||
| footprint="pinrow4_pinlabeltextalignright_pinlabelorthogonal_pinlabelverticallyinverted_doublesidedpinlabel" | ||
| /> | ||
| <trace from=".J2 > .pin4" to="net.SCL" /> | ||
| <trace from=".J2 > .pin3" to="net.SDA" /> | ||
|
|
||
| <jumper | ||
| manufacturerPartNumber="QWIIC_RIGHT_ANGLE" | ||
| name="J1" | ||
| schY={-1} | ||
| pinLabels={pinLabelsJ2} | ||
| footprint="pinrow4_pinlabeltextalignright_pinlabelorthogonal_pinlabelverticallyinverted_doublesidedpinlabel" | ||
| /> | ||
| <trace from=".J1 > .pin4" to="net.SCL" /> | ||
| <trace from=".J1 > .pin3" to="net.SDA" /> | ||
| <netlabel | ||
| net="GND" | ||
| schX={1.5} | ||
| schY={-1.5} | ||
| connectsTo={[".J1 > .pin1", ".J2 > .pin1"]} | ||
| anchorSide="top" | ||
| /> | ||
| <netlabel | ||
| net="V3_3" | ||
| schX={1.5} | ||
| schY={2} | ||
| connectsTo={[".J1 > .pin2", ".J2 > .pin2"]} | ||
| anchorSide="bottom" | ||
| /> | ||
| </group> | ||
| ) |
16 changes: 16 additions & 0 deletions
16
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import manualEdits from "./manual-edits.json" | ||
| import Jumpers from "./jumpers" | ||
| import Sensor from "./color-sensor" | ||
| import Address from "./address" | ||
| import Connectors from "./connectors" | ||
|
|
||
| export default () => ( | ||
| <board width="25.4mm" height="25.4mm" manualEdits={manualEdits}> | ||
| <Sensor x={2} y={2} /> | ||
| <Jumpers x={8} y={5} /> | ||
| <Address x={8} y={0} /> | ||
| <Connectors x={2} y={-2} /> | ||
| </board> | ||
| ) | ||
|
|
||
| export { Jumpers, Sensor, Address, Connectors } |
100 changes: 100 additions & 0 deletions
100
boards/SparkFun Tristimulus Color Sensor - OPT4048DTSR/jumpers.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| interface DisplacementProps { | ||
| x?: number | ||
| y?: number | ||
| } | ||
|
|
||
| export default ({ x = 0, y = 0 }: DisplacementProps) => ( | ||
| <group schX={x} schY={y}> | ||
| <solderjumper | ||
| name="I2C_PU" | ||
| pinLabels={{ | ||
| pin1: "SDA_PU", | ||
| pin2: "VCC", | ||
| pin3: "SCL_PU", | ||
| }} | ||
| pinCount={3} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={180} | ||
| /> | ||
| <trace from=".I2C_PU > .pin2" to="net.V3_3" /> | ||
|
|
||
| <resistor | ||
| name="R1" | ||
| footprint={"0402"} | ||
| schRotation={"90deg"} | ||
| schY={-0.8} | ||
| schX={-0.439} | ||
| resistance={"2.2K"} | ||
| /> | ||
| <resistor | ||
| name="R2" | ||
| footprint={"0402"} | ||
| schRotation={"90deg"} | ||
| schY={-0.8} | ||
| schX={0.439} | ||
| resistance={"2.2K"} | ||
| /> | ||
|
|
||
| <trace from=".I2C_PU > .pin3" to=".R1 > .pin2" /> | ||
| <trace from=".I2C_PU > .pin1" to=".R2 > .pin2" /> | ||
|
|
||
| <netlabel | ||
| net="SDA" | ||
| schX={1} | ||
| schY={-1.35} | ||
| connection=".R2 > .pin1" | ||
| anchorSide="left" | ||
| /> | ||
| <netlabel | ||
| net="SCL" | ||
| schX={1} | ||
| schY={-2} | ||
| connection=".R1 > .pin1" | ||
| anchorSide="left" | ||
| /> | ||
|
|
||
| <schematictext | ||
| fontSize={0.1} | ||
| schX={-1.4} | ||
| schY={0} | ||
| text="Cut traces to remove I2C pull-up resistors." | ||
| /> | ||
|
|
||
| <resistor | ||
| schX={2.5} | ||
| name="R4" | ||
| footprint={"0402"} | ||
| resistance={"4.7K"} | ||
| schRotation={"90deg"} | ||
| /> | ||
| <trace from=".R4 > .pin2" to="net.V3_3" /> | ||
| <led | ||
| schX={2.5} | ||
| name="D1" | ||
| schY={-1.2} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={"270deg"} | ||
| schDisplayValue="RED" | ||
| /> | ||
| <trace from=".D1 > .pin1 " to=".R4 > .pin1" /> | ||
| <solderjumper | ||
| name="LED" | ||
| pinLabels={{ | ||
| pin1: "LED_GND", | ||
| pin2: "NC", | ||
| }} | ||
| pinCount={2} | ||
| footprint="solderjumper3_p0.8_pw0.635_ph1.270" | ||
| schRotation={90} | ||
| schX={2.5} | ||
| schY={-2.2} | ||
| /> | ||
| <schematictext | ||
| fontSize={0.1} | ||
| schX={3.1} | ||
| schY={-2.2} | ||
| text="Cut trace to disconnect Power LED." | ||
| /> | ||
| <trace from=".LED > .pin1" to="net.GND" /> | ||
| </group> | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.