+ - 0:00:00
Notes for current slide
  • My name is Kaspar
  • Here to talk about a webservice and browser extension that make it easier to replicate electronics projects
Notes for next slide
  • I'd like to give some context for these projects
  • The motivation behind their approach
  • Maybe a million software developers and 300,000 electronic engineers in the US
  • A similiar ratio if you look at these sub-reddits
  • Gives you an idea of the size of our field

1 / 44
  • My name is Kaspar
  • Here to talk about a webservice and browser extension that make it easier to replicate electronics projects

In the US:

  • 1,114,000 Software Developers
  • 315,900 Electrical and Electronic Engineers

Reddit:

  • /r/programming 720,000 subscribers
  • /r/electronics 66,000 subscribers
2 / 44
  • I'd like to give some context for these projects
  • The motivation behind their approach
  • Maybe a million software developers and 300,000 electronic engineers in the US
  • A similiar ratio if you look at these sub-reddits
  • Gives you an idea of the size of our field

On the other hand

  • there is about one EE to every three programmers
  • one in ten software devlopers know C (maybe, according to TIOBE)

  • /r/electronics 66,000 subscribers

  • /r/c_programming 30,000 subscribers
3 / 44
  • But if you reduce it down to just C developers
  • There are probably less C developers than electronic engineers
  • Obviously these are just rough figures

Where is the Linux of electronics?

4 / 44
  • But the really interesting question for me is, why are there no hugely collaborative electronic engineering efforts?
  • Something at the scale of say, Linux
  • This penguin here is actually the logo of the open hardware repository, from our friends at CERN, and there are a few other projects out there looking at this issue
  • I imagine there are quite a few people out there asking this question

Assemblers and compilers

5 / 44
  • Despite the numbers of electronic engineers, electronic engineering is not a pure information technology
  • We have to move atoms in physical space
  • Which means money needs to be spent
  • But we do have increased automation and decreased cost

6 / 44
  • The cost reduction in PCB batching services is giving more and more people the opportunity to make professional grade PCBs
  • it's tantalizingly close

We do share projects

  • GitHub

    • 3000 KiCAD Projects
    • 7000 Eagle Projects
  • OshPark

    • Over 9000 shared projects
  • Hackaday.io, EEVblog Forums, etc

7 / 44
  • We do share projects
  • This is a rough survey I did last years on the numbers of projects you can find online
  • This is not including other popular ways to share projects such as Hackaday and forums
  • So what's the problem?




8 / 44
  • Often it takes considerable effort to understand someone else's work
  • Projects can be simultaneously brilliant but not reproducable
  • There is no clear standard way to present the information that reduces the friction

9 / 44
  • So what we would like, is something that incorporates all these different ways of doing things

10 / 44
  • Allows you to make the PCB

11 / 44
  • And allows you to purchase the parts

kitnic.it

12 / 44
  • And this is my approach to try and solve this
  • The Kitnic.it web service
  • and the 1-click BOM browser extension

1-click BOM extension

Automates purchasing by replicating the web requests that are sent when you use retailer sites:

  • Digikey
  • Mouser
  • RS
  • Newark / Farnell / Element14
13 / 44
  • The browser extension tries to completely reduce the friction between a BOM and the retailer shopping cart
  • It does this by replicating the web requests that your browser sends when using the site
  • Currently works for these retailers
  • Q: Why a browser extension and not just a website?
  • A: Same origin policy

"The same-origin policy restricts how a document or script loaded from one origin can interact with a resource from another origin." - MDN

14 / 44
  • So you might ask why couldn't you offer this as a webpage?
  • The same origin policy would restrict these interactions

15 / 44
  • The same origin policy means that retailers would need to open up the endpoints to allow these interactions
curl
'http://uk.mouser.com/ProductDetail/Cree-Inc/CGHV96100F2/?Cree-Inc
%2fCGHV96100F2%2f&qs=sGAEpiMZZMvplms98TlKY6zbNRoARc
Ug8gg333Al67kStE%252bN8N0%2fKg%3d%3d'
-H 'Cookie: g11n=Up9NRXFGLVs=;
ME_Main=&ME_DSN=kJ0slznDUsNJMyNjQRiw8Q==&ME_DSU=YyaQEeoCnLc=;
ASP.NET_SessionId=zxtlgy45oobekaaphyv5n0z1;
_op_aixPageId=a2_60d31424-8123-4e84-b3f9-a18a6f8bfc3d-3648-87767;
CARTCOOKIEUUID=c46df9ef-39bb-4ada-bfcd-2452ed49bc8a; _gat=1;
__ar_v4=5UM3NRP3LFFG5JUPQ2VEXA%3A20150203%3A12%7CVPQ73SPSLBEPXM7QJ2MJRL%3A20150203%3A12%7CA463QQQT6VD37AVLWC4RZU%3A20150203%3A12;
SDG1=12; SDG2=40; SDG3=0; preferences=ps=gb&pl=en-GB&pc_gb=GBP;
_ga=GA1.2.91020740.1409853093;
__utma=261309969.91020740.1409853093.1417720020.1422769855.8;
__utmb=261309969.15.10.1422769855; __utmc=261309969;
__utmz=261309969.1409853093.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
__utmv=261309969.|14=MYM=1638924=1^16=UV=5423887=1^18=Sub=1795089=1^19=PCAT=5367B8=1;
__atuvc=1%7C5; __atuvs=54cdc5eabb3480fd000; __utmli=ctl00_ContentMain_btnBuy2'
-H 'Origin: http://uk.mouser.com' -H 'Accept-Encoding: gzip, deflate' -H
'Accept-Language: en-GB,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11;
Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/39.0.2171.65
Chrome/39.0.2171.65 Safari/537.36' -H 'Content-Type:
application/x-www-form-urlencoded' -H 'Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H
'Cache-Control: max-age=0' -H 'Referer:
http://uk.mouser.com/ProductDetail/Cree-Inc/CGHV96100F2/?qs=sGAEpiMZZMvplms98TlKY6zbNRoARcUg8gg333Al67kStE%252bN8N0%2fKg%3d%3d'
-H 'Connection: keep-alive' --data
'__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=skTHKc%2BTu8q1ptksBWazoqW1jH%2F9s
30wKeqLaG6vPBO92Ae4BJFGniiNMJOdrxMC0BKNq0OgMPn9jzXyEnh%2BhZElrKrDDEwTj6wDz%2BB
5Mc8596z13lM4bwTtSkhsckjY87ZWffCEhuwhyb5YCmSMivmI453lwnERDa8eObcoNnPPaM0TNaN0o
X6eY%2FQ0eiyT%2FJsDR6vWe4u1sV0sPkLebGRRWfI4chXx3bL9X0CXPlXzEjYBjSMVFvahuPicHdx
N4QG31f8teVRA4a6JqwXeveNQi8J4yp2Euq3lgQnEjPAWpjeUEq5tXJbII8qczxQBrYBFu7ebLbyl
PNsPfrOeY6REXhUiEV1...
16 / 44
  • Anyway, these are the kind of requests we are trying to replicate
  • It's not a nice API by any means
  • And we need to scrape the site to get some of this information to send

17 / 44
  • So the only way to make this work
  • And ensure that it keeps working
  • Is to use a lot of integration tests to test this across all the different sites

18 / 44
  • But this is what the extension looks like
  • You normally use it in addition to a spreadsheet program and copy and paste from it
  • And you can quickly accesss all the retailer functionality from there

1-click BOM extension

  • Available for Chrome and Firefox
  • Takes in tab separated values (the clipboard format of spreadsheet programs)
  • Can load a online BOM
  • Able to add to and remove from cart
  • Can have a guess at what part you mean
  • Open source (CPAL)
  • About 500 users
19 / 44

20 / 44
  • So this kind of solves one aspect of our goal.
  • We can replicate purcheses across the globe
  • But it doesn't include the PCB and there is no standard way to package a complete project to be replicated

Kitnic.it

  • Git repository
  • Tab separated values
    • 1-click-bom.tsv
    • At minumum: References, Quantity and Part Number
  • RS274-X Gerbers and Excellon drills
.
├── 1-click-bom.tsv
└── gerbers
├── board.cmp
├── board.drd
├── board.dri
├── board.gko
├── board.gpi
├── board.gto
├── board.stc
└── board.sts
21 / 44
  • So this is where kitnic.it comes in.
  • We combine the BOM with gerber files and put the in a Git repository
  • And kitnic.it makes a page out of this for people to access

The Virtual Kit

???

The idea really is that, creators can put together a virtual kit, that others can buy themselves, and we can share open hardware designs that way. With the least amount of friction.

Are there any questions at this point?

23 / 44

  • Static site hosting on Netlify and AWS
  • Travis CI builds every branch
  • All branches are deployed to *.preview.kitnic.it sub-domains
  • Master branch is deployed to kitnic.it
  • Register by editing the boards.txt file
https://github.com/kasbah/push-on-hold-off
https://github.com/kitnic/BQ25570_Harvester
https://github.com/JarrettR/USBvil
https://github.com/8BitMixtape/NextLevelEdition
https://github.com/dvdfreitag/Signal-Detector
24 / 44
  • This is the infrastructure behind kitnic
  • We use static site hosting

Planned features

  1. Accounts
  2. File upload and user project management
  3. Improved tools for making BOMs
25 / 44

More features

  1. Option to auto-publish user's projects from GitHub and Dropbox
  2. Tagged releases and versioning
  3. Connect to PCB batching services
  4. Connect to assembly services
26 / 44

27 / 44
28 / 44

Is the browser extension the best way?

CORS endpoints are available for some retailers!

29 / 44

Is the browser extension the best way?

Pro:

  • Flexibility and development speed
  • New retailers can be added at will
  • Web Extensions will allow one codebase for Chrome, Firefox and Microsoft Edge

Con:

  • Does a user want to install an extension?
  • Based on web-scraping, can break at any point
30 / 44

Towards sustainablity?

| Item | Cost |
|--------------------+-------|
| Google Web Store | $5 |
| Contractor's time | $2500 |
| Free PCB promotion | $500 |
| Domain names | $20 |
| Hosting | $0 |
| Kaspar's time | ??? |
  1. Track purchasing referrals?
  2. Paid private accounts?
31 / 44






Show me the code!

32 / 44



33 / 44

1-click BOM

  • No more Coffeescript
  • But we still compile from ES6 to ES5!
34 / 44

Kitnic

React front-end

Micro services:

35 / 44

Over 350,000 javascript packages

e.g. left-pad:

module.exports = leftpad;
function leftpad (str, len, ch) {
str = String(str);
var i = -1;
if (!ch && ch !== 0) ch = ' ';
len = len - str.length;
while (++i < len) {
str = ch + str;
}
return str;
}
36 / 44

pcb-stackup

pcb-stackup
├─┬ gerber-to-svg
│ ├── gerber-parser
│ └── gerber-plotter
└── whats-that-gerber

37 / 44

Let's build an equality function for resistor descriptions!

E.g.

  • 100 Ohm
  • 100R
  • 1k5
  • 1M Ω
38 / 44
# creates a package.json file
npm init
# installs dependencies and saves to package.json
npm install --save js-quantities resistor-data
//index.js
const Qty = require('js-quantities')
const resistorData = require('resistor-data')
function extract(R) {
//"100 Ohm" or "100 Ω" style
const match1 = /\d+\.?\d* ?(ohm|Ω|Ω)/i.exec(R)
if (match1) {
return Qty(match1[0])
}
//"1k5", "1M" or "100R" style
const match2 = /\d+(k|m|r)\d*/i.exec(R)
if (match2) {
const v = resistorData.notationToValue(match2[0]) + ' ohm'
return Qty(v)
}
}
function equal(R1, R2) {
return extract(R1).eq(extract(R2))
}
39 / 44

index.js

-function equal(R1, R2) {
+module.exports = function equal(R1, R2) {
return extract(R1).eq(extract(R2))
}

package.json

{
"name": "r-equal",
"version": "1.0.0",
"description": "Function to test if resistor values are equal",
"main": "index.js",
"license": "ISC",
"dependencies": {
"js-quantities": "^1.6.5",
"resistor-data": "^1.0.0"
}
}
npm publish
40 / 44

Extend and combine this with:

41 / 44
42 / 44

How to get involved?

  • Add your project and you'll get free PCB manufacturing (8/20 left)
  • Web development
  • Spread the word

43 / 44

Questions?

Image credits

  • ohwr.org logo - CC-BY-SA CERN
  • Eric Archer soldering a MeeBlip 6 - CC-BY-SA Create Digital Media
  • Pick and place internals of surface mount machine - CC-BY Periptus
  • Circuit board evolution - CC-BY Feesta.com
  • Cover of Troubleshooting Analog Circuits by Robert A. Pease - © 1991 by Butterworth-Heinemann
  • Meat grinder & Disassembled hand-powered grinder - CC-BY-SA Kku and Rainer Zenz
  • Bleep Drum Kit with MIDI - CC-BY-SA SparkFun Electronics
  • Iterative development drawing - © Henrik Kniberg
  • 3 Resistors - CC-BY-SA Afrank99
  • GFP-tagged Cln2 - CC-BY - Jean Peccoud
44 / 44

In the US:

  • 1,114,000 Software Developers
  • 315,900 Electrical and Electronic Engineers

Reddit:

  • /r/programming 720,000 subscribers
  • /r/electronics 66,000 subscribers
2 / 44
  • I'd like to give some context for these projects
  • The motivation behind their approach
  • Maybe a million software developers and 300,000 electronic engineers in the US
  • A similiar ratio if you look at these sub-reddits
  • Gives you an idea of the size of our field
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow