Hein Hacks

Hein Hack One – Xenon Flash
Hein Hack Two – Halloween / Birthday special
Hein Hack One AND Two – Video

At my job, an anatomical model of a skeleton stands in front of the window facing the corridor. The Dutch name for Grim Death is “Magere Hein”, so the skeleton was aptly named “Hein” (also a common Dutch name). Since a skeleton standing alone on its pedestral is deadly boring (pun inteded), Hein was given a birthday (Halloween), and is dressed up occasionally to reflect the current season, his birthday, or dressed in orange to support the Dutch soccer team. He’s even got something I haven’t got: a Facebook page!

Hein Hack One

View to Hein from the corridor


The first hack is something created to celebrate summer / holidays! Hein had been standing watching the corridors for some months, and we thought we saw a twinkle in his eye socket when the first summer sun rays entered our office. What better occasion to give him a real summer outfit?
With a really cool Hawaii shirt, flipflops and the coolest sunglasses ever Hein was ready for the summer… Wasn’t he? What he really needed was something to remember these beautiful days, put it in his memoires. He needs a point and shoot camera!

Flash!

For quite some time I had the idea of making something interactive with Hein, reacting on the people passing by. Our corridor is a busy traffic route, and due to the dressing up many people keep an eye out for Hein.
When Tkkrlab, the local hacker/makerspace was moving I could confiscate one of the old infrared movement sensors from the -soon to be destructed- building. I thought it would be quite a joke to make Hein flash a disposable camera when someone would be passing him by from a small distance. I set out buying a 4€ disposable camera and tried to figure out how to connect that to the PIR sensor.

PIR Sensor

The PIR sensor I got was a very old type, but had very simple connections: power supply should be in the 12V range, detection of movement was indicated by opening a relay connection. The normally closed relay contacts were both available on a terminal block.

Camera

Now to the hairy work: getting the camera triggered. The camera I had bought works as follows: when you would like to make a picture with flash, you need to press a button on the front of the camera until a small (neon) light starts flashing. When you trigger the camera, the flash is turned on. I had been searching on how the circuit was working for some time when I found this marvelous site on xenon flash circuits in disposable cameras. The first schematic on the site is equal to what I found in my camera. The circumstances for the trigger circuit were:

  • The PIR sensor gives pulses between 1 and ….(?) seconds, as long as movement is present
  • The PIR sensor relay is not able to switch the normal ‘trigger’ connections since the voltage across the terminals is circa 300VDC
  • The flash circuit is quite sensitive to changes. As it is a resonant circuit, adding components in the circuit changes the frequency of pulsing, resulting in lower output voltages or very irritating audible whining. Hein is standing in my office, so whining should be minimised ;)
  • This is one of the dirtiest hacks I’ve done, circuit wise. All values are based on availability in my shelves, all component choices as well

Modified Xenon Flash Circuit

Modified camera circuit. Click for PDF


See the PDF linked to by the image on the left to see the camera schematic with the added components. All components that are not original to the camera itself are colored red. A small description:

  • An SCR (12TTS08) was used to trigger the flash. I also tried using a TRIAC, but could not get it to work reliably.
  • The trigger signal is tied to GND when noone is ‘seen’ by the sensor, and is 5V with 100 Ohms in series when the sensor does see movement

  • To limit the length of the trigger pulse (prevent continuous turn on after first trigger) the diode / capacitor circuit was used.
  • The FET in the lower left corner was a start on making the unit stop charging when -300V was built up on the main capacitor (eliminate whining). I intended using (a multiple of) zeners for this. As it turned out, adding the FET changed the efficiency of the charging circuit, and resonance frequency shot over the audible range. A bit good is good enough in this case….

Pictures of modification

Pictures were made during disassembly, so do this in reverse if you’d like to make the same thing ;)

Practical issues

PIR sensor mounting, cardboard flap limits view angle


At home, I finished the complete project, working satisfactory. I planned on placing the camera in Heins hands, and placing the sensor on a cabinet next to him, viewing the corridor. Unfortunately, this did NOT work. Glass blocks the infrared radiation which is used by the PIR sensor! With the help of colleagues we mounted the sensor between the piping in the corridor. A cardboard flap was used to limit the viewing angle of the sensor, so people who already know this gadget have the choice to walk by unblinded. 

Pictures of Hein

Reactions

  • I think about 50% of passers by don’t notice what happens / does not register flash as a strange thing
  • Those who do register start laughing 3 meters past the office, very funny to see this reaction time
  • Some people wonder what we do with the pictures. Since the camera is emptied out to make room for electronics, no pictures are taken. This generally ends up in a discussion on how to make use of a webcam, and/or a discussion on privacy

Hein Hack Two

Hein’s birthday was pinpointed to be on the 31st of october, aka Halloween. It seemed very nice to me to change Heins camera for something more appropriate.

Pressurize!

What belongs to a birthday? A blowout whistle! Inspired by this T-shirt cannon I thought I could make something comparable on a smaller scale. Although pressurized air generally is a very weak solution for pneumatics (CO2 cartridges keep pressurized longer because part of the CO2 is still in liquid phase) a blowout whistle does not need much air to inflate, and using a bicycle pump would make this a simple solution!

I used standard PVC piping which is NOT meant to be pressurized, so replicate at own risk…. To pressurize, I inserted a standard bike valve from a punctured inner tube which I glued with generous amounts of Bison
Kombi Power
. End caps were also glued on, in one of the endcaps I placed a 1/2″ adapter on which I screwed a cheap valve. I drilled out the orifice to 2.4mm to allow a bit more air to pass per unit time.
The other end of the valve was fitted with a 1/2″ adapter that was modified to a Pneufit connection for a standard pneumatic tube.


Hein with blowout whistle

Control

The completed pressure tank with valve was working as intended. Only a very short pulse to the valve would inflate the whistle (the flow is too small to let it actually sound a whistle, which is OK by me). The PIR sensor used gives longer pulses, and sometimes more after each other. I thought it would be nice if the pulse duration could be fixed, and some fixed time of inactivity / insensitivity of Hein could be devised.
Recently, I ordered an TI MSP430 Launchpad, and this would be a nice starter project. I installed the linux build environment, used pin interrupts and the 16-bit timer and got a very nice 16 whistle blows on 6 times pumping ;)

setup

– Bicycle pump to pressure tank
– MSP430 board is fed by 5V supply (coming from PIR sensor) regulated to 3V3 by TS1117
– Trigger signal is pulls down P1.3 (also connected to onboard switch) throught NPN transistor
– Valve is supplied by external supply, P1.0 from the MSP430 (also connected to LED) is switching the supply on or off through a power BJT (TIP120)
– Diode is placed over valve connections to prevent coil voltage damaging other circuitry.
– Blowout whistle is connected to tube with glue-lined shrink tubing

Silent video of effects

Sorry, I just didn’t have time to make something really flashy in a movie editor. I just wanted to show the effects.

Sourcecode for MSP430

#include <io.h>
#include <signal.h>
#include <stdlib.h>
#include <inttypes.h>

#define SW_PIN     BIT3
#define VALVE_PIN  BIT0
//delay in ms to keep relay open
#define DELAY_MS   50
//minimum amount of cycles to run before new trigger is processed
#define MIN_DELAY_CYCLES 100
#define MAX_DELAY_CYCLES 255

#define DELAY_CTR  (DELAY_MS/1000.0)*12000.0


volatile uint16_t delaycounter;

int main(void) {
// Stop WDT
  WDTCTL = WDTPW + WDTHOLD;	
//Enable LED / valve output
  P1DIR |=   VALVE_PIN;
  delaycounter = 0;
//SW is input
  P1DIR &amp;amp;amp;= ~(SW_PIN);
//SW pull up
  P1OUT |=   SW_PIN ;
//EN pullup
  P1REN |=   SW_PIN ;
//configure pin interrupt
  P1IES |=   SW_PIN ; //low-to-high transition
  P1IE  |=   SW_PIN ; //enable pin change interrupt
  BCSCTL3 |= LFXT1S_2;	//Set ACLK to use internal VLO (12 kHz clock)

  TACTL = TASSEL__ACLK | MC__UP;	//Set TimerA to use auxiliary clock in UP mode
  TACCTL0 = CCIE;	//Enable the interrupt for TACCR0 match

  WRITE_SR(GIE);	//Enable global interrupts

  while(1) {
	//Loop forever, interrupts take care of the rest
  }
}

interrupt(TIMERA0_VECTOR) TIMERA0_ISR(void) {
  //Clear Valve Pin
  P1OUT &amp;amp;amp;=  ~(VALVE_PIN);
  delaycounter --;
  if(delaycounter == 0)
  {
    //Stop counter
    TACCR0   =     0;
    //Clear interrupt flag for pin
    P1IFG &amp;amp;amp;= ~(SW_PIN) ;
    //enable interrupt on pin
    P1IE  |=   SW_PIN ;
  }
}

interrupt(PORT1_VECTOR) PORT1_ISR(void)
{
  uint16_t randomnumber;
//clear interrupt flag
  P1IFG &amp;amp;amp;= ~(SW_PIN) ;
//disable pin change interrupt
  P1IE  &amp;amp;amp;= ~(SW_PIN) ;
//clear LED
  P1OUT |=   VALVE_PIN  ;
//Let counter run 200ms
  TACCR0   = DELAY_CTR;
  randomnumber = rand();
  delaycounter =  MIN_DELAY_CYCLES + (randomnumber % (MAX_DELAY_CYCLES-MIN_DELAY_CYCLES));
}

5 thoughts on “Hein Hacks

  1. Thijs says:

    prachtig gewoon! we missen jou en je mooie/gekke/geniale klusprojectjes bij Atak :)

  2. [...] first skeleton-based build was last summer. The twinkle of the summer sun in [Hein]‘s eye socket made for a great [...]

  3. [...] If you him the Grim Reaper, Azrail, Magere Hein, or simply, ‘Death,’ he sure throws a good party. [Victor] has an anatomical model of a skeleton at his job named [Hein], and for his birthday party, his coworkers decided to throw [Hein] a party. [...]

  4. Joost says:

    Is er een reden dat er geen geluid bij zit? Maakt Hein ook daadwerkelijk blowout geluid? Spreek namelijk uit ervaring, met blowout hobby-project, dat geluid uit zo’n ding krijgen moeilijker bleek dan verwacht… :-)

    • admin says:

      Hoi! Er zit geen geluid bij omdat het snel met een camera met beroerde mic gefilmd is. De fluit geeft af en toe een soort ”fiep’ geluid, niet echt overtuigend. Ten eerste was dat niet de bedoeling, hij staat naast me, en da´s niet rustig werken met zo´n fluit naast je. Ten tweede zit er 2 meter slang tussen, en dat beperkt de luchtstroom behoorlijk. Ik krijg het zelf ook niet voormekaar om door de slang zo hard te blazen dat ´ie geluid maakt.
      Leuk dat je de site gevonden hebt!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>