Inserting Coins
Credit Mechanism
The whole process of accepting coins into the wallbox is comprised of at least three major components:Slug Rejector
The slug rejector is a mechanism that uses magnetic fields and mechanical components to determine whether an actual coin has been inserted, or simply a "slug" of similar dimensions. Its operation is perhaps best explained by this excerpt:Here's what my wallbox's slug rejector actually looks like:
Wall-O-Matic 100 Slug Rejector |
Coin Switch Assembly
Once a coin has successfully passed through the slug rejector, it hits one of the three coin switches within the coin switch assembly:These switches toggle different components of the credit assembly, depending on what kind of coin was inserted.
Credit Assembly
When the coin switches are toggled, the credit assembly electromechanically counts the "credits" using gears and solenoids:Credit Solenoid & Switch Assembly |
Once sufficient credit has been recorded, the program light is illuminated and the selector buttons are unlocked.
Relay Circuit
Fairly early on in this project, it was clear that I didn't actually want family and friends to have to put actual coins into the wallbox. Sure, its kinda neat to do every once in a while, but I'd rather not have keep a pile of coins nearby and constantly open it to empty the coin tray. Thankfully, simulating a coin drop is actually quite easy. All you have to do is solder some wires to the coin switch terminals, and momentarily short them as if a switch had been toggled.Coin Switch Assembly /w Control Wires |
Now the easy way to do this would simply be to install a button somewhere. But what's the fun in that? If I'm going to be connecting a microcontroller to this thing anyways, I might as well incorporate the "coin drop" into its functionality.
Circuit Design
In theory, this is actually quite easy to do. You just need to bring wires from the coin switches to outside the wallbox, and connect them to a few relays (one for each switch).
In practice, there were some additional considerations:
- I wanted to maintain complete isolation from the microcontroller side to the wallbox side, just like I was doing for the signal pulses
- I needed to drive the relays with something like "logic level" signals
- Relays capable of doing the job needed at least 5VDC to function
Relay Power Supply |
The next thing I needed were three instances of this opto-isolated relay driving circuit:
Relay Circuit (x3) |
While this all looks fairly straightforward, I did run into some interesting problems figuring all of this out.
Making it work
The first problem was getting the relays to actually trigger. These relays were designed with diode protection, something I'd never used before, and thus only worked if connected in a single direction. They are also reed-switch relays, and don't actually make any noise when switching. Throughout most of this process, I had a multimeter in continuity-beep mode with its probes across the relay's load pins. It was quite satisfying when I finally got it to beep.
The second, and perhaps larger problem, was actually getting the relays to trigger when running off my own driver circuit. I could get them to work off my bench power supply, but every time I used my own circuit it was a complete fail. It seemed as though I was having issues getting the 5V supply to work correctly.
During my initial frustrating attempts, I somehow managed to short something and blow up or fry a couple regulators and relays. When it still didn't work, I thought the regulator must not like the oscillations of rectified AC and needed a bigger input capacitor. So I put the biggest capacitor I could find across the inputs... A 6600uF 25V monster that was in my bin... All of a sudden, everything seemed to be working... And then it exploded...
After picking up most of the larger pieces, my breadboard looked like this:
Breadboard After Capacitor Explosion |
It then occurred to me that I was probably over-driving that capacitor. The output of my diode bridge was supposed to be a rectified 25VAC wave, which should have been right on the edge. Of course AC voltage is actually measured by RMS, not peak. So doing the math, my peak was actually closer to 35V.
Of course once I measured things, it was actually even worse than that. Everything up until this point had been assuming my main transformer was getting 115VAC and outputting 25VAC. Close, but not quite:
|
|
The next thing I did was try again with a capacitor rated for 50V. This time nothing blew up, thankfully. However, the relays also didn't work. I then began to notice a very odd problem. Apparently the regulator consistently produced a 5V output whenever I measured it at idle, but instantly dropped to around 1V whenever I put any load (including a simple resistor) across it.
Time to look at the datasheet:
LM7805CT Absolute Maximum Ratings |
Fortunately, I had one more option. Like most transformers, mine had a center tap. I didn't originally think I was going to need it, but now it seemed like a useful option. Measuring from the center tap, I had a more reasonable input voltage to work with:
Transformer Center Tap AC |
No comments:
Post a Comment