OK, so i finally bought a small multimeter and found my voltages were switched.I've verified that 5v is powering the arduino (and it is working through the barrel jack). 12v is for the solenoid and it isn't working.If the lights go out the arduino fires the led which tells me that the solenoid should fire too but no luck.
Here's the code so you can see inputs and outputs- like I said earlier- if the arduino is powered via usb (ie I don't use the barrel jack) then it all works.
Just to finish this up...Here's a youtube link to the actual lightbot/ light activated solenoid:http://www.youtube.com/watch?v=uKobvpq5DhI&feature=youtu.beThis was my first arduino project.It is really a combination of 3 smaller beginner tasks:blink an LEDUse of a photoresistorControl a motor or solenoid with a mosfet transistorI combined all 3 to fix an annoying problem at work: The building control system turns out the lights at 6 or 7 pm but we stay til 1am.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16