Battery question (18650)

Ideas and instructions how you can make your own bondage toys.
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Battery question (18650)

Post by lobster »

Hi folks,

I'v been away for quite some time, but recently I noticed the SB urge again so I decided to start with some engineering for the good cause.

My plan is to build a battery powered electromagnet lock combined with an Arduino (ESP8266) controlled relay. It's still early days and I'm trying to figure out how much battery I need. I'm looking at 18650 cells; preferably a well known / decent quality one - for instance the Panasonic NCR18650B which is rated at ~3350mAh. Ideally I would go with 2 cells given the space they need, but I'm trying to figure out if they can deliver enough and how to avoid damaging them. Since this is not my specialty, I hope to get some directions from you.

I plan to use the following components
  • electromagnet draws ~250mA
  • ESP module + relay draws ~120mAH
which roughly totals at ~370mA.

The module are designed to run at 12V input. Using two 18650 cells adds up to ~7.4V, which need therefore to be boosted in order to make 12V. It looks like this buck/boost module could work [1]. This module also draws some power and there is of course loss in converting, so my guesstimate would be that the entire thing draws around ~420mA.

An online battery calculator tells me these cells give enough power to last 5,5 hours at that demand - is that right? Are two of these cells powerful enough to run this setup for that long? I'm guessing these cell in reality deliver less current so it's probably a little shorter, but even so I would prefer them even to run much shorter, just as a safety feature should my Arduino fail. Perhaps a 2000mAh would even be better given these exist form a well know vendor.

Also how can I protect them from dropping below a cut-off voltage in order to avoid damage?

Lot's of question - hope I'm asking the right ones.

Looking forward to your thoughts.

[1] https://www.aliexpress.com/item/15952-F ... 30697.html
User avatar
Gregovic
****
Posts: 1118
Joined: 26 Mar 2016, 21:31
Location: Netherlands

Re: Battery question (18650)

Post by Gregovic »

Get protected cells with a battery protection circuit built in, that should protect from under- or over-volting them. The "actual" capacity is usually taken to be around 70% of the rated capacity. Boost converters are not super efficient. I'd look into going for a 4-series battery (at 14.8 volts) and step this down a bit. You could also test your electromagnet strength at lower voltages. Just because it's rated for 12 volts doesn't mean it can't run on 11.4 volts(3S) just fine. You'll lose a bit of clamping power but that might be acceptable. In my experience you'll still have plenty until you get to about 9 volts.

The current draw for the ESP and relay seem a little low to me. Just the relay likely draws 50 or so amps. Do you plan to run the ESP with the wifi modem turned off? If the Wifi is on and actively transmitting the current draw will likely exceed your number already.

Best to build a setup like this first on the workbench, using a bench top power supply instead of batteries. Then you can get the right numbers to base the battery design on.
How may I serve you? *Curtsey*
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

Thanks!

I'll look into protected cells, that is something I really want because these things failing would be horrible.

Yes I plan to run the ESP with the Wifi on and transmitting. One of the ideas I have is to add a button as a manual safety escape. Only activating the escape comes at a price: the escape de-disables a second electromagnet which acts as a mess maker. For this I want to join two ESPs in a mesh. And since I'm designing for low-latency (don't want to wait 5 mins after triggering safety), this means running the device always on.

Reading a bit more on power consumption of the ESP, I agree I grossly underestimated this. It looks like the chip may take as much as 400mA during transmission time! You're also right on the relay probably taking in more than I assumed. Plus this board inputs at 12V and has a converter to run the ESP at 3.3V - so 100/120mA sounds more realistic.

With revised numbers / new round of estimates
  • 120mA relay board
  • 400mA ESP
  • 250mA magnet
  • 50mA step down converter & loss
should bring the total to around ~820mA, 70% of 3350mAh = 2345mAh, makes roughly two hours. Great!

I'll make sure to build a setup first on the workbench using an external power supply and get a feeling for the parameters and actual setup. Not in a hurry - the anticipation is half the fun.
User avatar
Gregovic
****
Posts: 1118
Joined: 26 Mar 2016, 21:31
Location: Netherlands

Re: Battery question (18650)

Post by Gregovic »

Better be damn sure that mess maker doesn't trigger accidentally :-P. (I'd make it a timed trigger in any case. Hold the button for >3 seconds to trigger the safety. Wouldn't want an accidental bump to spoil things :wink:

What you could look into is just buying a cheap cordless drill/saw/whatever and use it's battery as your power source. You'll have a neat packaged battery that someone who (probably) knew what they were doing actually spent some time on properly designing. Saw the bottom off the drill and use the original battery connector to get a good connection. And you don't need to get a super expensive brand either. A cheap 14.4 or 18v Harbour Freight Li-ion battery will probably do just fine. And they're usually also battery packs intended for lots of cycles and delivering lots of power. (I was going to recommend the Ikea Fixa cordless drill at $25, but it seems that only has a puny 1500mAh battery pack, so not big enough.)
How may I serve you? *Curtsey*
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

Great suggestion on the power pack! I'll drop by the local hardware store and see if they have something.

Triggering the mess release by accident would be very unfortunate :oops: I was thinking about either hold long enough or press in rapid succession. I'll run a few dexterity tests to see what makes sense once I'm a bit further down the road.

good stuff.
Onwrikbaar
**
Posts: 95
Joined: 21 Sep 2018, 17:17
Location: The Netherlands
Contact:

Re: Battery question (18650)

Post by Onwrikbaar »

lobster wrote:
  • 120mA relay board
  • 400mA ESP
  • 250mA magnet
  • 50mA step down converter & loss
Three LiPo cells would work. Their series voltage will range from 12.6V down to 11.1V, which is fine for a 12V magnet.
  • Avoid the relay board by using a transistor (either BJT or MOSFET). These are practically zero power and much smaller than a relay.
  • The ESP uses about 170 mA when WiFi is on, see https://bbs.espressif.com/viewtopic.php?t=133. But this is at 3.3V; if you use a switching buck converter to power the ESP from the batteries, it will only draw roughly 60 mA at 12V.
  • The 60 kg door holding magnets that I use (http://forum.boundanna.net/board/viewto ... 12&t=11842), draw between 100 and 150 mA at 12V.
All in all, about 200 mA could suffice, of course greatly depending on the magnet you use.

Anyway: cool project, enjoy!
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

Thanks for the suggestions @Onwrikbaar, I'll look into them. First I'll give the ESP a try with one of those ready-made relay boards for cheap. Next step is to try and create a custom PCB using KiCad.
User avatar
Gregovic
****
Posts: 1118
Joined: 26 Mar 2016, 21:31
Location: Netherlands

Re: Battery question (18650)

Post by Gregovic »

If you want to make it easy on yourself when it comes to getting an ESP8266 hooked up to a relay, take a look at the SonOff home automation switches. Most of them come with a programming header on the board, so with a bit of easy soldering you have a very neat little package with an ESP8266 connected to a relay. Do a bit of googling for "SonOff basic" and "programming" or various variations on the theme and you should fine plenty.

I'm a little surprised I can't find any ESP8266 boards with an SSR on board or a decent size Mosfet. I'd have thought that'd be a thing by now. Apparently not, or my google-fu is failing me.
How may I serve you? *Curtsey*
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

Gregovic wrote:SonOff home automation switches
nice find! Didn't come across those yet.

I've ordered a bunch of these modules [1] from aliexpress. Along with a USB programmer for these boards to flash a custom firmware / Arduino stack.

[1] http://www.aliexpress.com/item/DC-5V-ES ... 06183.html
MKu
**
Posts: 127
Joined: 23 Apr 2009, 21:47
Location: Germany

Re: Battery question (18650)

Post by MKu »

Thinking back to relays there are some things i want to mention:

- a 12V relay usually needed over 11V to pull the armature but less than 9V to keep it in place

- the spring was not only for moving the contacts but also for overcoming magnetisation effects

- a diode was used to shortcut the voltage generated by the collapsing magnetic field at deactivation
Indeed over time people got knowledge but no wisdom.

Accidents do not happen, they are caused.
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Battery question (18650)

Post by Sir Cumference »

I have used quite a few 18650s scrounged from computers for various projects in the last couple of years.
They have no safety circuits, and should be used with some care.

I have lots of them, and ruining a couple by deep discharge doesn’t worry me.
What I am very aware of is, that they hold a nasty amount of energy and can deliver a surprising current.
In case of a short circuit, something usually starts burning.
:shock:
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
User avatar
Gregovic
****
Posts: 1118
Joined: 26 Mar 2016, 21:31
Location: Netherlands

Re: Battery question (18650)

Post by Gregovic »

Sir Cumference wrote:I have used quite a few 18650s scrounged from computers for various projects in the last couple of years.
They have no safety circuits, and should be used with some care.

I have lots of them, and ruining a couple by deep discharge doesn’t worry me.
What I am very aware of is, that they hold a nasty amount of energy and can deliver a surprising current.
In case of a short circuit, something usually starts burning.
:shock:
Not ALL 18650s have built in protection circuits but you CAN get protected cells. Those salvaged from existing battery packs or systems that have an external BMC typically don't though. If unsure it's always best to assume cells aren't protected.
How may I serve you? *Curtsey*
User avatar
lobster
*
Posts: 34
Joined: 20 Sep 2014, 10:20

Re: Battery question (18650)

Post by lobster »

The last thing I want is a chemical fire during a session. The cells that go into this need to be protected and top quality!

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.
User avatar
Gregovic
****
Posts: 1118
Joined: 26 Mar 2016, 21:31
Location: Netherlands

Re: Battery question (18650)

Post by Gregovic »

lobster wrote:The last thing I want is a chemical fire during a session. The cells that go into this need to be protected and top quality!

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.
When choosing the MOSFET and designing the driver circuitry, keep in mind the magnet is a mostly an inductive load. The back EMF when switching can be quite high. You might need to include some snubber diodes to suppress the peaks
How may I serve you? *Curtsey*
User avatar
ruru67
****
Posts: 530
Joined: 05 Feb 2009, 03:38
Location: NZ
Contact:

Re: Battery question (18650)

Post by ruru67 »

Gregovic wrote:The back EMF when switching can be quite high. You might need to include some snubber diodes to suppress the peaks
No "might" about it. I've got a few dead (cheap) MPU boards from forgetting or accidentally disconnecting "flywheel" diodes. That back EMF is nasty.
Last edited by ruru67 on 25 Dec 2018, 12:51, edited 1 time in total.
Post Reply