# Python 3 brine and cure calculator

Discussion in 'General Discussion' started by JC in GB, Apr 12, 2019.

1. ### JC in GBMeat Mopper

To my fellow smoking friends. Here is a program I made in Python3 to calculate brine and nitrate cure strength. All calculations were obtained from the USDA Processing Inspectors' Calculations Handbook (1995).

Python3 is an open source programing language that can be installed on most computer platforms.

Any feedback is appreciated. :)

Here is the source code if anyone wishes to give it a whirl.

#############################################################################

#Python PPM cure calculator#
#This program will calculate PPM of Sodium nitrate in meat curing brine #
#All weights are in metric units #

# 03 APR 2019 #

#############################################################################

### Variables ###

#_H2Oltr amount of water in liters

#_curegm weight of cure #1 in gm

#_NaNO3 weight of Sodium nitrate (Cure weight * 0.0625)

#_ppm PPM calculated

#_ppmtar PPM target

#_brinepc brine concentration percent

#_brinekg weight of pickle

#_pickup meat pick up %

#_NaCl weight of salt needed for brine solution

### END VARIABLES ###

print ('PPM calculator for brine curing meat using cure #1 powder 6.25% NaNO3.')

print ()

print ()

_ppmtar = input ('What is your target PPM for this cure?')

_ppmtar = float (_ppmtar)

print ()

_H2Oltr = input ('Amount of water in liters?')

_H2Oltr = float (_H2Oltr)

print ()

_brinepc = input ('What is your brine concentration target in % salinity? (Decimal value)')

_brinepc = float (_brinepc)

print()

_NaCl = ((_H2Oltr)* _brinepc)/ abs(_brinepc -1)

_brinekg = _H2Oltr + _NaCl

_pickup = input ('What is the pickup %')

_pickup = float (_pickup)

print ()

_NaNO3 = (_ppmtar * _H2Oltr)

_NaNO3 = float(_NaNO3)

_curegm = (_NaNO3 * 16)/1000

_curegm = float (_curegm)

print ()

print ('You will need {:10.3f}'.format (_NaCl * 1000),'grams of salt for ',_H2Oltr,' liters of water.')

print ()

print ('Brine weight is: {:10.3f}'.format (_brinekg),'kg')

print ()

print ((_NaNO3),'mg NaNO3 needed for ',_ppmtar,' PPM nitrate.')

print ()

print ((_curegm),'grams of cure #1 needed for ',_ppmtar,' PPM nitrate.')

print ()

print ((_curegm * _pickup),'grams of cure #1 needed for ',_ppmtar,' PPM nitrate in a ',_pickup,'% pick up brine.')

print ()

print ('You will need{:10.3f}'.format ((_NaCl *1000) - (_curegm * _pickup)),'grams salt for a {:10.3f}'.format(_brinepc * 100),'% strength brine using ',(_curegm * _pickup),' grams of cure #1.')

2. ### solmanMeat Mopper

JC in GB likes this.
3. ### JC in GBMeat Mopper

Thank you for that information. Very helpful... :)

4. ### tallbmMaster of the PitOTBS Member

Cool stuff guys, when I get a chance I'll pop it into the online compiler and give it a whirl!

JC in GB likes this.
5. ### JC in GBMeat Mopper

Awesome. Feel free to give any feedback.....

6. ### PolishDeliFire Starter

That’s pretty cool!

1 - Cure #1 is Sodium Nitrite (NaNO2) not Sodium Nitrate (NaNO3).
2 - Your calculator is using UADA method 1 (%pickup), not Method 2(equilibrium). Maybe worth noting that, or give the option to use one or the other. I’m still conducting experiments at home, but I’ve convinced myself that Method 1 is the better of the two.
3- May also note that your calculator can be used for injecting. i.e., if injecting, then %pickup = % injected.
4 – I usually see salinity given with units g/kg, or g/L. How does that compare to the % salinity you are using? My brine calculations are done in terms of °SAL (at 100°SAL no more salt will dissolve in the water, ~350g/L water). If you want to input a g/L conversion to °SAL, the equation is
Salinity [g/L] = 0.011*°SAL^2 + 2.5*°SAL
or going the other direction
°SAL = -0.00025*Salinity [g/L]^2 + 0.3661*Salinity [g/L]
I determined those equations by curve fitting to salinity table.

7. ### JC in GBMeat Mopper

Polish Deli,

Thanks for you feedback. Please see my responses in bold below.

Awesome feedback. Much appreciated.

Last edited: Apr 12, 2019
8. ### PolishDeliFire Starter

For calculating the % injection, you’d need the meat weight. I usually inject 10%.
Going by UDSA guidelines, if you are injecting, then only Method 1 applies.
Mathematically though, if you want to use Method 2, you are free to inject as much or as little as you want, since the amount injected doesn’t change the total (brine+meat) weight. In any case, I also prefer to use Method 1.

Oh, I understand your salt calculation now. It’s solving % salt = Xg salt / (Xg salt + Yg water).

Since that’s the case, converting to °SAL is easy, since it’s a unit that is normalized to 100 at 26.4% with a 0 intercept.
% Salt (Decimal value) = 0.00264* °SAL

Really nice work on the calculator! I hope people use it and appreciate the effort you put into it.

JC in GB likes this.
9. ### daveomakEpic PitmasterOTBS MemberSMF Premier Member

JC, morning... I can't run that program...
Would you mind running a test sample and displaying the results for me....
Say a 10# beef roast...

Dave

JC in GB likes this.
10. ### JC in GBMeat Mopper

Certainly. I will have to run it Monday if you can wait that long. I am running it on a raspberry pi and it is at another location at the moment.

11. ### JC in GBMeat Mopper

You would need to load a python 3 compiler on your computer for it to work. I will see if I can make an executable version for Windows.

12. ### daveomakEpic PitmasterOTBS MemberSMF Premier Member

I was wondering how you converted commercial curing to home curing, and if the results were the same as home curing...

13. ### atomicsmokeMaster of the PitOTBS Member

I thought the pickup method was discredited here for home use.

For the mathematically challenged fellow smokers here is a a cure calculator by one of our members:
http://diggingdogfarm.com/page2.html
No need to install compilers on your computer.

Pops also authored a well known wet cure. Look it up. And spare a "get well" thought for Pops while you do that.
My thoughts with you Pops. Looking forward to your return here.

JC in GB likes this.
14. ### daveomakEpic PitmasterOTBS MemberSMF Premier Member

The "pick up" term is a misnomer... It refers to, the amount of brine/cure pick up by the needle injection machine... Meat is weighed before and after injection to see what it picked up.. Then the needle injector is adjusted to insure the proper amount of brine/cure is inside the meat... Adjusted by the pressure in the needles, speed of the needles travel during the injection etc.... Many folks have assumed "% pick up" is uniform across all cuts of meat making the "USDA Processing Inspectors' Calculations Handbook" a useful tool for home meat processing... Ain't so...
Anywho, I have concerns when folks use the handbook... Some things used in industry cannot be easily transferred for home use...
I personally saw the discrepancy, when belly bacon was being made, at the processor I worked at as an outside contractor... A batch of bellies that came in, 2200#'s worth, did not meet specifications... It was due to the needle machine operator not adjusting the machine due to the belly thickness changing by 1/4"....
Some meats go in a vacuum tumbler after injection... Commercial processing is a totally different animal from home processing...

JC in GB likes this.
15. ### JC in GBMeat Mopper

Great information and comments. I truly appreciate input from experts in the field. It can only make my ascension to a pitmaster faster and less painful. I am not trying to question or disprove anyone else's work on this forum, I am simply on the path to learning the secrets and science behind great BBQ and with the advice and support of the great BBQ chefs on this forum, I find it within my grasp.

Also, I hope Pops is doing well and making a speedy recovery.

16. ### JC in GBMeat Mopper

Here are the numbers I got for a 10 lb beef roast. Here are the constants I used.

This calculation is for an injection brine.

Meat weight 10 lb
Brine weight 1 lb
PPM of cure: 156
Salinity of injection brine 5%

Calculated values:

Salt: 12.55 grams
Cure#1: 11.32 grams
Water: 0.453 liters

17. ### daveomakEpic PitmasterOTBS MemberSMF Premier Member

That's correct for your injection of 5%, for the cure#1...
Salt is only 0.27% which is terribly low... a total of about 0.52% salt....
I prefer a total of ~2% salt... ~1.75% Kosher salt injection.... which would be ~ 87 grams of Kosher salt added to the brine injection...

JC in GB likes this.
18. ### JC in GBMeat Mopper

I agree the salt level I chose is pretty low. I didn't want the end product too salty. I am still a bit shaky on just how salty the end product should be. I have heard that a 0.5% concentration is palatable to most people. I am now always concerned about too much salt as a side effect of aging. ;)

Thanks for your reply. I learn new things on the forum every day. Simply amazing...

19. ### daveomakEpic PitmasterOTBS MemberSMF Premier Member

I add 1% sugar and 1.75% salt + the cure... Generally, that palate is happy with 2% total salt... The 1% sugar will combat any saltiness the sensitive palate will taste..

JC in GB and tallbm like this.
20. ### PolishDeliFire Starter

Dave,
Can you help me understand what you mean by this, and recommend proper strategies?
For home curing, I think we are naturally forced to modify our processes simply due to the equipment we have available to us. For example, we use syringes for injecting cure because we don’t have pump stations at home. But whether curing at home or on an industrial scale, the same nitrite levels should be targeted. To that extent, JC’s calculator works as intended.

JC in GB likes this.