How do I get a light sensor to trigger a linear actuator?

Hello There

I want to trigger a linear actuator by with a luminosity sensor.

I have a Raspberry Pi 3 and a light sensor module see link Using light sensor module with Raspberry Pi | UUGear

The linear actuator raises and lowers a ramp in a chicken coop.

I am hoping someone can explain how I can view my sensor as a device in my Cayenne control panel and how to see the linear actuator, do I treat it as a motor?

If an Arduino is more appropriate for this project I can lay my hands on one quite easily

Many thanks in advance

Welcome to Cayenne!

According to your link the module just outputs a high or low signal, so you can add the sensor using a generic digital input widget, then create your trigger based on that. Your output for the trigger would obviously depend on how you are connecting it to the pi. If you need any help with that just post back some more details.

(my touch pad drawing skills need some work apparently)

Thanks for your help with this.

OK, I’ve got a light to come on and go off appropriately when light does or does not strike the sensor.

My linear actuator is nice and simple, it opens and closes to its full extent. So my hope it that in low light the linear actuator activates, and then in brighter light, the linear actuator again but in the opposite direction.

Can you see a problem with this?

Many thanks

Seems like it should work to me, let us know!

Yeah @jerrydyer, let us know! And don’t forget to post your project to the ‘Projects Made with Cayenne’ category. The Cayenne team loves seeing projects from the community :slight_smile:

To test the theory, and before I go to the trouble to connect the linear actuator. I got myself an ordinary little 12v motor, connected it up following the instructions on the tutorial, but although I can get the motor icon to change from coloured to grey, the motor only continues to turn, I cannot turn it off.

When I start the Pi i hear the relay click and the motor starts. When I shut down the pi I hear the relay click off again

I’m using a Pi3 model B and DSP ARM PIC – 10A relay

I must be doing something wrong, any ideas?

Many thanks

Any ideas anyone?

Can you double check your pins? Sounds like you might be a pin off or something. Also some pictures or circuit diagram would be helpful.