<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenPLC &#8211; CONTROLLINO</title>
	<atom:link href="https://www.controllino.com/category/tutorials/openplc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.controllino.com</link>
	<description>Industrial PLCs &#124; 100% Arduino-compatible</description>
	<lastBuildDate>Tue, 10 Dec 2024 08:57:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.controllino.com/wp-content/uploads/2023/05/cropped-C_Logo_Filled_RGB-1-32x32.png</url>
	<title>OpenPLC &#8211; CONTROLLINO</title>
	<link>https://www.controllino.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>OpenPLC Editor for CONTROLLINO</title>
		<link>https://www.controllino.com/openplc_get_started/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Mon, 09 Dec 2024 16:02:35 +0000</pubDate>
				<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17531</guid>

					<description><![CDATA[Introduction In the world of industrial automation, having an intuitive and powerful programming environment is key. OpenPLC Editor, combined with CONTROLLINO, brings a seamless IEC 61131-3 programming experience, simulation capabilities, and Modbus communication to the table. Here&#8217;s how you can install and get started with OpenPLC Editor, including support for CONTROLLINO boards. Why Choose OpenPLC [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Introduction</h3>



<p>In the world of industrial automation, having an intuitive and powerful programming environment is key. OpenPLC Editor, combined with CONTROLLINO, brings a seamless IEC 61131-3 programming experience, simulation capabilities, and Modbus communication to the table. Here&#8217;s how you can install and get started with OpenPLC Editor, including support for CONTROLLINO boards.</p>



<h4 class="wp-block-heading">Why Choose OpenPLC Editor with CONTROLLINO?</h4>



<ul class="wp-block-list">
<li><strong>Rich IEC 61131-3 Programming IDE</strong>: Enjoy programming in Ladder, Structured Text (ST), Instruction List (IL), Function Block Diagram (FBD), and Sequential Function Chart (SFC).<br><em>&#8220;Nice and mature IDE for IEC 61131-3 programming.&#8221;</em></li>



<li><strong>Simulation Capabilities</strong>: Test your program before uploading it to the CONTROLLINO.<br><em>&#8220;You can simulate your program before uploading to CONTROLLINO.&#8221;</em></li>



<li><strong>Modbus RTU, Serial, and TCP/IP</strong>: Full support for RS485 communication on CONTROLLINO MAXI and MEGA.</li>
</ul>



<h3 class="wp-block-heading">Step 1: Download and Install OpenPLC Editor</h3>



<ol class="wp-block-list">
<li><strong>Download</strong>: Visit the <a href="https://www.openplcproject.com/">OpenPLC download page</a> and choose the appropriate version for your operating system.</li>



<li><strong>Install</strong>: Follow the standard installation process after downloading the setup file.</li>
</ol>



<h3 class="wp-block-heading">Step 2: Update OpenPLC Editor for CONTROLLINO Boards Support</h3>



<ul class="wp-block-list">
<li><strong>Open the Editor</strong>: After installation, launch the OpenPLC Editor.</li>



<li><strong>Check for Updates</strong>: Navigate to <code>File -&gt; Check for updates...</code> as shown below: </li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" width="446" height="441" src="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1.png" alt="" class="wp-image-17532" style="width:426px;height:auto" srcset="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1.png 446w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1-300x297.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_1-100x100.png 100w" sizes="(max-width: 446px) 100vw, 446px" /></figure>
</div>


<ul class="wp-block-list">
<li><strong>Apply Updates</strong>: If updates are available, accept them and restart OpenPLC Editor to finalize the installation.</li>



<li><strong>Checking Controllino&#8217;s Boards</strong>: Check that is possible to select our boards in the Arduino upload dialog.</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="450" height="435" src="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3.png" alt="" class="wp-image-17534" srcset="https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3.png 450w, https://www.controllino.com/wp-content/uploads/2024/12/check_updates_3-300x290.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>
</div>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>Tip: CONTROLLINO support might already be included in your version, but it’s always good practice to check for updates.</em></p>
</blockquote>



<h3 class="wp-block-heading">Step 3: Start a New Project with OpenPLC Editor</h3>



<ol class="wp-block-list">
<li><strong>Create or Open a Project</strong>: Click on the <code>Open</code> icon in the toolbar to start a new project or load an existing one.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="448" height="442" src="https://www.controllino.com/wp-content/uploads/2024/12/open_example_1.png" alt="" class="wp-image-17533" srcset="https://www.controllino.com/wp-content/uploads/2024/12/open_example_1.png 448w, https://www.controllino.com/wp-content/uploads/2024/12/open_example_1-300x296.png 300w, https://www.controllino.com/wp-content/uploads/2024/12/open_example_1-100x100.png 100w" sizes="(max-width: 448px) 100vw, 448px" /></figure>
</div>


<ol class="wp-block-list">
<li><strong>Explore the Example Project</strong>: Use the predefined programs and structures (e.g., <code>inputs</code>, <code>outputs</code>, and <code>control</code>) to understand the flow of your automation logic.</li>



<li><strong>Write Your Code</strong>: Develop your automation project using Ladder Logic or any of the supported programming languages.</li>
</ol>



<h3 class="wp-block-heading">Advantages of CONTROLLINO Boards with OpenPLC</h3>



<ul class="wp-block-list">
<li><strong>Arduino-Compatible Hardware</strong>: CONTROLLINO is based on Arduino, making it familiar and developer-friendly.</li>



<li><strong>Industrial-Grade Quality</strong>: Designed for real-world applications with robust build quality and excellent communication interfaces.</li>



<li><strong>Seamless Integration</strong>: Direct support in OpenPLC Editor ensures a smooth experience from programming to deployment.</li>
</ul>



<p>By following these steps, you can harness the power of OpenPLC Editor and CONTROLLINO to develop, simulate, and deploy industrial automation projects efficiently. Embrace the future of automation with this powerful combination!</p>



<h3 class="wp-block-heading">How to get and open examples<a href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/blob/master/images/check_updates_1.png#how-to-get-and-open-examples"></a></h3>



<ul class="wp-block-list">
<li>Install git and clone the examples repository.</li>



<li>Open the link below and download the examples folders or execute on local git app the following command: 
<ul class="wp-block-list">
<li><code>git clone https://github.com/CONTROLLINO-PLC/OpenPLC_examples.git</code></li>
</ul>
</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">OpenPLC examples on Github</a></div>
</div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Water Reserve Control</title>
		<link>https://www.controllino.com/water-reserve-control-system/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:50:39 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17463</guid>

					<description><![CDATA[Introduction This tutorial explains how to implement an automatic water reserve control system using a CONTROLLINO PLC and OpenPLC. The system monitors the water levels of a cistern (minimum level) and an elevated tank (minimum and maximum levels) to control a pump that transfers water from the cistern to the elevated tank. Additionally, manual pump [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p>This tutorial explains how to implement an automatic water reserve control system using a CONTROLLINO PLC and OpenPLC. The system monitors the water levels of a cistern (minimum level) and an elevated tank (minimum and maximum levels) to control a pump that transfers water from the cistern to the elevated tank. Additionally, manual pump control is possible using start and stop buttons.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before starting, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO PLC (any model) or a compatible PLC.</li>



<li>Sensors for water level detection:</li>



<li>Minimum level sensor for the cistern.</li>



<li>Minimum and maximum level sensors for the elevated tank.</li>



<li>Two buttons for manual control (Start and Stop).</li>



<li>Basic knowledge of ladder logic programming.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Set Up OpenPLC</h3>



<ol class="wp-block-list">
<li><strong>Download OpenPLC</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Visit the <a href="https://www.openplcproject.com/">OpenPLC official website</a> and download the software.</li>



<li>Follow the installation instructions for your operating system.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Set Up the OpenPLC Environment</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Open the OpenPLC editor.</li>



<li>Configure the device by selecting your CONTROLLINO model in <strong>Settings &gt; Device</strong>.</li>



<li>Assign the correct COM port for communication with the PLC.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master" target="_blank" rel="noreferrer noopener">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Configure System Inputs and Outputs</h3>



<p>Define the following inputs and outputs in your ladder logic program:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Name</strong></th><th><strong>Type</strong></th><th><strong>Description</strong></th><th><strong>Pin</strong></th></tr></thead><tbody><tr><td><code>Pool_Low_Level_Sensor</code></td><td>BOOL</td><td>Indicates the minimum water level in the cistern.</td><td><code>%IX0.0</code></td></tr><tr><td><code>Tank_High_Level_Sensor</code></td><td>BOOL</td><td>Indicates the maximum water level in the tank.</td><td><code>%IX0.1</code></td></tr><tr><td><code>Tank_Low_Level_Sensor</code></td><td>BOOL</td><td>Indicates the minimum water level in the tank.</td><td><code>%IX0.2</code></td></tr><tr><td><code>Automatic_Manual_Switch</code></td><td>BOOL</td><td>Switch for selecting automatic or manual mode.</td><td><code>%IX0.3</code></td></tr><tr><td><code>Stop_Button</code></td><td>BOOL</td><td>Push button to stop the pump manually.</td><td><code>%IX0.4</code></td></tr><tr><td><code>Start_Button</code></td><td>BOOL</td><td>Push button to start the pump manually.</td><td><code>%IX0.5</code></td></tr><tr><td><code>Water_Pump</code></td><td>BOOL</td><td>Output controlling the water pump.</td><td><code>%QX0.0</code></td></tr></tbody></table></figure>



<h3 class="wp-block-heading">Step 3: Program the Ladder Logic</h3>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/water_control">Download OpenPLC project here</a></div>
</div>



<ol class="wp-block-list">
<li><strong>Automatic Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump (<code>Water_Pump</code>) is activated automatically when:
<ul class="wp-block-list">
<li>The cistern is above its minimum level (<code>Pool_Low_Level_Sensor</code> is active).</li>



<li>The tank is below its minimum level (<code>Tank_Low_Level_Sensor</code> is active).</li>
</ul>
</li>



<li>The pump is deactivated when:
<ul class="wp-block-list">
<li>The tank reaches its maximum level (<code>Tank_High_Level_Sensor</code> is active).</li>



<li>The cistern falls below its minimum level (<code>Pool_Low_Level_Sensor</code> is inactive).</li>
</ul>
</li>
</ul>



<ol class="wp-block-list">
<li><strong>Manual Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump can be directly controlled using the buttons:
<ul class="wp-block-list">
<li>The Start Button (<code>Start_Button</code>) activates the pump.</li>



<li>The Stop Button (<code>Stop_Button</code>) deactivates the pump.</li>
</ul>
</li>



<li>The switch (<code>Automatic_Manual_Switch</code>) must be in manual mode to enable this functionality.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Switching Between Modes</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The <code>Automatic_Manual_Switch</code> toggles between automatic and manual modes.</li>



<li>In manual mode, sensor readings do not affect the pump operation.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the level sensors to the respective input pins.</li>



<li>Connect the Start and Stop buttons to other input pins.</li>



<li>Connect the water pump to the assigned output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure that the variable names in OpenPLC match the physical connections.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="766" src="https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1024x766.png" alt="" class="wp-image-17482" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1024x766.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-300x225.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-768x575.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion-1200x898.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Esquema-de-conexion.png 1526w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Test the System</h3>



<ol class="wp-block-list">
<li><strong>Load the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your project in the OpenPLC editor.</li>



<li>Connect your CONTROLLINO PLC to the computer and upload the program.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Automatic Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure the cistern is above its minimum level.</li>



<li>Lower the water level in the tank below its minimum.</li>



<li>Observe how the pump automatically activates and fills the tank until it reaches the maximum level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Manual Mode</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Switch to manual mode using the <code>Automatic_Manual_Switch</code>.</li>



<li>Press the Start Button to activate the pump and the Stop Button to deactivate it.</li>
</ul>



<h2 class="wp-block-heading">Ladder Logic Explanation</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="602" src="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1024x602.jpg" alt="" class="wp-image-17484" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1024x602.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-300x176.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-768x451.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1536x902.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1200x705.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Automatic Mode</h3>



<ol class="wp-block-list">
<li><strong>Automatic Activation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When both <code>Pool_Low_Level_Sensor</code> and <code>Tank_Low_Level_Sensor</code> are active, the pump (<code>Water_Pump</code>) turns on.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Automatic Deactivation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The pump turns off when either:
<ul class="wp-block-list">
<li><code>Tank_High_Level_Sensor</code> is active (tank full).</li>



<li><code>Pool_Low_Level_Sensor</code> is inactive (cistern empty).</li>
</ul>
</li>
</ul>



<h3 class="wp-block-heading">Manual Mode</h3>



<ol class="wp-block-list">
<li><strong>Manual Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Pressing <code>Start_Button</code> turns on the pump manually.</li>



<li>Pressing <code>Stop_Button</code> turns off the pump manually.</li>
</ul>



<h2 class="wp-block-heading">Troubleshooting</h2>



<ol class="wp-block-list">
<li><strong>Check Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure sensors and buttons are connected to the correct input pins.</li>



<li>Verify the pump is connected to the correct output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Verify Variables</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Check that the variable names in OpenPLC match the physical connections.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Debugging</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use the OpenPLC debugging tools to monitor the state of inputs, outputs, and signals.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Congratulations! You have successfully implemented a water reserve control system with both automatic and manual modes. This system is ideal for efficiently managing water levels in elevated tanks and cisterns. You can further customize the system by adding additional sensors or modifying the logic to suit specific requirements.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Staircase Light Control</title>
		<link>https://www.controllino.com/openplc-staircase-light-control-tutorial/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:46:34 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17461</guid>

					<description><![CDATA[Introduction This tutorial demonstrates how to create an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. The system uses two push buttons for manual control and a PIR sensor for automatic activation. The light toggles manually with button presses or turns on automatically when motion is detected, staying on for 20 seconds before [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">Introduction</h1>



<p>This tutorial demonstrates how to create an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. The system uses two push buttons for manual control and a PIR sensor for automatic activation. The light toggles manually with button presses or turns on automatically when motion is detected, staying on for 20 seconds before turning off if no further motion occurs.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO PLC (any model) or compatible PLC.</li>



<li>A Passive Infrared (PIR) motion sensor.</li>



<li>Two push buttons (for manual control).</li>



<li>Basic knowledge of ladder logic programming.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Configure OpenPLC</h3>



<ol class="wp-block-list">
<li><strong>Download OpenPLC</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Visit the <a href="https://www.openplcproject.com/">OpenPLC website</a> and download the software.</li>



<li>Follow the installation instructions for your operating system.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Set Up the OpenPLC Environment</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Open the OpenPLC Editor.</li>



<li>Configure the environment for your CONTROLLINO PLC by selecting the correct model in <strong>Settings &gt; Device</strong>.</li>



<li>Assign the appropriate COM port for communication.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Define System Inputs and Outputs</h3>



<p>Configure the following inputs and outputs in your ladder logic program:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Pin</th></tr></thead><tbody><tr><td><code>stairs_pir_sensor</code></td><td>BOOL</td><td>Input from the PIR motion sensor.</td><td><code>%IX0.0</code></td></tr><tr><td><code>control_button_down</code></td><td>BOOL</td><td>Input from the downstairs push button.</td><td><code>%IX0.1</code></td></tr><tr><td><code>control_button_up</code></td><td>BOOL</td><td>Input from the upstairs push button.</td><td><code>%IX0.2</code></td></tr><tr><td><code>stairs_light</code></td><td>BOOL</td><td>Output to control the staircase light.</td><td><code>%QX0.0</code></td></tr></tbody></table></figure>



<p><strong>Timers</strong>:</p>



<ul class="wp-block-list">
<li><code>TOF0</code> (Off Delay Timer): Controls the light timeout after motion detection.</li>



<li>Duration: <code>T#20s</code>.</li>
</ul>



<h3 class="wp-block-heading">Step 3: Create the Ladder Logic Program</h3>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/stairs_light_control">Download OpenPLC project here</a></div>
</div>



<ol class="wp-block-list">
<li><strong>Manual Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When either <code>control_button_down</code> or <code>control_button_up</code> is pressed, the <code>lights_buttons_state</code> toggles the <code>stairs_light</code>.</li>



<li>This allows manual on/off control of the staircase light.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Automatic Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When the <code>stairs_pir_sensor</code> detects motion, it activates the timer <code>TOF0</code>.</li>



<li>The light (<code>stairs_light</code>) remains on while the timer is active or as long as motion is detected.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Timeout</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When no motion is detected for 20 seconds, the <code>TOF0</code> timer deactivates.</li>



<li>The light turns off automatically unless toggled manually.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the PIR sensor output to a digital input pin (e.g., <code>DI0</code>).</li>



<li>Connect the downstairs push button to another input pin (e.g., <code>DI1</code>).</li>



<li>Connect the upstairs push button to a separate input pin (e.g., <code>DI2</code>).</li>



<li>Connect the staircase light to a digital output pin (e.g., <code>DO0</code>).</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Assign the corresponding input and output variables in OpenPLC:
<ul class="wp-block-list">
<li><code>stairs_pir_sensor</code> → <code>%IX0.0</code></li>



<li><code>control_button_down</code> → <code>%IX0.1</code></li>



<li><code>control_button_up</code> → <code>%IX0.2</code></li>



<li><code>stairs_light</code> → <code>%QX0.0</code></li>
</ul>
</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="765" src="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1024x765.png" alt="" class="wp-image-17488" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1024x765.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-300x224.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-768x573.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1200x896.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram.png 1334w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Load and Test the Program</h3>



<ol class="wp-block-list">
<li><strong>Upload the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your ladder logic project in the OpenPLC Editor.</li>



<li>Connect your CONTROLLINO PLC to your computer and upload the program.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Manual Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Press the upstairs (<code>control_button_up</code>) or downstairs (<code>control_button_down</code>) push button.</li>



<li>Confirm that the light toggles on and off with each press.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test Automatic Light Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Walk near the PIR sensor to simulate motion detection.</li>



<li>Observe the light turning on and staying active for 20 seconds after the motion stops.</li>



<li>Ensure the light turns off automatically after the timer expires.</li>
</ul>



<h3 class="wp-block-heading">Ladder Logic Explanation (Detailed)</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="676" src="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1024x676.jpg" alt="" class="wp-image-17490" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1024x676.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-300x198.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-768x507.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1536x1014.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1-1200x792.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpenPLC-program-1.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading">Manual Light Control</h4>



<ol class="wp-block-list">
<li><strong>Toggling the Light</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Each button press (<code>control_button_up</code> or <code>control_button_down</code>) changes the state of <code>lights_buttons_state</code>.</li>



<li>The state of <code>lights_buttons_state</code> determines whether <code>stairs_light</code> is turned on or off.</li>
</ul>



<h4 class="wp-block-heading">Automatic Light Control</h4>



<ol class="wp-block-list">
<li><strong>PIR Sensor Activation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>When the <code>stairs_pir_sensor</code> detects motion, the timer <code>TOF0</code> starts.</li>



<li>The <code>stairs_light</code> remains on while motion is detected or while the timer is active.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Timeout</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The <code>TOF0</code> timer turns off the light 20 seconds after the PIR sensor stops detecting motion.</li>
</ul>



<h4 class="wp-block-heading">Combining Manual and Automatic Control</h4>



<ul class="wp-block-list">
<li>The light can be manually toggled on or off at any time using the push buttons.</li>



<li>Automatic activation by the PIR sensor operates independently, ensuring flexibility.</li>
</ul>



<h3 class="wp-block-heading">Troubleshooting</h3>



<ol class="wp-block-list">
<li><strong>Verify Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Ensure all sensors and buttons are correctly connected to the appropriate input pins.</li>



<li>Confirm the light is connected to the correct output pin.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Check Variable Assignments</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Double-check that the input and output variables in OpenPLC match your physical connections.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Debugging</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use the OpenPLC debugging tools to monitor the state of variables and timers.</li>
</ul>



<h3 class="wp-block-heading">Conclusion</h3>



<p>Congratulations! You have successfully implemented an automatic staircase lighting system using OpenPLC and a CONTROLLINO PLC. This system combines manual and automatic control for optimal flexibility and convenience. Experiment with different timer durations or additional sensors to customize the system further.</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenPLC Light Intensity Control</title>
		<link>https://www.controllino.com/pwm-light-intensity-control-system-tutorial/</link>
		
		<dc:creator><![CDATA[CONTROLLINO]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 22:40:52 +0000</pubDate>
				<category><![CDATA[MAXI]]></category>
		<category><![CDATA[MEGA]]></category>
		<category><![CDATA[MICRO]]></category>
		<category><![CDATA[MINI]]></category>
		<category><![CDATA[OpenPLC]]></category>
		<category><![CDATA[Tutorials]]></category>
		<guid isPermaLink="false">https://www.controllino.com/?p=17457</guid>

					<description><![CDATA[Introduction This tutorial explains how to create a PWM-based light intensity control system using OpenPLC software and a CONTROLLINO Micro PLC. The system adjusts the brightness of a light through a single push button, using a digital output. Each button press decreases the brightness until it cycles back to full intensity. This project showcases ladder [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h1 class="wp-block-heading">Introduction</h1>



<p>This tutorial explains how to create a PWM-based light intensity control system using OpenPLC software and a CONTROLLINO Micro PLC. The system adjusts the brightness of a light through a single push button, using a digital output. Each button press decreases the brightness until it cycles back to full intensity. This project showcases ladder logic programming to control light intensity using PWM.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
<li>OpenPLC software installed.</li>



<li>A CONTROLLINO Micro PLC.</li>



<li>Basic knowledge of ladder logic and PWM.</li>



<li>Hardware setup ready, including a connected push button and light output.</li>
</ul>



<h2 class="wp-block-heading">Step-by-Step Guide</h2>



<h3 class="wp-block-heading">Step 1: Install and Configure OpenPLC</h3>



<ol class="wp-block-list">
<li>Download OpenPLC from the official <a href="https://www.openplcproject.com/">OpenPLC website</a>.</li>



<li>Install the software on your computer.</li>



<li>Open the OpenPLC Editor and configure the environment for your CONTROLLINO Micro PLC:</li>
</ol>



<ul class="wp-block-list">
<li>Navigate to <strong>Settings &gt; Device</strong> and select &#8220;CONTROLLINO Micro&#8221; from the list.</li>



<li>Ensure the correct COM port is selected.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master">Controllino&#8217;s OpenPLC repository</a></div>
</div>



<h3 class="wp-block-heading">Step 2: Create the Ladder Logic Program</h3>



<ol class="wp-block-list">
<li><strong>Define Variables</strong>:<br>Open the OpenPLC editor and define the variables listed below: Name Type Description <code>Control_button</code> BOOL Push button input to control brightness cycling. <code>Light_output</code> BOOL PWM output controlling the light intensity. <code>Light_bright</code> INT Tracks the current brightness level. <code>Pulse_regulator</code> TIME Timing variable for PWM modulation. <code>Light_on_state</code> BOOL Indicates whether the light is currently on. <code>Reset_state</code> BOOL Resets the brightness level to maximum. <code>Flag_cicle</code> BOOL Controls PWM signal cycling. <code>Full_bright</code> BOOL Indicates the full brightness state.</li>
</ol>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="370" src="https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1024x370.jpg" alt="" class="wp-image-17498" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1024x370.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-300x108.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-768x277.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1536x554.jpg 1536w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables-1200x433.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OpemPLC-Variables.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol class="wp-block-list">
<li><strong>Draw the Ladder Diagram</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Implement the logic as described in the <strong>Ladder Logic Explanation</strong> section below.</li>



<li>Use counters (CTU), timers (TP and TOF), and comparators (EQ, GT) to create the control logic.</li>
</ul>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://github.com/CONTROLLINO-PLC/OpenPLC_examples/tree/master/Dimmer_light_control">Download OpenPLC project here</a></div>
</div>



<h3 class="wp-block-heading">Step 3: Understanding the Ladder Logic</h3>



<h4 class="wp-block-heading">Button Press and Brightness Cycling</h4>



<ol class="wp-block-list">
<li><strong>Counter (CTU0)</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Each button press increments the counter.</li>



<li>The counter cycles through brightness levels (0, 1, 2, 3) and resets to 0 after reaching the maximum level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Brightness Level Comparison</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use comparators to determine the brightness level (<code>Light_bright</code>) and adjust the PWM pulse width accordingly.</li>
</ul>



<ol class="wp-block-list">
<li><strong>PWM Signal Generation</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Use timers to control the on/off duration of the PWM signal based on the current brightness level.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Light Output Control</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>The variable <code>Pulse_regulator</code> adjusts the <code>Light_output</code> signal to modulate light intensity.</li>
</ul>



<h3 class="wp-block-heading">Step 4: Connect the Hardware</h3>



<ol class="wp-block-list">
<li><strong>Wiring</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Connect the push button to a digital input pin (e.g., <code>CONTROLLINO_D0</code>).</li>



<li>Connect the light output to a PWM-capable pin (e.g., <code>CONTROLLINO_Q0</code>).</li>
</ul>



<ol class="wp-block-list">
<li><strong>Pin Mapping</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Assign the <code>Control_button</code> variable to the input pin connected to the push button.</li>



<li>Assign the <code>Light_output</code> variable to the output pin connected to the light.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1024x768.png" alt="" class="wp-image-17495" srcset="https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1024x768.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-300x225.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-768x576.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1536x1152.png 1536w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1-1200x900.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/Electric-diagram-1.png 1630w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Step 5: Load and Run the Program</h3>



<ol class="wp-block-list">
<li><strong>Upload the Program</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Save your ladder logic project.</li>



<li>Use the OpenPLC Editor to upload the program to your CONTROLLINO Micro.</li>
</ul>



<ol class="wp-block-list">
<li><strong>Test the System</strong>:</li>
</ol>



<ul class="wp-block-list">
<li>Power on the CONTROLLINO Micro.</li>



<li>Press the push button and observe the light cycling through brightness levels.</li>
</ul>



<h3 class="wp-block-heading">Ladder Logic Explanation (Detailed)</h3>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="819" src="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1024x819.jpg" alt="" class="wp-image-17496" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1024x819.jpg 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-300x240.jpg 300w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-768x614.jpg 768w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1-1200x960.jpg 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-1.jpg 1358w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Counter (CTU0)</strong>:</p>



<ol class="wp-block-list">
<li></li>
</ol>



<ul class="wp-block-list">
<li>Tracks the number of button presses and increments the <code>Light_bright</code> variable.</li>



<li>Resets to 0 after reaching the maximum brightness level.</li>
</ul>



<p><strong>Reset and Cycling</strong>:</p>



<ul class="wp-block-list">
<li>When the brightness reaches the lowest level, the <code>Reset_state</code> variable resets the system to the maximum brightness level.</li>
</ul>



<p><strong>Brightness Control</strong>:</p>



<ol class="wp-block-list">
<li></li>
</ol>



<ul class="wp-block-list">
<li>Use comparators (<code>EQ</code>, <code>GT</code>) to map the brightness level to a PWM duty cycle.</li>



<li>Timers (<code>TP0</code>, <code>TOF0</code>) generate the PWM signal by controlling the on/off duration of <code>Light_output</code>.</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="474" src="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1024x474.png" alt="" class="wp-image-17497" srcset="https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1024x474.png 1024w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-300x139.png 300w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-768x355.png 768w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2-1200x555.png 1200w, https://www.controllino.com/wp-content/uploads/2024/11/OplenPLC-Program-2.png 1344w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Troubleshooting</h3>



<ol class="wp-block-list">
<li>Verify the wiring between the push button, light, and CONTROLLINO.</li>



<li>Ensure that the correct input and output pins are assigned to the variables.</li>



<li>Check for errors in the ladder logic program using the OpenPLC debugger.</li>
</ol>



<h3 class="wp-block-heading">Conclusion</h3>



<p>You have successfully implemented a PWM-based light intensity control system using a CONTROLLINO Micro and OpenPLC. By integrating ladder logic and PWM, this project demonstrates an efficient way to control light brightness with a single push button. Experiment with the timing variables and additional functionality to customize the system further.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
