Output 2 and Analog 11 on the same side of resistor ground on the other side

Like this?
Output 2 and Analog 11 on the same side of resistor ground on the other side
Yes that will workView attachment 813082
Like this?
This already exists, just create a Global as DateTime called Clock, then create a script and use the below code to populate it.
[clock_run]
new datetime x
x = now
"Clock" Value = x
sleep 1000
goto clock_run
This is much nicer than my low-grade schematic; what is the software you use?with help from @RiverCityBrewer View attachment 813204
Thank you for this beautiful schematic. My only concern is that some of the pin numbers/wire colors and their functions do not correspond to the IFM6004 manual. As in the drawing below, pin 1 is brown and UB+, but Pin 2 is white and is the signal for volume, pin 3 is blue and goes to UB- and pin 4 is black and goes to Analogue Temp. It looks like the wiring in your schematic is correct, just the labeling on the pin numbers below it seems to be off. Thanks again for such a beautiful depiction. Here is the manual's drawing:with help from @RiverCityBrewer View attachment 813204
You are correct! Here is a corrected one along with the image from your PDF.Thank you for this beautiful schematic. My only concern is that some of the pin numbers/wire colors and their functions do not correspond to the IFM6004 manual. As in the drawing below, pin 1 is brown and UB+, but Pin 2 is white and is the signal for volume, pin 3 is blue and goes to UB- and pin 4 is black and goes to Analogue Temp. It looks like the wiring in your schematic is correct, just the labeling on the pin numbers below it seems to be off. Thanks again for such a beautiful depiction. Here is the manual's drawing:
...or more specifically, how do we arrive at a 250 ohm value..?So just a general kind of question - and from an electron's perspective - I am assuming that the 250 ohm resistor would prevent an overcurrent into the Unishield? Anyone care to expand on why a resistive path to ground in parallel to the Unishield pin acheive this?
...or more specifically, how do we arrive at a 250 ohm value..?
I got this from @RiverCityBrewerLoop
Volume += Flow * 5
Sleep 5000
Goto loop
Use an inspector or global to display Volume. Maybe this?
15:00:15.337: Loading global settings file 'C:\Users\POS_user\Documents\BruControl\settings.brusettings'...
15:00:15.380: Loading configuration file 'C:\Users\POS_user\Documents\BruControl\1000L_Pot_Run.brucfg'...
15:00:15.530: Opening database: Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\POS_user\Documents\BruControl\Data\Data.mdf;Integrated Security=True
15:00:27.881: Exception while opening database: Cannot open database "C:\USERS\POS_USER\DOCUMENTS\BRUCONTROL\DATA\DATA.MDF" requested by the login. The login failed.
Login failed for user 'DESKTOP-NM60O7L\POS_user'.
Many industrial sensors use 4-20mA analog signals because they are not influenced by the length of the wire or connection resistance. If you send 10mA and you have enough voltage to push the electrons through the path, 10mA will come out of the other side whether your wire is 2 ft or 200ft long. Analog inputs on Arduino's and other microcontrollers measure voltage, typically either 0-5V (Arduino Uno/Mega) or 0-3.3V (grand central and other 3.3V microcontrollers). So, you have to convert the current output to voltage for the microcontroller to read the value. For a 0-5V Mega, you would want to have the max output of 20mA from the SM6004 to correspond to max input on the Mega of 5V. As Tartan shows above, this is calculated by ohms law: R= V/I, 5V / 0.02A = 250ohm. On the low end, you will have 4mA x 250 ohms =1V. This will need to be calibrated because the Mega is expecting 0V for 0 flow. In some cases, you want to guard against overvoltage on the microcontroller by adjusting the resistor value. For example, on the SM6004 temperature output, the max temps is ~170F. You can use it at higher temperatures (i.e. boiling), but it will output >20mA which will be converted to >5V which could fry your Analog pin. So you may want to calculate for ~25mA --> 5V/.025 = 200 ohm. Back to your question, the resistor connected to ground will regulate the voltage on the pin. If you had no resistor, your pin will have 0V on it because it would be directly grounded. If you had infinite resistance, your pin will have 24V (assuming that is the SM6004 output voltage). As you decrease the resistance, there will be less voltage on the pin which is a bit counterintuitive, but that is how it works.So just a general kind of question - and from an electron's perspective - I am assuming that the 250 ohm resistor would prevent an overcurrent into the Unishield? Anyone care to expand on why a resistive path to ground in parallel to the Unishield pin acheive this?
I got it working. I think the failure was power related crash that caused it, the following steps got it working, but it took me many attempts to get to the final working procedure.:First, where is the SQL documentation? I look in the 1.1 manual and there is no mention, I remember some sort of migration guide or something, but I last fixed SQL over 2 years ago, and now having a login error so my graphs are lost with every reboot again. I look in the FAQ, Build, and Download sections and find nothing.... I am running 1.1 and this a production machine... edit: I am on 1.1 build22
Code:15:00:15.337: Loading global settings file 'C:\Users\POS_user\Documents\BruControl\settings.brusettings'... 15:00:15.380: Loading configuration file 'C:\Users\POS_user\Documents\BruControl\1000L_Pot_Run.brucfg'... 15:00:15.530: Opening database: Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\POS_user\Documents\BruControl\Data\Data.mdf;Integrated Security=True 15:00:27.881: Exception while opening database: Cannot open database "C:\USERS\POS_USER\DOCUMENTS\BRUCONTROL\DATA\DATA.MDF" requested by the login. The login failed. Login failed for user 'DESKTOP-NM60O7L\POS_user'.
<rant>I HATE WINDOWS FOR REASONS LIKE THIS, DAMMIT! </rant>
Thanks for this explanation Staffordj; so to use the garden hose analogy, I guess adding that resistor to ground is like pinching the end of the hose creating a back pressure (voltage) on the system.. I think I get it; cool!!Many industrial sensors use 4-20mA analog signals because they are not influenced by the length of the wire or connection resistance. If you send 10mA and you have enough voltage to push the electrons through the path, 10mA will come out of the other side whether your wire is 2 ft or 200ft long. Analog inputs on Arduino's and other microcontrollers measure voltage, typically either 0-5V (Arduino Uno/Mega) or 0-3.3V (grand central and other 3.3V microcontrollers). So, you have to convert the current output to voltage for the microcontroller to read the value. For a 0-5V Mega, you would want to have the max output of 20mA from the SM6004 to correspond to max input on the Mega of 5V. As Tartan shows above, this is calculated by ohms law: R= V/I, 5V / 0.02A = 250ohm. On the low end, you will have 4mA x 250 ohms =1V. This will need to be calibrated because the Mega is expecting 0V for 0 flow. In some cases, you want to guard against overvoltage on the microcontroller by adjusting the resistor value. For example, on the SM6004 temperature output, the max temps is ~170F. You can use it at higher temperatures (i.e. boiling), but it will output >20mA which will be converted to >5V which could fry your Analog pin. So you may want to calculate for ~25mA --> 5V/.025 = 200 ohm. Back to your question, the resistor connected to ground will regulate the voltage on the pin. If you had no resistor, your pin will have 0V on it because it would be directly grounded. If you had infinite resistance, your pin will have 24V (assuming that is the SM6004 output voltage). As you decrease the resistance, there will be less voltage on the pin which is a bit counterintuitive, but that is how it works.
Agreed, maybe place it under "Brewing Software" or something like that. Lots of very useful info under the existing thread however as stated it is repetitive at times and is a mix of builds questions/solutions as well as software related questions. Like you, not complaining the content is very much appreciated from contributors, I think it just needs to be organised/streamlined a bit to allow one to find answers through "Search" a bit simpler.@BrunDog
@TxBrew
Any Chance that there could be a whole new Forum Just for BruControl rather than a thread on the Automated Brewing Forum?
That way Threads could be Started under the Forum
Like:
Scripting
Equipment
Suggestions
and others Threads
Some of the threads could be Sticky.
The Old BCS Forum had limited Threads where it was easier. Something like that would be better. I know you have your own forum at brucontrol.com but HomeBrewTalk rocks and more active.
It might be much easier to search for answers rather that the single unending thread. I have ask the same question as others and I see some questions asked and answered multiple times. This is not a complaint against users asking (or even re-asking) a question, as it is hard to do a search.
Well, not sure what kind of magic that is but it worked! At least for longer then it has in the past. What does that do exactly that turning power off doesn't? I still need to take to shop and test there, is it harmful to do that a few times? Either way, thanks a bunch! I still have a few hairs leftWith power off. Try resetting the Ethernet shield
Didn't last long, same issue. Disconnected after 30 minutes and only after me starting to add more elements and turn off some of the pumps.Well, not sure what kind of magic that is but it worked! At least for longer then it has in the past. What does that do exactly that turning power off doesn't? I still need to take to shop and test there, is it harmful to do that a few times? Either way, thanks a bunch! I still have a few hairs left
What are you using as a power supply and what is the input voltage to the MEGA?Having a problem with Mega connecting via ethernet to server running Brucontrol. Server has a Windows 11 VM installed and has connectivity to everything else in my network and has internet access. I have tried on Windows 10 with same problems. I can ping the interface from command line but it won't stay connected. If I unplug and plug back in it shows connected for a second or 2 then disconnects. I have changed out cables, changed AP in house etc. I suspect its something to do with Virtual Machine on server vs networking issue. I am about to reinstall (for 3rd time) and just put on a dedicated Machine that is not server, but was trying to utilize my server, storage and raid. Server is a Dell 720 with plenty of resources and Proxmox hypervisor. Any help would be appreciated. Been pulling my hair out for couple weeks trying to resolve this.
Brent
What are you using the volume for? A little plug for @BrunDog, I ended up buying his volume sensors and they are amazing. You can use them by writing a script to fill your vessels to a specific volume and they are pretty accurate.Back to the Flow Meter SM6004, which I now have hooked up and have as an Analog Input into Brucontrol; I need a totalizer (for volume), which I assume I can set up in a script. So to obtain volume info, I will need to multiply the minutes X flow (liters/minute).
I'm not sure how to script this, keeping in mind that the flow rate will most likely fluctuate, and where/how this volume info could be displayed?
I bought a new wall wart for this specific mega, its 9 volt. I have 5v, 12v and 24v in control box so could hard wire if needed but thought the 9v was preferred from what I read somewhere.What are you using as a power supply and what is the input voltage to the MEGA?