This week, I learned how to work with a solenoid valve. For my final project, I’m working on a surface that changes shape, and am considering using either inflatable cells or solenoid actuators to do so. Conveniently, Axel introduced me to pneumatic valves that control flow with a solenoid valve, so I was able to work this week on one board that could work for both output devices.
Since I’ll be testing multiple options over the next few weeks, I redesigned my board from Week 4 to include a header that could allow other boards to connect to the extra pins on the Attiny44. Then, I designed a breakout board to control the solenoid with a button.
I added a button to the breakout board that would send a High or Low signal to one of the ATTiny pins, depending on whether or not it was pressed.
The solenoid valve I borrowed from Axel was spec’d at 9v, so I’d need more than the 5v that the FTDI supplied. I used the lab’s power supply to provide the 9v.
The lab’s power supply connected to the solenoid valve to test it before connecting to the pcb:
I used a mosfet to control the current. One pin, the gate, was connected to an open pin on the ATTiny. Depending on whether this value is low or high, it will allow current to flow between the other two pins, the drain and the source.
A diode prevented current from flowing backward when the solenoid returned to its original position.
It took three tries and many hours of troubleshooting to get this right.
The mosfet (with the sink and drains confused)
A remade board with with the sink and drain connected properly)
A jumper wire to connect the two grounds (with a misguided and later removed resistor):
All in all, I learned a lot this week. It was a challenge to debug with so many new parts that could have been backwards, and I spent a lot of time with the multimeter.
I could see that the correct pins were connected to the button and the mosfet gate using the arduino’s blink program and multimeter, but was confused by some of the voltages I was getting – ultimately the mosfet’s connections were the biggest culprit.
The final setup:
The debugged breakout board:
In the end, it worked. I hooked up one end of a hose to a rubber glove, and tested it with the button:
Down the road, I’ll consider other means of providing a pressure source…