Search This Blog

Friday, June 3, 2016

The M2 Smart NightLight Project.

This post introduces the  M2 Smart NightLight and decorative RGB lamp with BlueTooth capability.
This lamp is powered by an Arduino Mega256 and a PICAXE 08M2+ . The M2 has a Smart NightLight that is controlled with a Light detecting resistor and a passive Infra red sensor that senses movement in the dark. The nightlight will activate for 90 seconds with a pleasent warm red glow at low intensity and then turn off. The M2 has an interface PCB that holds the PICAXE 08M2 and connects the Arduino Mega256 to the LED strips. Other features include:

  • 2 RGB outputs for LED strips (Front and Backside)
  • 50 patterns of colorful RGB light
  • Capacitve touch switch
  • Two multi function knobs for adjusting parameters of patterns.
  • One Active Infra red sensor for determining distance/color ratio
  • One Passive infra red sensor for motion detection.
  • One 20x4 LCD display (backlight option)
  • Bluetooth enabled for choosing patterns.
  • Direct pattern access through keypad.
  • Static Patterns (patterns dont change)
  • Dynamic patterns (patterns have parameters like Brightness, Speed, etc. that are adjustable)
M2 video
The PCB I designed will be available this fall if there is any interest. Leave me a comment if you like this lamp. 

Thursday, August 20, 2015

PIR and Relay for an automatic light switch

Here is a project I made to turn on my basement light when someone enters the laundry room. I chose the PICAXE 08M2 for this because it was just the right little chip for the job. When I first started this project I thought it would be a straight forward "easy" thing to do, well, it was not!  There were little issues like the relay closing between sessions and annoying little timeing problems in my first attempt. I ended up throwing out the that plan and decided to give the FlowCharting method a try. After a few attempts I finnaly came up with this diagram.

I used two tasks here. One that just checks the Passive Infra-Red sensor over and over. And one task that acts like a control center. That is, when the first loop is triggered , it decides if it should turn on the light based on some criteria. One tricky thing I ad to overcome was if the system had already been triggered and a person as still in the room should the timer be reset or simply run out and then re-evaluate the situation. Designing something like this is not as easy as it looks at first. There are many considerations to take in to account. This flowchart seems to work OK so I decided to turn it into code. Here it is....
'
-----------------------------------------------------------------------------------------
symbol varA = b0
symbol varB = b1
symbol varC = b2
symbol varD = b3
symbol varE = b4
symbol varF = b5
symbol varG = b6
symbol varH = b7
symbol varI = b8
symbol varJ = b9
symbol varK = b10
symbol varL = b11
symbol varM = b12
symbol varN = b13
symbol varO = b14
symbol varP = b15
symbol varQ = b16
symbol varR = b17
symbol varS = b18
symbol varT = b19
symbol varU = b20
symbol varV = b21
symbol varTEMPBYTE1 = b22
symbol varTEMPBYTE2 = b23
symbol varTEMPBYTE3 = b24
symbol varTEMPBYTE4 = b25
symbol varTEMPBYTE5 = b26
symbol varTEMPBYTE6 = b27
symbol varTEMPWORD1 = w11
symbol varTEMPWORD2 = w12
symbol varTEMPWORD3 = w13
}


main:
Cell_7_2:
let dirsC = 23

Cell_7_3:
pause 1000 'Sanity delay, give time to initialize the PIR
Cell_7_5: ' Start searching for movement
if pinC.3=1 then

goto Cell_7_7
end if
Cell_7_9: ' No movement = LED off (RED), keep searching
low C.1
high C.2
goto Cell_7_5

Cell_7_7: ' Movement = LED ON (GRN), keep searching.
high C.1
low C.2
goto Cell_7_5

Cell_4_1:
start1:

Cell_4_2:  'Set the run timer for 60 secs in varD
let varD = 60    
Cell_4_4: ' Watch for movement, if true then...
if pinC.3=1 then

goto Cell_4_5
end if
goto Cell_4_4

Cell_4_5: ' ...Set the RUN timer to 0 secs.
let time = 0 '    
Cell_4_6: ' Start the RUN timer
enabletime
Cell_4_8: 'Run the sub that turns on relay and the then come back.
gosub prc_LightsON
Cell_4_10: ' Check the RUN timer, if NOT expired, keep checking until true.
if time >= varD then
goto Cell_4_11
end if
goto Cell_4_10

Cell_4_11: 'RESET the RUN timer to 0
let time = 0    
Cell_4_12: ' Check once more for movement, if not, shut off lights, keep looking.
if pinC.3=1 then

goto Cell_4_5
end if
Cell_7_12:
gosub prc_LightsOFF
goto Cell_4_4

Cell_1_9: ' ********* PROCEDURES ****************************************
prc_LightsOFF:
Cell_1_11: ' LIGHTS OFF
low C.4
Cell_1_12:
return
Cell_1_4: '  LIGHTS ON
prc_LightsON:
Cell_1_6:
high C.4
Cell_1_7:
return

#no_data 'reduce download time
-------------------------------------------------------------------------------------------------

Now that I had the code done, I needed to build a schematic for the circuit. I used a FREE program from DesignSpark.com The software can make schematics and PCB boards.


...And from the schematic I made this prototype to test it out. This was a pretty simple curcuit to make. It uses one input for the PIR sensor and three outputs. Two for the Bi-color LED and one for the Relay.

Everything went pretty smooth in testing so next thing was design a PCB for it.


I have not made this board yet. There are some errors on the board that I am trying to fix, but may not be able to. This is all a learning experience for me. I LOVE IT!  It can be painful, but its fun. 

JSK

Wednesday, June 17, 2015

LEDWAND and Light Painting

I have been working hard on a new project. It is a tool used for "Light Painting". 
  1. Light painting, or light drawing, is a photographic technique in which exposures are made by moving a hand-held light source while taking a long exposure photograph, either to illuminate a subject or to shine a point of light directly at the camera.

  2. I call it the LEDWAND. There will be more on the making and use of this tool on the Arduino page, but in the meantime here are some pics made with it. 
  3. There are several modes including this one.


  4. Removable filters allow all different kinds of accents like the to parallel lines shown here in the curve.

  5. Lots of sweeping colors here.

  6. I love taking these pictures. It is a blast!
  7. I am making a tutorial on how to this kind of photography to be posted here soon.
  8. :)

Wednesday, December 24, 2014

Here is a little short video I shot this morning of my bird feeder.
Spring is coming and the birds are back. AND hungry!

Sunday, October 12, 2014

My friend "Charley the Ghost".

Halloween is coming up.... So I decided to make a scary ghost decoration patterned off an article that appeared in Nuts&Volts magazine, Oct issue. The project is a cut out display that has movement and sound and light. A small child walks to the door and a light goes on, the ghost waves his arms and a spooky voice  warns of goblins and spiders. 

I made him from a piece of foam core board, two servo motors, a sound circuit and super brite LED and a PIR (Passive Infra-Red) movement detector triggered from a knock off Aruduino UNO board. When the PIR sensor is triggered by any warm blooded creature, the ghost springs to life all powered by a solar powered battery. Well, a 12 volt Solar powered and a small 9 volt battery. It was fun to make and the programming gave me some unforseen challenges to contend with. I think I will make some more of these for Christmas. Here are some pics of the proto-type. 
Above you can see the "Guts" of the ghost. At top is a four channel relay, the middle section is a bread board and at the bottom is the Arduino Uno. You can just make out the servo behind the Arduino and the one at far left bottom of picture.

You can see the sound board dangling as it fell down right before the shot was taken. I had an old speaker laying around salvaged from an old boom box with no housing or cover. I used a card board box that a clock came in to act as a speaker cabinet. I cut a hole in the bottom of the ghost and glued the "Speaker Box" in from behind.



His name is "Charley"  :)


Here is an early video of Charley in action.


Saturday, September 20, 2014

Nikon IR Remote with a Mini Pro.

I got a new toy today. I ordered a PIC Development board and a few extra PIC chips. They came today, but I have not had a chance to play with any of it yet. I have been busy with other projects which I will post on later. One of the projects is a Infrared remote shutter for my Nikon D90. It works well, but I would like to increase its range a little bit. I used an Arduino Mini Pro for this one. Here is a pic of it on the bread board....
Once I had the circuit working I tried to make it smaller. Here is a pic me testing it in action.."Click", it works!

So I added the Mini Pro and changed some resister values to increase the IR LED strength. I am having some trouble trying to find a decent case to contain it. The ones I have found are way to expensive. The cheapest one I found was using an electrical box and lid. They make the boxes out of plastic which makes it easy to rout out or drill holes for wires and such. Below are some pics with the Mini Pro on it.


 Above you can see the IR LED sticking out. This shoots a beam like light that MUST be pointing at the FRONT of the Nikon D90. The "spread" of light from this LED is narrow and pointing at the camera takes some practice. In these photos I had a button right between the IR LED pins that triggered the circuit and a red led that lit up to tell me when the IR led was firing. This was very helpful as you can't see IR light with your eyes at all.

Here it is trimmed down a little more. Replaced the button with a bigger one.

Code and wiring diagram will be posted if there is ANY interest.