Making green eyes sensor activated

I moved in with my mom some weeks ago. During the tour of the house, we where in the basement and I noticed this guy up under the ceiling at the end of the hallway. Look at this thing!

wooden mask guy 1

wooden mask guy 1

– “What the hell is that?”
– “Oh.. That guy.. He hung there when we bought the house..”

I joked that I could make his eyes glow.

Well.. While debugging some electronics the other day, and figured I should make reality of that joke.

I had everything needed :

Stuff needed

My soldering iron was in a box far far away.. Luckily old fashion jumpers and tape will take you far ;)

Low tech solution

Low tech solution

The motion sensor module has a working voltage between 5v and 20v, and a level output voltage at 3.3v. I connected the two LED’s in parallel to the output line. I sat the sensor module to react at the longest possible range, and to hold the lights activated for about 4 or 5 seconds.

It worked out great. Where ever you enter the hall way the lights will turn on. I feel the sensor being a bit too big for this project. But it was nice putting it to work.

Wooden mask guy with motion activated green eyes

Wooden mask guy with motion activated green eyes


Raspberry Pi visual notification: mIRC and light chain

This is a real walk down memory lane: Scripting with mIRC! 10-15 years ago this would have been as awesome as air. Visual notification on activity in a chat channel. Nowadays there’s not much action on IRC, at least not where I’m hiding out..

The idea came when I got some very belated (5 months..) goods from Hongkong this week. Among other stuff a light chain/christmas lights. Five months ago my plan was to lighten up the dark Norwegian winter.. I had 20 min to spare and figured I should put them to use anyway.

I haven’t been scripting in mIRC for ages, had to dig up some old code from 2005. Back then I did a lot of stuff with mIRC. I even made a working IRC server at one point..

; LightNotify v0.1 for mIRC
; René 28.04.2014
on 1:text:*:#:{
  ; Something is said in any channel
  ; and mIRC window is not active notify me
  if (!$appactive) {
    notifyMe yes

alias notifyMe {
  if (($1 == yes)) {
    turnLight on
    .timerIsActive 0 5 isActive
  elseif ($1 == no) { turnLight off }
alias isActive {
  if ($appactive) { notifyMe no | timerIsActive off }
alias turnLight {
  if (($1 == on) && (%lightison == 0)) { sockopen lightsocketON 80 }
  elseif (($1 == off) && (%lightison == 1)) { sockopen lightsocketOFF 80 }
on 1:sockopen:lightsocketON:{
  if ($sockerr) { echo -st Light notify: (socket: $+ $sockname $+ ): error: sockopen failed (too many requests?) }
  sockwrite -n $sockname GET /locallight.php?turnem=on HTTP/1.1
  sockwrite -n $sockname Host: $+ $crlf $+ $crlf
on 1:sockopen:lightsocketOFF:{
  if ($sockerr) { echo -st Light notify: (socket: $+ $sockname $+ ): error: sockopen failed (too many requests?) }
  sockwrite -n $sockname GET /locallight.php?turnem=off HTTP/1.1
  sockwrite -n $sockname Host: $+ $crlf $+ $crlf
on *:sockread:lightsocket*:{
  if ($sockerr > 0) { echo -st Light notify: (socket: $+ $sockname $+ ): error: sockread failed | goto w }
  else {
    var %count
    sockread %lightison 
    ;echo .. %lightison ;debug
    inc %count 1
    if (%count == 9) { goto w }
    goto nextread
  echo -st Light notify: %lightison 
  sockclose $sockname

Basically, when someone talks in a channel, it checks if the mIRC program is in focus. If it isn’t it makes a http-call to a php-script (described here) on the RPi. Then it sends another call, to turns the lights off, when the program regains focus. Added some simple print notifications to the status window (echo -st ..).

It’s pretty much the same concept as the “Neighbor controlled christmas lights“, simple. But it was fun playing around with the mIRC syntax again.

Will I be using this? Well.. probably I will leave it on until the next project comes around.
Next project should be visual notification of the Facebook chat.. :P