diff --git a/app.py b/app.py
index 3fd8c54..1dd25e0 100644
--- a/app.py
+++ b/app.py
@@ -28,6 +28,8 @@ now = datetime.now()
word_count = 0
# Utils
+
+
def getParam(params, index):
return params[index] if len(params) > index else False
@@ -41,10 +43,14 @@ def listDocuments(params):
return html
# jinja filter to make a slug out of a stirng
+
+
def slugify_filter(value):
return slugify(value)
# Source: https://github.com/gandreadis/markdown-word-count
+
+
def count_words_in_markdown(text):
# Comments
@@ -75,6 +81,8 @@ def count_words_in_markdown(text):
return len(text.split())
# jinja filter for date formatting
+
+
def prettydate(value, format='%d/%m/%Y'):
return datetime.fromtimestamp(int(value)).strftime(format)
@@ -105,7 +113,9 @@ env.filters["slugify"] = slugify_filter
env.filters["prettydate"] = prettydate
# translate a single file into HTML
-def render_single_file(page, path, dist, name = False):
+
+
+def render_single_file(page, path, dist, name=False):
name = Path(path).stem
template = env.select_template([f"{name}.jinja", "post.jinja"])
html = template.render(documents=documents, page=page, name=name)
@@ -120,25 +130,27 @@ def render_single_file(page, path, dist, name = False):
# find a pre-rendered page
def get_existing_page(path, slug):
stem = Path(path).stem
- folder = os.path.basename(os.path.dirname(path))
+ folder = os.path.basename(os.path.dirname(path))
if stem == "index" and folder != "content":
folder = Path(path).parent.parent.name
if slug in documents:
return documents[slug]
-
+
if folder == "content":
return False
-
+
for doc in documents[folder]:
if doc:
if doc["slug"] == slug:
return doc
-
+
return False
# build a slug including the folder
+
+
def get_slug(path, folder, filename):
if folder == "content":
return slugify(filename)
@@ -146,6 +158,8 @@ def get_slug(path, folder, filename):
return slugify(f"{folder}/{filename}")
# compile markdown into cited HTML
+
+
def get_page_data(path):
global word_count
@@ -163,10 +177,11 @@ def get_page_data(path):
page["folder"] = folder
if "start_datetime" in page:
- page["has_passed"] = datetime.fromtimestamp(page["start_datetime"]) < now
+ page["has_passed"] = datetime.fromtimestamp(
+ page["start_datetime"]) < now
content = page.content
-
+
if "`include" in page.content:
content = pypandoc.convert_text(
page.content,
@@ -186,11 +201,11 @@ def get_page_data(path):
"--csl=harvard-cite-them-right.csl",
])
- word_count += count_words_in_markdown(page.body)
-
return page
# Do stuff to the circuit's pcb
+
+
def save_circuit_svg(filepath, outpath, name):
tree = ET.parse(filepath)
@@ -204,7 +219,7 @@ def save_circuit_svg(filepath, outpath, name):
root.set("width", f"{width_px}mm")
root.set("height", f"{height_px}mm")
- os.makedirs(outpath, exist_ok = True)
+ os.makedirs(outpath, exist_ok=True)
tree.write(f"{outpath}/{name}")
@@ -212,26 +227,29 @@ def save_circuit_svg(filepath, outpath, name):
# combine HTML & data with Jinja templates
def render_posts(path, output_path=OUTPUT_D):
name = Path(path).stem
-
+
for filename in sorted(os.listdir(path)):
file_path = Path(path) / filename
if file_path.suffix == ".md":
- render_single_file(get_page_data(file_path), file_path, f"{output_path}/{name}")
+ render_single_file(get_page_data(file_path),
+ file_path, f"{output_path}/{name}")
elif file_path.is_dir():
render_posts(file_path, f"{output_path}/{name}")
elif file_path.suffix == ".svg":
save_circuit_svg(file_path, f"{output_path}/{name}", filename)
elif file_path.suffix in {".jpeg", ".mp3", ".jpg", ".png"}:
- os.makedirs(f"{output_path}/{name}", exist_ok = True)
+ os.makedirs(f"{output_path}/{name}", exist_ok=True)
shutil.copyfile(file_path, f"{output_path}/{name}/{filename}")
# Pre-load before compiling
+
+
def preload_documents():
global documents
- version = subprocess.check_output(["git", "rev-list", "--count", "HEAD"]).decode("utf-8").strip()
-
+ version = subprocess.check_output(
+ ["git", "rev-list", "--count", "HEAD"]).decode("utf-8").strip()
documents["meta"] = {"now": now.strftime("%d %B %Y"), "version": version}
@@ -247,7 +265,8 @@ def preload_documents():
if filename.endswith(".md"):
documents[name].append(get_page_data(cpath))
elif os.path.isdir(cpath):
- documents[name].append(get_page_data(os.path.join(cpath, "index.md")))
+ documents[name].append(get_page_data(
+ os.path.join(cpath, "index.md")))
elif Path(path).suffix == '.md':
documents[Path(path).stem] = get_page_data(path)
@@ -266,14 +285,41 @@ def get_inventory():
with open("src/content/component-inventory.csv") as f:
documents['inventory'] = []
- for line in csv.DictReader(f, fieldnames=('ID', 'Amount', 'Name', 'Value', 'type', 'Date', 'Where','Mounting type')):
+ for line in csv.DictReader(f, fieldnames=('ID', 'Amount', 'Name', 'Value', 'type', 'Date', 'Where', 'Mounting type')):
documents['inventory'].append(line)
+def get_wordcount():
+ global word_count
+ word_count += count_words_in_markdown(documents['thesis'].body)
+
+ for c in documents['chapters']:
+ if c['filename'] != 'index':
+ count = count_words_in_markdown(c.body)
+ print(f"{c['filename']}: has {count} words")
+ word_count += count
+
+ for c in documents['components']:
+ if c['filename'] != 'index':
+ count = count_words_in_markdown(c.body)
+ print(f"{c['filename']}: has {count} words")
+ word_count += count
+
+ for c in documents['recipes']:
+ print(c['filename'])
+ count = count_words_in_markdown(c.body)
+ print(f"{c['filename']}: has {count} words")
+ word_count += count
+
+ print(f"word count: { word_count} ")
+ documents['meta']["count"] = word_count
+
+
def main():
print("....Start putting together a new document....")
get_inventory()
preload_documents()
+ get_wordcount()
for subdir in os.listdir(CONTENT_D):
path = os.path.join(CONTENT_D, subdir)
@@ -291,4 +337,5 @@ def main():
print(f"total words: {word_count}")
+
main()
diff --git a/src/content/chapters/-1-intro.md b/src/content/chapters/-1-intro.md
index 5c4f235..916a4c0 100644
--- a/src/content/chapters/-1-intro.md
+++ b/src/content/chapters/-1-intro.md
@@ -9,6 +9,10 @@ front: false
(Solderpunk, 2020, Cited in de Valk, 2022)
+I am a big fan of thinkering with electronics. I think it creates a creative mindset that allows you to hack, modify and own the devices. But I’ve also grown a certain discomfort with the practices, first started with a ) the amount of waste I was creating just for a funky explorative session and b) the lack of “respect” there was for the material.
+
+
+
You're reading[^shortcut-print] *A Field Guide for Salvaging Sound Devices*. Here, we'll explore the practical side of salvage computing through the making of noise boxes: is it possible to *live off* (create with) electronic components salvaged in the wild? And what would such a practice entail?
[^shortcut-print]: Ctrl + P to print this publication to bring it outside
diff --git a/src/content/chapters/2-component-salvaging.md b/src/content/chapters/2-component-salvaging.md
index 69cabcb..c6a4647 100644
--- a/src/content/chapters/2-component-salvaging.md
+++ b/src/content/chapters/2-component-salvaging.md
@@ -8,20 +8,50 @@ front: true
-Once you've uncovered the PCB[^PCB] and other loose parts of the device, we can try to identify the various components. In general PCB's are made with either "trough hole" (THT) or "surface mount" (SMD) components. SMD components are _extremely_ tiny[^tiny] and soldered _on top of_ a PCB. Due to their size, they are really difficult to handle. Their size makes it difficult to read any type of value notation, and actually soldering SMD components is such a frustrating process.[^collapse-OS]. THT components are bigger and have "legs" which are pushed trough holes drilled in the PCB, making them easier to solder & desolder.
+FOTO of multiple PCB’s
+FOTO of THT or SMD components
+
+The inside of your device exists of multiple parts. Chances are you’ve uncoverd one or multiple PCB’s[^PCB] and *very generally speaking* some sort of input and output components[^about-input-output], connected via a certain type of wire[^wires]. For instance, on the inside of a digital picture frame I’ve found a power input, a battery, a screen, speakers, one PCB and an antenna.
[^PCB]: Printed Circuit Board, this is where most of the components are solderd on top of.
-[^tiny]: how tiny, I should include an image
+[^about-input-output]: The input and the output are usually the core functionality of the device. If i press the button (input) the blender blends my smoothie (output). From the outside it’s difficult to see what goes on in between the input and the output [@hertzZombieMediaCircuit2012], but uncovering the inner traces it can be more noticable how it works, depending on the repairability of the dvice.
+
+Some parts can easily be identified, by recognising. Others can be more difficult. Looking up their datasheet online can provide information about what it is the thing does. A datasheet can be found by looking up a part number[^part-number]
+
+[^part-number]: Some product manufactures are really protective of their parts, and scratch of the part numbers/
+
+
+In general PCB's are populated with either "trough hole" (THT) or "surface mount" (SMD) components. SMD components are *extremely* tiny[^tiny] and soldered *on top of* a PCB. Their sizes makes their labels difficult to read. Due to their size, they are only suitable for factory made PCB’s, which goes a bit against what we’re doing here. This unfortuantly makes a large portion of parts unusable for the kind of salvage we are doing [^tried]. This is also why i never take computers and smartphones. Too many tiny parts.
+
+[^tried]: I’ve made various attempts at using SMD components, since i have so many on PCB’s laying around. I tried making circuits using conductive ink, cutting traces on the board directly, using charcoal pens, but none of the strategies have really worked so far. Only for parts that i **really really** want to use, such as some chips, i’ll jump trough the hoops, but for others, the amount of frustration is just not worth it.
+
+[^wires]: Great for reuse as well!
+
+## The blob
+Have you spotted “The Blob” yet? This is every circuit benders worst nightmare[^the-blob]. The blob is meant to protect certain bare parts of a PCB, but is also known as a type of reverse engineering protection.
+
+
+[^the-blob]: although it is rumoured that that circuit bending guy has a method
+
+
+## Desoldering
+Desoldering parts is generally more difficult then soldering, and requires patience and practice. Ironically, desoldering guns are much more expensive then soldering irons, so here’s how i do it, on the cheapsees:\
+
+In a well ventilated[^well-ventilated] room, heat up the blob of solder thas connects the part to the PCB using a soldering iron. After a couple of seconds, you’ll notice the solder becomes liquid[^liquid]. Then, using tweezers or a plier, i carefully pull the leg out from the backside of the board, and then do the same for the other legs. This process can take somewhere between 10 seconds and 10 minutes, and can be really frustrating.
+
+[^liquid]: How fast this happens, is dependand on the temprature of the soldering iron, and the melting point of the solder that is on the board. If it won’t melt, adding a bit of your own solder helps.
+
+[^well-ventilated]: whilest modern device cannot contain led anymore, older solder will. Do not lick the PCB, clean your hands after and open a window.
There are an almost infinite number of parts[^interchangeable_part] that can be found in electronic devices. I’ve limited the field guide to the parts that I have found, and found relevant to mention, but you’re welcome to update.
I would like to include more information about how to identify parts and how to find datasheets
-I would like to include info about how to desolder
-
[^interchangeable_part]: To research [interchangable parts](https://en.wikipedia.org/wiki/Interchangeable_parts#Late_19th_and_early_20th_centuries:_dissemination_throughout_manufacturing) n.a.v. deze [post](https://northcoastsynthesis.com/news/preferred-values-for-resistors-and-capacitors/)
+## List of parts i think are interesting
+
| **Name** | **Category** | **Description** | **Found in** | **Symbol** | **Value** |
| ---------------------------------- | ------------------------ | --------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------ |
| **555 Timer** | IC | A small chip that generates pulses | Timers, LED dimmers | |
@@ -29,8 +59,7 @@ There are an almost infinite number of parts[^interchangeable_part] that can be
| **Coil** | Passive Component | These funky components can create sounds on their own | Transformers, relays, wireless charging |  |
| **Crystal Oscillator** | Passive | Generates a frequency that is often used as a clock | Devices that have processors | | Frequency (MHz) |
| **Diode** | Diode | Forces current to flow in one direction | Everywhere! |  |
-| **Displays** | Display | Display information | Monitors, calculators, embedded systems | _nvt_ |
-| **Fuse** | Passive | Protects circuits from overflowing | Power supplies, home appliances | _nvt_ | Current rating (A) | |
+| **Displays** | Display | Display information | Monitors, calculators, embedded systems | _nvt_ | |
| **LED (Light Emitting Diode)** | Diode | Emit a small light | Everywhere! |  |
| **Logic chips** | IC | Create logic and switches | Computers, microcontrollers, control circuits | |
| **MOSFET** | IC | Not sure yet | Power supplies, motor control | | Threshold voltage (V) |
diff --git a/src/content/thesis-in-iai-writer.md b/src/content/thesis-in-iai-writer.md
index bc8766b..8845549 100644
--- a/src/content/thesis-in-iai-writer.md
+++ b/src/content/thesis-in-iai-writer.md
@@ -21,3 +21,4 @@ SingleTransistorOsc/index.md
power-supply/index.md
4-reflection.md
+5-bib.md
diff --git a/src/content/thesis.md b/src/content/thesis.md
index 85ebe80..0059dd3 100644
--- a/src/content/thesis.md
+++ b/src/content/thesis.md
@@ -5,10 +5,4 @@ version: 0.3
layout: index
description: This is the description of the about us page
---
-
-
-Dear reader,
-
-This web page includes the WIP version of my thesis. For (limited) information about Klankschool's repair café, go to [https://unrepair.klank.school](https://unrepair.klank.school). The text you'll find below is a draft of the thesis. This thesis will be a field guide to salvaging electronics to make sound devices. This field guide is compact and is meant to be taken *"into the wild."* You can download the guide as a PDF via [this link](https://unrepair.vitrinekast.xyz/assets/thesis.pdf), or CTRL + P your own.
-
-I'm leaving notes of things I'd like to include later. These notes can be recognized by their tags.
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/templates/thesis.jinja b/src/templates/thesis.jinja
index 716316f..8e01891 100644
--- a/src/templates/thesis.jinja
+++ b/src/templates/thesis.jinja
@@ -15,7 +15,7 @@
A field guide to
Salvaging Sound Devices
- Version {{documents['meta']['version']}}
+ Version {{documents['meta']['version']}} | {{documents['meta']['count']}} words
{{documents["meta"]["now"]}}