Battery question (18650)

Ideas and instructions how you can make your own bondage toys.
Onwrikbaar
**
Posts: 95
Joined: 21 Sep 2018, 17:17
Location: The Netherlands
Contact:

Re: Battery question (18650)

Post by Onwrikbaar »

lobster wrote: As for the relay, I had another idea. Going with a MOSFET allows be to regulate the strength of the magnet using PWM. For getting into the bondage it can be very helpful to run the magnet at say 10% strength. If I include a current sensor in my design, I might be able to detect if the magnet is being put under load (as per the increase in current). This way I have a very natural point to fully engage the magnet and start the count-down timer.
Yes, being able to start a self bondage game by closing a magnet is very convenient, because then you don't have to guess how long your preparations will take :D

I'm pretty sure the magnet draws the same amount of current irrespective of the force exerted on the anchor plate. What you will be able to detect though, is changes in inductance. The magnet's coil's inductance is significantly larger with the metal plate on the armature (cuff closed) than it is with the plate removed (cuff open). When switching on the magnet, this difference in inductance causes the current through the coil to rise slower with the plate on it than without it. My Raspberry Pi program (see this topic) measures this time difference by means of a fairly simple driver circuit.
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

Onwrikbaar wrote:My Raspberry Pi program (see this topic) measures this time difference by means of a fairly simple driver circuit.
Thanks for the hint. I'm still waiting for the current sensor to arrive in the mail so haven't had a change to experiment. I did download your software, but it looks like all the 'magic' is locked up in a pre-compiled binary. Do you have this driver and timing documented somewhere?
Onwrikbaar
**
Posts: 95
Joined: 21 Sep 2018, 17:17
Location: The Netherlands
Contact:

Re: Battery question (18650)

Post by Onwrikbaar »

lobster wrote:Do you have this driver and timing documented somewhere?
Certainly. I posted the schematic of the driver, along with instructions on how to connect and calibrate it, on FetLife a few months ago.
There will be a more detailed description of it on my own site early next year, but the software for it is actually not complicated:

Twice per second, my program switches on the magnet by making the drive pin high. Then -
  • If the detection pin goes low in less than 2 ms, the lock is open. The drive pin is made low again.
  • If the detection pin goes low in more than 2 ms but less than 20 ms, the lock is closed. The drive pin is made low again, unless the lock was 'armed', i.e. set to be locked immediately upon closing.
  • Otherwise, the lock is disconnected or not powered. The drive pin is made low again after 20 ms.
Of course you can choose other timing thresholds if you write your own program for it. The driver circuit contains a trimpot to shift the current threshold where the detection pin will be pulled low.

I hope this makes sense to you.
enchained
*
Posts: 8
Joined: 24 Dec 2015, 22:03

Re: Battery question (18650)

Post by enchained »

Coming late into this discussion, hope those interested will read.

1) Everything you want to know about batteries, and I mean everything including which brands you find on China sellers are honest in reporting their capacity and which are lying, is at https://www.lygte-info.dk/

2. Second the comment about snubber (or sometimes called kickback) diodes in anything switching an inductive load like a motor or electomagnet. Electronic stuff will break if you don't. Many MOSFETs have the diode built in; a nice feature.

3. When picking an electomagnet check that it's rated for continuous duty. Many are not and will overheat if rated current is flowing for more than a few minutes. If you find that try running a lower voltage, 10 Volt instead of 12 for example.
Onwrikbaar
**
Posts: 95
Joined: 21 Sep 2018, 17:17
Location: The Netherlands
Contact:

Re: Battery question (18650)

Post by Onwrikbaar »

enchained wrote:Many MOSFETs have the diode built in; a nice feature.
Actually, that diode is not built in on purpose; it is the unavoidable consequence of how MOSFETs are constructed. That is why it is often called the intrinsic diode.
And this diode will do nothing to protect the FET from voltage spikes on its drain terminal, since it will block when (in an N-channel FET) the drain voltage is higher than the source voltage.
In short: always mount an external flyback diode to take over the inductive load's current when the FET is switched off.
enchained
*
Posts: 8
Joined: 24 Dec 2015, 22:03

Re: Battery question (18650)

Post by enchained »

@Onwrikbaar
Thanks for the clarification about intrinsic diodes. I did some research and found you are right. All MOSFETs have a diode as a result of manufacturing. Some also include a Schottkey diode deliberately. But neither will help protect the FET from voltage spikes from switching inductive loads.

The datasheet for IRF630 (a MOSFET I've used) shows a test circuit and some specs about switching an unclamped inductive load. But when I looked closer the load is only 100µH, much smaller than the average motor or electromagnet.

So you're right, always include an external flyback diode. I learned something.
Post Reply