DKP-50 dosimeter (radioactivity detector) tear-down

DKP-50 was a dosimeter produced for the Polish People's Army during the cold war era. It indicates amount of radioactivity absorbed by the body, a soldier was equipped in this device in case of nuclear conflict. A scale has range of 0-50R (R = Roentgen, a legacy unit of exposure of X-rays and gamma rays). 500R in 5h is usually lethal.

It's based on ionizing chamber that changes radioactivity radiation to an electric current, current discharges a capacitor that is also used as a power source. The device measures discharge of a capacitor over time. This is done by using a wire that accordingly changes its position and optic unit to make those results available for the operator.

If you're interested in radioactivity, you may also want to read about a Geiger–Müller Counter that I've made.

Sample result is visible on the picture. Note that it's inaccurate because the device was discharged and wasn't calibrated.

The deice, visible a plastic cap (with seal) to protect charging electrodes and a metal clip to attach the device to an uniform. On the cap, there're two names: "DKP-50" and "12".

Kirlian photography - electronic engineering meets parapsychology

Kirlian photography is an interesting photographic technique of capturing corona discharge of objects. The images basically contain only edges in a form of blue glow. Note: one of those photos is visible in "The X files" intro - read the whole article to know why!

In this post I will present my minimalist approach with common materials and without complicated construction. The results aren't that good as with more complex setups, but I think that they are still really interesting.

Materials

  • A camera with modifiable ISO and exposure time.
  • 10-30kV high voltage supply.
  • Tin foil. I used a foil in a form of adhesive strips because it's easier to stick it to surfaces, but a regular one can be also used.
  • Small piece of glass.
  • Slats or other things to put everything in place.

Modular DIY Geiger–Müller counter

The Geiger–Müller counter is a relatively simple tool to measure ionizing radiation. To increase sensitivity, construction presented here contains three (instead of one as usually) soviet STS-5 lamps. This is important for measurements of natural sources of (low) radiation like soil, rocks (an article about my trip with Geiger–Müller counter on Śnieżka mountain).

Principle of operation of a Geiger–Müller counter

When high voltage (typically 380-420V) is applied to the Geiger–Müller tube, the tube doesn't conducts electricity, but it does conducts for a short period, when radiation particle is observed. Those pulses are observed by the detector. The level of ionizing radiation is proportional to the amount of pulses detected in a constant interval of time (typically from 20s to 2,5min).

Geiger–Müller tube behavior can be described as a "button", that is "pushed" by an ionizing particle.

Homemade Geiger–Müller simplified circuit

Let's go further into the details. Geiger–Müller tube is made of two electrodes, ionizing particle creates a spark gap between them, to reduce amount of current that flows in this situation, a resistor is put in series with the tube. Marked as R1 on above circuit, R6 on below. Typically it's in a range 1-10M, acceptable values are listed in documentation of the GM tube.

There are a different ways to obtain a signal from the tube, in presented here, a resistor is connected in series between the tube and ground, changes of the voltage on the resistor are measured by the detector. This resistor is marked as R2 on above diagram, R7 on below. Typically it's in a range 10-220k.

Similarly to diode, a Geiger–Müller tube has its polarity, when connected in the opposite direction it will work incorrectly.

Below is shown a signal from GM tube when a particle is detected.

The electronic circuit of a Geiger–Müller counter

MC34063 is a DC/DC converter used to produce required high voltage, one of it's advantage over a simple NE555 or similar generators in this circuit is that it can monitor the output voltage and adjusts parameters to make it stable (R3, R4, R5, C3).

IC1A, R8, R9 are used as a comparator to filter out noises and produce binary signal (low=no pulse at this moment, high=pulse is currently being observed). R10, R11, R12 and a bunch of transistors drives LED, a speaker and (as an option) external digital devices, e.g. Arduino, or other evaluation board.

Waring! The device uses high voltage and can lead to unpleasant shock, injury or death. Don't touch the PCB or tubes when power is on.

Deobfuscation JavaScript code - how to start?

The easiest way to obfuscate code is to remove white-spaces that are not necessary and to shorten the names of variables and functions. A couple of years ago a made this simple tool to parse such obfuscated JavaScript code.

An example how the code can look after obfuscation and before passing it to a more readable form is presented below.

(function(){var s=true,t=false,aa=window,u=undefined,v=Math,ba="push",fa="slice",ga="cookie",y="charAt",z="indexOf",A="gaGlobal",ha="getTime",ja="toString",B="window",D="length",E="document",F="split",G="location",ka="href",H="substring",I="join",L="toLowerCase";var la="_gat",ma="_gaq",na="4.8.6",oa="_gaUserPrefs",pa="ioo",M="&",N="=",O="__utma=",qa="__utmb=",ra="__utmc=",sa="__utmk=",ta="__utmv=",ua="__utmz=",va="__utmx=",wa="GASO=";var xa=function(){var j=this,h=[],k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";j.uc=function(m){h[m]=s};j.Nb=function()

[...]

After parsing it to more friendly form, we can spot functions, variables, loops and other things. Although the code still is far from being beautiful, it looks much better.

(function()
{
 var s = true,t = false,aa = window,u = undefined,v = Math,ba = "push",fa = "slice",ga = "cookie",y = "charAt",z = "indexOf",A = "gaGlobal",ha = "getTime",ja = "toString",B = "window",D = "length",E = "document",F = "split",G = "location",ka = "href",H = "substring",I = "join",L = "toLowerCase";
 var la = "_gat",ma = "_gaq",na = "4.8.6",oa = "_gaUserPrefs",pa = "ioo",M = "&",N = " = ",O = "__utma = ",qa = "__utmb = ",ra = "__utmc = ",sa = "__utmk = ",ta = "__utmv = ",ua = "__utmz = ",va = "__utmx = ",wa = "GASO = ";
 var xa = function()
 {
  var j = this,h = [],k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
  j.uc = function(m)
  {
   h[m] = s
   }
  ;
  j.Nb = function()
  {
   for(var m = [],i = 0;
   i<h[D];
   i++)if(h[i])m[v.floor(i/6)]^ = 1<<i%6;
   for(i = 0;
   i<m[D];
   i++)m[i] = k[y](m[i]||0);
   return m[I]("")
   }
  
  }
 ,ya = new xa;
 function Q(j)
 {
  ya.uc(j)
  }
 ;
       [...] 

USB powered thermometer with an interesting data display

Almost each person interested in building electronic devices has built at least one thermometer and power supply in his life. I'm not different, to add to this, today I will present one of my thermometers.

Original concept was different, I wanted to use it as a weather station, wake up, go to my balcony, smoke a cigarette and check what on this device what is the temperature, humidity and air pressure. At the end I decided to build a small thermometer (in future with all mentioned features), that I could plug to my computer and check conditions in my home.

What is nice here is that the data is displayed original way, there are two rows of nine LEDs, if on the upper row second diode is on, and on the bottom row fifth diode is on, then the value presented by the device is 2*10 + 5 = 25. It can sounds complicated at first, but in practice it's fast and intuitive. Below is an example, value presented on the display is 25:

Popularne pytania z rozmów wstępnych dla programisty C/C++

W tym wpisie podzielę się zbiorem pytań, które często powtarzają się na różnych rozmowach wstępnych na stanowisko programisty C/C++. Są to pytania techniczne - nie opisałem tu żadnych pytań miękkich (HR'owych). Spotkałem się z nimi sam (już prawie 10 lat pracy, jak ten czas leci..), a niektóre zadawałem osobiście, gdy byłem po drugiej stronie stołu. Mam nadzieję, że taka lista okaże się pomocna podczas przygotowań do rozmowy.

Na początek pytania związane stricte z C/C++. Kolejność losowa.

  • Czym jest język obiektowy? Czy C++ jest językiem obiektowym (odpowiedź na to, czy jest może się różnić w zależności od tego, jak definiujemy język obiektowy)?
  • Napisz program, który jest poprawny składniowo w C, a nie jest w C++.
  • Czym są słowa kluczowe (w kontekście zmiennej, w kontekście metody) static i const? Co oznacza słowo kluczowe volatile?
  • Czym różni się alokacja pamięci na stosie od alokacji pamięci na stercie? Jak zmienną na oba sposoby? Kiedy stosować jedno, a kiedy drugie?
  • Czym jest smart pointer? Kiedy go stosować? Jakie są rodzaje?

USB sound card made from a broken USB headphones

If you have old USB headphones you can easily transform them to a USB sound. This card can be helpful during testing of home built devices connected to the speaker or microphone ports on the PC (for example A proof of concept of a simple sonar and Constructing a homemade microphone).

I used broken Audio 655 DSP headphones with working electronic inside. They have below features:

  • Powered from USB.
  • Stereo output.
  • Built-in microphone.
  • Mute/unmute switch.
  • Volume up/down switches.
  • Power on LED indicator.