PROGRAMMING SCHOOL
OpenPLC for Raspberry Pi
1. Setup instructions for OpenPLC Runtime
2. Traffic lights
3. COLOR SENSOR - ANALOG INPUTS

Setup instructions for OpenPLC Runtime
runtime.jpg

OpenPLC needs to be installed on the Raspberry Pi. Installation instructions can be found at https://www.openplcproject.com/runtime/raspberry-pi/. After installation, you need to configure the OpenPLC webserver to work with the Raspberry Pi interface and the Pi-F5 / T5 interface. Detailed instructions are attached. The zip file also contains a test program for all inputs and outputs (Pi-LED).
( 1.1 Mb )

Traffic lights
02.jpg
02
Example of light control on a traffic light model. An example is for the Raspberry Pi-F5 / T5 board.

COLOR SENSOR - ANALOG INPUTS
03.jpg
03
Color reading via a COLOR sensor (fischertehnik) connected to the analog input (A0) of the Pi-F5 interface. The video example was made with an interface where the PULL UP resistor on the first analog input (A0) was removed. By removing the PULL UP resistor we got a bigger difference in color reading. The example works even without removing the PULL UP resistor, only the differences in the read values between the colors are smaller and more susceptible to errors. Give it a try.