Can I make an automatic coin flipper (work better)? #
This week was machine week, and our group madee an automatic decision maker that flipped a coin and ruled out decisions on the list.
While I was initially in charge of wire harnessing, I mainly worked on the controls for the solenoid in the coin flipper.
We tried to drive the larger solenoid with just the 5V signal from the hbridge board, but it did not produce nearly enough power for the solenoid specs (12 V, 300 mA). We then tried using the small solenoid, but it did not generate enough vertical height to flip the coin.
This was because the hbridge did not supply enough current for the larger solenoids. I decided to design a PCB that uses an external power source that provides 12V and enough current for the larger solenoid, which gives more force and has a longer vertical distance, which flips the coin higher and increases the randomness of the coin flip.
I still relied on the hbridge to send the signal to drive the solenoid, so I used an nfet which took the hbdrige 5V as the gate, the 12V wall power as the source, and the solenoid as the drain.

I also included a flyback diode to prevent back current flow, as the datasheet for the nfet suggested.

I had a few issues with soldering and traces ripping, so I remilled the board. I then used wagos to attach the solenoid to the PCB so we could interchange different solenoids if we wanted. We decided to use the longer skinnier solenoid in the end, which draws around 300 mA for 12 V.

I tested the PCB with the wall supply set to 12 V and using a power supply to provide the 5V for the gate.

After testing, the solenoid jumps up very well and makes a much more functional coin flip.
Reflections: #
- Testing components with a power supply is a great way to debug, especially as you can vary the voltage and current parameters to see if it is a mechanical issue, or simply a lack of sufficient power.
- Use connectors and pin pads! I had a lot of issues with pads ripping, and next time I would definitely use more robust joints for the electrical connections.