Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

How to make PhotoCell to Operate Solenoid
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to make PhotoCell to Operate Solenoid

by eclecticeric on Tue Aug 04, 2020 5:33 pm

I want to build a "robotic" hurdy gurdy, similar to a player piano. The hurdy gurdy has 24 keys, and the plan is to use 24 of these https://www.ebay.com/itm/262492555403 solenoids to operate levers which strike the keys. A player piano uses rolls of punched paper to operate, but I would like to use rolls of white paper with black "dots" where each note should occur . There would be 24 "channels" on the paper roll, read by 24 of these, say. https://www.adafruit.com/product/2831. I can handle the mechanical side of things, but am having problems figuring out how to make a solenoid operate when the photocell sees a "dark" dot. Any help on what sort of circuit (or maybe Arduino(s) ) to do this would be greatly appreciated.

eclecticeric
 
Posts: 2
Joined: Tue Aug 04, 2020 5:15 pm

Re: How to make PhotoCell to Operate Solenoid

by dastels on Tue Aug 04, 2020 6:17 pm

You could have a microcontroller board with an analog input for each phototransistor which they would measure the light reflected in front of them (or have the paper backlit and measure the light coming through it... same result). Then you could control the solenoids via a digital output. Since you'll need 24 analog inputs and 24 digital outputs, you'll need a board with lots of I/O. Even the The Grand Central M4 Express (https://www.adafruit.com/product/4064) only has 16 analog inputs. If you could get the light difference (and thus the transistor conduction) to vary enough between dark and light you could treat it as a digital input, in which case the Grand Central has plenty of I/O capability.
.
You would need a voltage divider for each phototransistor to convert its current to a voltage that could be measured. The datasheet as https://cdn-shop.adafruit.com/product-files/2831/HW5P-1_2015__1_.pdf has the simple circuit.

You'd also need a driver for each solenoid. See https://learn.adafruit.com/robotic-xylophone-with-circuit-python for a similar application.

A different approach would be to have each phototransistor feed directly to the corresponding solenoid driver and not use a microcontroller at all.

Dave

dastels
 
Posts: 3502
Joined: Tue Oct 20, 2015 3:22 pm

Re: How to make PhotoCell to Operate Solenoid

by eclecticeric on Fri Aug 07, 2020 12:30 am

Thank you for your input - it gives me some good ideas. I'll look into using a Grand Central, and also the possibility of just using the photocells along with pull down resistors and , I guess, 24 simple amplifiers or possibly relays to get enough current to actuate the solenoids .

eclecticeric
 
Posts: 2
Joined: Tue Aug 04, 2020 5:15 pm

Please be positive and constructive with your questions and comments.