bogdan's (micro)blog

bogdan » modern spies don’t use microphones

10:44 pm on Sep 28, 2012 | read the article | tags:

an article for all my paranoid friends and acquaintances.

i love spy movies. i really do. with little to no exception most of them depict the use of “bugs” to spy on a conversation. more, due to our communist legacy, we (romanians) are proficient at spying. romanian “bugs” were generously (re)covered by our media: here, here and here. unfortunately most of these stories are focused on pretty old, flawed technology.

the “bug”, no matter how small and miniaturized, has a built in weakness: it has to send the information collected to the listener and the preferred medium is modulating an electromagnetic field and actively transport it. needless to say that power sources are involved requiring maintenance.

a better, safer and passive way of spying on other people should start from the definition of a microphone:

microphone: an instrument capable of transforming sound waves into changes in electric currents or voltage, used in recording or transmitting sound.

first, capturing sound is quite easy: the pressure waves travel through an elastic medium bouncing of various surfaces, including windows. the glass is a relatively elastic medium and forced by the sound waves inside – vibrates, transporting inside information to the outside world.

but is there a device capable of measuring the tiny vibration of windows, from a relatively safe distance, in order to recover the leaked information? of course, and it’s around from 1897 when michelson and morley laid the foundation of special theory of relativity: the michelson-morley interferometer. a tool used to measure tiny length variations made by current technologies cheap and suited for spying.

the above picture shows a sketch of the apparatus. any vibration of the movable mirror M1 – actually the spied window – is translated in a variation of the interference pattern, simple enough to be analyzed in real time and converted into sound. using infrared laser diodes (extremely cheap and easy to process with a webcam) you get an invisible, passive, hard to detect “bug”. there are some technical difficulties but any student with basic understanding of the interference process is able to solve them.

my security advice: along with searching for hidden microphones one should be careful talking in a room with outside windows. and no, thermopane® windows are not immune but a thick curtain can greatly improve your privacy.

photo source: here.

bogdan » cheap low power PIR sensor

09:12 pm on Sep 23, 2012 | read the article | tags:

recently i had a problem. i needed to build a wireless PIR sensor that could be powered by a LiPo 1400mAh battery. seems like a lot of juice, but thinking that the wixel draws usually almost 30mA and a mangled PIR sensor 8mA, the sensor would have to be recharged every 1.5 days. not a practical approach. through some neat hack i managed to send the wixel in sleep mode, making it draw less than 100uA, but still had the power hungry PIR sensor.

today i managed to solve this problem also. using a cheap (~$15) PIR sensor with a nice housing and a few components i managed to bring the PIR sensor as low as 1.6mA (measured), making the battery last for 34 days. here’s how:

first remove the PIR element. it’s quite big component, encased in metal and with a window for sensing IR radiation. be careful when removing it as it is quite a sensitive component! then gather the components and build this schematic:

components list:
IS1 is the PIR element. this component was on my Eagle library and matched the dimensions of the one i recovered.
R1, R3 = 47K
R2 = 18K
R4, R8 = 1M
R5 = 1K
R6, R7, R9 = 100K
R10 = 330K
C1, C7 = 10uF (there is no mistake! C7 is 10uF but can be polarized. i used tantalum capacitors)
C2, C3 = 4.7uF
C4, C5, C6 = 10nF
IC1A, IC1B = TL082
JP1 = a 3 pin connector in which 1 = +3V3, 2 = signal (connect to wixel P1_0), 3 = GND
JP2, JP3, JP4 = 2 pin connectors as there’s always a good idea to serve power to other devices

the R9, R10, C7 group sets the sensitivity of the PIR sensor. this setup worked for what i wanted but trust me, it took about 3 hours of testing to get to those values and configuration. the interrupt on P1_0 of the wixel should be configured for raising edge, not falling. R10 is needed to lower the IC1B output potential below the interrupt threshold. an IR event sends the IC1B output close to 3.3V followed by a drop to almost 0V then back to almost 1.65V (this is the value you should have when idle). with R9/R10 the idle voltage is close to 1.26V making the interrupts stable. setting R10 higher, moves this point close to 1.65V when the interrupts are unstable. making it lower decreases the sensitivity. i don’t recommend getting under 56K (standard value) as the interrupts cannot be triggered anymore.

i drew inspiration from Micropik’s D203B PIR element datasheet.

bogdan » wixel PM3 low power sleep mode (CC2511F32)

10:18 pm on Sep 22, 2012 | read the article | tags:

don’t know if you have any idea what this is, but i love the wixel. it’s a CC2511F32 based device that works basically like every arduino except that it has a embed wireless transceiver. i got mine from watterott. the wixel is a nifty little device, good for connecting sensors to a PC, both wired and wireless. the problem for the wireless approach is that the device is power hungry 30mA is quite a lot for a battery powered app. but luckily, CC2511F32 is made by texas instruments that addressed this issue: it has a sleep mode in which it consumes less than 1uA.

here’s a small code i’ve wrote to test this sleep mode, based on blink led. it blinks the led 10 times, then powers down and waits for a falling edge on P1_0 (remember to connect this pin with a resistor to 3V3 in order to make the device sleep, otherwise P1_0 is quite sensitive).

#include <wixel.h>
#include <usb.h>
#include <usb_com.h>
#include <stdio.h>

int32 CODE param_blink_period_ms = 500;
int32 CODE param_count = 20; // counting 20 changes of the red led state, then go to sleep
uint32 count = 0; // the actual counter

uint32 lastToggle = 0;

/* catch interrupts on P1INT					*/
ISR (P1INT, 0) {
	/* clearing the CPU interrupt registers			*/
	/* 1. first the general interrupt register, IRCON2	*/
	IRCON2 &= ~0x08;				// clear IRCON2.P1IF
	/* 2. followed by the P1 interrupt register, P1IFG	*/
	P1IFG &= ~0x01;					// clear P1IF0
	/* not related to the interrupt itself, but to the	*/
	/* sleep mode: clear SLEEP.MODE flag			*/
	SLEEP &= ~0x03;					// clear SLEEP.MODE
	/* disable interrupt only for P1_0			*/
	P1IEN &= ~0x01;					// clear P1_0IEN
	/* wait, disabling interrupts on P1 also :)		*/
	IEN2 &= ~0x10;					// clear IEN2.P1IE

/* the function that puts the system to sleep			*/
/* i've chosen PM3 as i don't need a timer wake-up event	*/
void putToSleep () {
	/* make the P1_0 a input pin				*/
	P1DIR &= ~0x01;					// P1_0DIR = 0 -> input
	/* clear any interrupt flags. see above for details	*/
	IRCON2 &= ~0x08;				// clear IRCON2.P1IF
	P1IFG &= ~0x01;					// clear P1IF0
	/* set the interrupt enable flag on P1_0		*/
	P1IEN |= 0x01;					// P1_0IEN = 1;
	/* set the type of interrupt: 0=rising edge; 1=falling	*/
	PICTL &= ~0x02;					// PICTL.P1ICON = 0
	/* set the interrupt enable flag for the entire P1	*/
	IEN2 |= 0x10;					// IEN2.P1IE = 1;
	/* enable global interrupts				*/
	IEN0 |= 0x80;					// IEN0.EA = 1;
	/* the sleep mode i've chosen is PM3			*/
	SLEEP |= 0x03;					// SLEEP.MODE = PM3
	/* idling the CPU - required in the manual		*/
	if (SLEEP & 0x03) PCON |= 0x01;	// PCON.IDLE = 1;

void updateLeds()


    if (getMs() - lastToggle >= param_blink_period_ms/2)
        lastToggle = getMs();
		/* the piece of code that counts and if the counter	*/
		/* hits the limit, puts the system to sleep		*/
		if (count == param_count) {
			count = 0;
			/* here the blinking freezes, waiting for a	*/
			/* falling edge on P1_0				*/

void main()

bogdan » webstock 2012

09:22 pm on Sep 18, 2012 | read the article | tags:

pentru prima dată voi participa la un eveniment dedicat online-ului. webstock 2012. am primit chiar astăzi invitația de la cristian manafu. m-am înscris din curiozitate și din dorința de a cunoaște (cu puțin noroc) personal oamenii ale căror gânduri le citesc în fiecare dimineață. revin cu detalii.

bogdan » viteza sunetului în vid (sic)

08:26 am on Sep 17, 2012 | read the article | tags:

mi-am adus aminte de o afirmație prezentată ca «Fact» în numărul din august al «Știință și Tehnică»:

Viteza sunetului în vid este de aproximativ 1100 km/h.
(S&T / august 2012 / pg. 12)

chiar și cea mai atehnică persoană, cu acces la DEX și noțiuni elementare de logică își poate da seama de inepția unei astfel de afirmații:

SÚNET, sunete, s. n. 1. Vibrație a particulelor unui mediu elastic care poate fi înregistrată de ureche.
VID, -Ă, vizi, vide, adj., s. n. 1. Adj. (Despre un spațiu) Care nu conține nimic; care nu conține aer sau alt gaz; care nu este ocupat, locuit; pustiu.

altfel spus, în vid, unde nu există particule care să vibreze, sunetul nu se poate transmite. în articol apare totuși o valoare, 1110 km/h. fiind legat de saltul cu parașuta a lui Felix Baumgartner, de la 29455m, pot să vă spun cu certitudine că viteza respectivă se referă la viteza sunetului la altitudinea de la care s-a realizat saltul, unde încă mai există atmosferă și mediu elastic prin care să se propage unda sonoră.
valoarea corectă variază în funcție de temperatură, între 1062 Km/h (-57°C) și 1083 Km/h (-48°C).

pentru pasionații de calcule, puteți încerca să determinați viteza sunetului folosind formula următoare:
$$v = \sqrt {\gamma \frac {p}{\rho}}$$
unde γ = indexul adiabatic,
p = presiunea atmosferică,
ρ = densitatea aerului;
sursă foto: Smith College

bogdan » mai avem vre-o sansa pe 2 decembrie?

02:54 pm on Sep 15, 2012 | read the article | tags:

pentru început trebuie să își spun că nu sunt afiliat politic. nici măcar la modul subtil, în care să declar că n-am adeziune semnat? și în același timp să particip la birouri permanente și ?edin?e de partid. sunt simpatizant PSD prin prisma prietenilor care au aderat la acest partid și adept al ideologiei libertariene.

mi-aduc aminte cum în 2004 comentam cu ni?te prieteni după alegeri, că alian?a DA nu avea suficienși oameni competenși pentru a-i promova pe pozișiile de conducere controlate politic și a recurs la promovarea unor necunoscuși, semi-competenși, care nu aveau nici cea mai mică idee despre conducerea institușiei la care urmau să fie deta?ași. din nefericire, efectele negative ale acestei politici au fost întârziate de avântul economic care prevestea criza și de un control central spartan, creând impresia unui mecanism competent și perfect funcșional: o alternativ? viabil?.

în prezent, lucrurile stau altfel și sunt exprimate destul de clar în părerea unui prieten: «de când sunt ai no?trii la guvernare ne merge mai r?u». USL a întinerit avangarda pierzând r?bdarea, experien?a și competen?a care i-au făcut omnipotenși înainte de 2004.

preluarea guvern?rii de către USL a fost o gre?al? tactică major?. pe fondul unui declin economic și a unei redresări artificiale pentru a îndeplinii cerin?ele creditorilor, PD-L a l?sat o adev?rat? bomb? cu ceas la palatul Victoria: investișiile p?guboase, gestionarea deficient? a fondurilor europene și colapsul companiilor de stat. sincronizarea USL cu exploziile programate nu a putut fi mai potrivit?, transformând alian?a dintr-o alternativ? viabil? într-un magnet pentru dezastre.

în plus, anii de opozișie și-au spus cuvântul iar structura PSD și PNL a fost erodat? atât de lipsa fondurilor cât și de procesele în care au fost implicași liderii acestor partide. pline de oportuni?ti migrași după declinul guvern?rii PD-L, cele două partide se confrunt? în acest moment cu lipsa unui efort focalizat, gestionat central care să le asigure impulsul necesar pentru a-și asigura victoria în toamn?, lucru confirmat de e?ecul referendumului. dacă la un moment dat, cuvântul generașiei Iliescu producea cutremure, în acest moment condamnarea lui n?stase a scos la iveal? vulnerabilit?șile acestei generașiei, având ca efect direct (dar trecut cu vederea) anarhia.

concluzia comentariului meu este că, deși mai e timp până pe 2 decembrie, viitorul sun? mai r?u ca niciodat?. sper să mă în?el.

bogdan » 1st incompletness theorem

| read the article | tags:

or better stated, unless we have infinite uncountable processing power we will never be able to describe the universe starting from our knowledge.

in 1931, at 25 years old, Kurt Goedel proved two theorems central to modern science. named incompleteness theorems, they set a bound on the limit of our knowledge at a specific time, pushing the “know it all” objective far beyond any imaginable horizon and extending our quest indefinitely.

1st incompletness theorem (as stated by Stephen Cole Kleene in 1967)

Any effectively generated theory capable of expressing elementary arithmetic cannot be both consistent and complete. In particular, for any consistent, effectively generated formal theory that proves certain basic arithmetic truths, there is an arithmetical statement that is true, but not provable in the theory.

in simple words the theorem states that starting with a finite set of rules that can generate numbers and simple arithmetic on them, there are statements that cannot be proven or unproven using only the starting rules. more over, there’s no algorithm that can extend (even infinitely) the initial set of rules in order to cover all the statements involving the constructed numbers. the theorem scales up to the size of the universe as all modern physics theories extend the simple arithmetic on natural numbers, thus in any physical system (as understood today) there are properties of the system components that will lay outside the boundaries of our knowledge.

definitions: uncountably infinite.

Einstein and Goedel - Princeton 1950

photo: Oskar Morgenstern, institute of advanced study archives

bogdan » surreal numbers

09:15 pm on Sep 10, 2012 | read the article | tags:

the field of surreal numbers is the largest totally ordered field that can be constructed. it’s nice2know because of the elegant construction and the neat ideas behind it.

let’s start with a totally ordered set and a rule:

“given two subsets, L and R of the initial set, with L strictly less than R, {L|R} will denote the number strictly greater than L and strictly less than R”.

we can now elegantly construct:

{|} ~ 0 (where both L and R are empty sets);
{0|} ~ 1 (where L={|} and R is empty);
{1|} ~ 2 … {n|} ~ n+1, thus embedding the natural numbers.

making L empty and R one of the “naturals” we get negative integers: {|n} ~ -n-1

we can extend further the initial set closing it with respect to {0|1} ~ 1/2 and thus embedding the dyadic numbers set, which is a dense set in reals.

following the density of dyadic numbers, for any real number a we can construct infinite dyadic subsets L and R for which L < a < R, i.e. {L|R} ~ a.

the construction goes even further, building transfinite numbers like {{1,2,3,…}|} ~ ω and {0|{1/2,1/4,1/8,…}} ~ ε.

each surreal number has more than one representation, much like fractions. ex: 1/2 ~ {0|1} ~ {1/4|3/4}. this is why i avoided to use {0|} = 1.

field, totally ordered set, dense set, transfinite number

painting: joan miro – dancer

bogdan » coheed and cambria

10:59 pm on Aug 31, 2012 | read the article | tags:

the first time i’ve heard coheed and cambria was on the soundtrack of tim burton’s production 9, and they made a strong impression with «welcome home». little did i know that each song is actually part of story following coheed and cambria kilgannon’s struggle against wilhelm ryan, the supreme archmage of heaven’s fence.

(image src: watchplayread.com)

coheed and cambria – domino to destitute, coheed and cambria – welcome home

bogdan » mac no more

11:13 am on Aug 26, 2012 | read the article | tags:

nu m-au convins caloriile, conservanții sau «supersize me». m-au convins nesimțirea, dezorganizarea și tratamentul preferențial al clienților din restaurantul pe care îl frecventez. un mecanism care în toată lumea merge ceas nu are nicio șansă în fața indolenței angajatului român.

aceast sait folosește cookie-uri pentru a îmbunătăți experiența ta, ca vizitator. în același scop, acest sait utilizează modulul Facebook pentru integrarea cu rețeaua lor socială. poți accesa aici politica mea de confidențialitate.