I just finished a project for an automated reading lamp to turn on when I sat in my trusty reading chair. The project involved a switch/sensor for when I sat down. An atTiny85 read for the input, and upon receipt, sent an output signal through a transistor, then to a relay. The relay was then supposed to trigger the lamp to turn on.
Unfortunately, it didn't work.
I originally built the prototype on a breadboard, running an Arduino's 5v output though the relay (switch), and it worked when I sat down to light an LED. The final result used 5v though a wall adapter to run the atTiny circuit. The relay (coil/sensor) was hooked up to this as well, as it was with the prototype. The difference in the final project is its on a homebrew PCB now, and instead of running 5v through the relay (switch), it's running the 120vac required by the lamp. By everything I can tell, the relay is rated to perform this.
Hopefully, someone can take a look at the curcuit, and see something I missed.
The parts I used are:
Relay- OUAZ-SS-105D
Transistor- BC547
Circuit Image here:
http://tinypic.com/r/bgtflh/8
~All of the "To" or "From" parts are terminal board wire connecters.
The "To AC" connector connects to the AC plug side of the power cord, and the input of the 5v DC adapter.
The "from regulator" connects to the output of the adapter. I measured here, and I am getting 5vDC.
The "to sensor" simply connects to the sensor that detects when I sit in the chair. It sends the analog reading to the atTiny85 on pin2, then sends an output on pin7 to the transistor, which should trigger the relay.
The "To Lamp" connects the other end of the AC line to the lamp.
Really stumped now as to what went wrong from breadboard/dc/led to PCB/AC/Lamp.
Thanks for any help you can provide.
Unfortunately, it didn't work.
I originally built the prototype on a breadboard, running an Arduino's 5v output though the relay (switch), and it worked when I sat down to light an LED. The final result used 5v though a wall adapter to run the atTiny circuit. The relay (coil/sensor) was hooked up to this as well, as it was with the prototype. The difference in the final project is its on a homebrew PCB now, and instead of running 5v through the relay (switch), it's running the 120vac required by the lamp. By everything I can tell, the relay is rated to perform this.
Hopefully, someone can take a look at the curcuit, and see something I missed.
The parts I used are:
Relay- OUAZ-SS-105D
Transistor- BC547
Circuit Image here:
http://tinypic.com/r/bgtflh/8
~All of the "To" or "From" parts are terminal board wire connecters.
The "To AC" connector connects to the AC plug side of the power cord, and the input of the 5v DC adapter.
The "from regulator" connects to the output of the adapter. I measured here, and I am getting 5vDC.
The "to sensor" simply connects to the sensor that detects when I sit in the chair. It sends the analog reading to the atTiny85 on pin2, then sends an output on pin7 to the transistor, which should trigger the relay.
The "To Lamp" connects the other end of the AC line to the lamp.
Really stumped now as to what went wrong from breadboard/dc/led to PCB/AC/Lamp.
Thanks for any help you can provide.