Skip to content

analog video posterisation effect - adapted from a rob schafer design

License

Notifications You must be signed in to change notification settings

cyberboy666/two_comparator_effect

Repository files navigation

two_comparator_effect

analog video posterisation effect - adapted from a rob schafer design

image

  • this circuit is distributed by UNDERSCORES - an open video hardware label : it is available to purchase - as a pcb, kit or assembled unit - at underscores.shop
  • the schematic for the circuit can be found here
  • the pcb gerber files for the lastest version can be found here
  • interactive BOM is here
  • consider donating to the underscores project to help us continue creating for the commons

demo video

image

background

background

Rob Schafer designed the original version of this circuit in his excellent whiteboard schoolhouse youtube series.

It was updated and adapted to pcb by cyberboy666 as open-source hardware with help from the scanlines community – this version debuted as a mail-in soldering workshop for VIDICON_2020

robs original circuit, the schematic and effect shown here

documentation

this project is fully open-source hardware - all the files required to build it are included in this repo for free. if you have the time and/or skill you can contribute back by collaborating on / testing new designs, improving these docs, making demo videos/other creative content etc. you can also support the project financially by donating directing, or purchasing through the web shop.

depending on whether you are going fully diy or buying an assembled and tested unit, some of the following guides will be relavent to you. the flow would be:

ordering parts

parts sourcing guide (w/ notes on pcb fabracation ) - start here if you are building fully from scatch or have purchased a pcb

i try to source all the parts i can from either:

  • tayda ; cheaper for common parts like resistors etc, also good for mechanical parts like switches and buttons
  • mouser ; has lots more options, speciality video ic's, can sometimes cost more (free shipping on orders over 50euros)
  • other ; ocationally there will be parts which will need to be sourced elsewhere - usaully either aliexpress, ebay or amazon etc...

take a look at the full_bom for this project to see where i am sourcing each part from

import into tayda

  • go to the tayda quick order and in bottom corner choose add from file

  • select the file tayda_bom.csv in the BOM folder (you will have to download it first or clone this repo)

  • after importing select add to cart

  • NOTE: the minimum value for resistors is 10, so you may need to modify these values to add to cart (or if they are already modified here you will need to see the full_bom for actual part QTY)

  • OPTIONAL: it is a good idea to add some dip-ic sockets and 2.54pin headers/sockets to your tayda order if you dont have them around already

import into mouser

  • go to mouser bom tool and click upload spreadsheet
  • select the file mouser_bom.csv in this folder (you will have to download it first or clone this repo), then upload my spreadsheet and next
  • ensure that Mouser Part Number is selected in the dropdown above the first row, then next, process
  • if everything looks correct can now put add to basket

ordering pcbs

you can support this project by buying individual pcbs from the shop. if you would rather have pcbs fabricated from gerbers directly the file you need is here

  • i get my pcbs fabricated from jlcpcb - 5 is the minumum order per design
  • upload the zip file with the add gerber file button
  • the default settings are mostly fine - set the PCB Qty and PCB Color settings (you can check that the file looks correct with pcb veiwer)
  • it may be best to combine orders with other pcbs you want to have fab'd since the shipping can cost more than the items - also orginising group buys is a good way to distribute the extra pcbs /costs

i often use jlcpcb because they are reliable, cheap and give you an option of colours. remember though that the cheapest Chinese fab houses are not always the most ethical or environmently friendly - if you can afford it consider supporting local companies.

assembly guide

assembly guide - start here if you have purchased a diy kit

interactive BOM for build guiding

follow this link to view the interactive BOM

general solder advice

  • remember to heat pad first (2-3seconds), then add solder, then continue to heat (1-2seconds)

  • Checkout the web-comic soldering is easy for more soldering advice

general order of assembly

  • in general while assembling i start placing resistors and capacitors first. placing 5 - 10 components at a time and then flipping the board to solder them and trim the legs etc.
  • next i would do diodes, transistors and ic's - taking care that these are placed in the right direction (using a ic socket can be useful)
  • finally i place the interface parts - rca jacks, power jack, pots and switches - make sure these have lots of solder on for structural stablity

specific assembly advice

  • start with the resistors, taking care place the correct value in the correct footprint (if you are unsure of the value can use an online resistor calculator ) , direction does not matter. Place a few resistors in (as many as you are comfortable with) then solder and trim legs

  • next lets do capacitors: 0.1u will say 104, while 1uf will say 105 on them - place them all and solder and trim.

  • now lets place diodes and transistors. take note of the direction on the diode - black bar on component matching black bar on footprint. Transistor values are printed on thembe sure not to mix them up ! be careful when soldering the to92 parts the pads are very close - this is the hardest part - i soldered the outer legs first, trimmed these and then soldered inner.

  • now lets do the ic/socket -> make sure the direction is correct! place in and fold two corner pins to hold in place, then solder all pins. you can place the ic in now too.

  • finally lets place the control parts, starting with the power jack (can use something under the board to balance it while you solder), next place the rca jacks and pots. be generous with the solder here -> this is to strengthen the mechanical connections as well as making electrical ones

operating guide

operating guide - start here if you have purchased an assembled unit

image

  • To set up using the circuit plug an active video source into composite video input and a display into composite video output (flipping the bypass switch should show the raw video source passing through the circuit to the display)

  • Next plug in a 5v center-positive power supply into the 2.1mm barrel jack connector – I like to use a usb wall charger for this

  • switch the bypass again to activate the circuit - Adjusting the level knobs should change the resulting image – the thresholds control which brightness levels result in white black or gray regions.

  • Depending on your display setting either or both knobs fully counter-clockwise can result in glitchy effects, colour bleeds and sync drops

more info

how the circuit works

Watch the youtube videos Lesson 1 – Comparators and Lesson 2 – Clamping by Rob Schafer for full explanation. See full schematics on the project page.

This circuit works by using multiple stages of an LM339 - Quad Differential Comparator ic.

A comparator stage compares the two voltages on its input (plus and minus) and outputs high if plus > minus, low if plus < minus. Since we power the ic with +5v, in this case high is an output of +5v and low is an output of 0v

comparator plus input is connected to the analog video signal (where higher voltage corresponds to a brighter image)

The minus input is connected to a reference voltage which can be set by turning a potentiometer. varying the pot adjusts the resistance in this voltage divider configuration which in turn varies the voltage supplied as reference

The result of this effect is an image that is all white for regions of the original image above a given brightness threshold level, and all black for the regions below this level. Changing this threshold changes which parts of the image are set to black vs white.

Here is a scoped example of an original signal (top) with threshold and the resulting signal (bottom)

Before reaching the comparators, the incoming video signal needs to be SOFT CLAMPED – this is done using a capacitor, diode and a 1.25v rail that was obtained with a LM317 voltage regulator.

A composite video signal tends to squash up when the image is bright and spread out when it is darker.

For the comparator reference voltages to be consistence we need to correct for this behavior by clamping the signal to a fixed voltage level

A third comparator stage with a fixed reference voltage is used to ‘pick off’ the sync pulse of the original signal.

The output from these three comparator stages are scaled and combined to create a new composite video signal with the desired effect

Composite video encodes color as a sub-carrier frequency over the signal.

This circuit is designed for use with gray-scale video input where no sub-carrier is present, although it does still work with color input – usually ignoring the sub-carrier, although occasionally there are some artifacts generated by this. This is more common with NTSC than with PAL

glitch artifacts are also created when the comparator thresholds are set below the black-level of the video signal, causing the signal to lose sync.

contributing guide

if you would like to contribute back to these projects in some way but dont know how the best thing (for now) would be to reach out to me directly ( tim@cyberboy666.com or @cyberboy666 on scanlines forum) - i will be happy to help

credits & more info

This circuit is distributed through UNDERSCORES – open video hardware label – visit underscores.shop for more info

The pcb was designed using KICAD , the booklet was created in LibreOffice Draw

Everything from gerbers, cad files, panels and documentation is freely available online and distributed under CC-BY-SA / open-source licenses – help us contribute to the commons !

Ask any questions or start discussions related to this project on the scanlines.xyz forum – an online community space dedicated to diy av / electronic media art

You can contact me directly at tim (at) cyberboy666 (dot) com Please get in touch if you are interested in hosting a workshop !

Thanks to Rob Schafer for sharing your designs and knowledge. to Bastien Lavaud for circuit advice, always. To Guergana Tzatchkova for booklet design inspiration. To Ben Caldwell for project advice. To everyone who has or will contribute ♥♥♥

About

analog video posterisation effect - adapted from a rob schafer design

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages