Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

new version is now available - how to connect 1wire sensors

2014-10-08
2015-03-09
  • eschwellinger

    eschwellinger - 2014-10-08

    What is new in this version CODESYS Control for Raspberry Pi SL V2.0.1.0?

    Image based on
    Raspbian Debian Wheezy
    Version:September 2014
    Release date: 2014-09-09

    • OneWire is supported - example project "c:\Users\<yourusername>\CODESYS Control for Raspberry PI\2.0.1.0\Onewire.project" </yourusername>
    • two I2C Master are possible (B+)
    • SPI speed configurable
    • GPIO's A/B and the B+ model
    • plc runtime Version 3.5.5.20

    Attention: After installing the store package you need to update the raspberry pi device in the device tree by rightclick 'update device'
    for your existing projects.

     
  • dwomack - 2014-10-09

    I have the older version set up with modifications to SSH, etc.

    My Raspbian is fully updated.

    Is it possible to update via the .deb file that is included with this release?

    How do you do that?

    I am a linux novice, but I really don't want to start with a newly imaged SD.

    Thanks

    Dennis

     
  • eschwellinger

    eschwellinger - 2014-10-10

    Hi Dennis,

    you will find the debian package in the zip file which you download from the store.
    Copy this codesyscontrol_arm_raspberry_V3.5.5.20.deb by the CODESYS file browser to the raspberry pi.
    Then open an ssh connection to the pi (use putty -> google it)
    then in ssh if you are connected call

    sudo dpkg -i /root/codesyscontrol_arm_raspberry_V3.5.5.20.deb

    That was it on Linux side, the new runtime 3.5.5.20 is now running after doing this.
    In CODESYS you need to install the new package.

    Regards
    Edwin

     
  • Anonymous - 2014-10-10

    Originally created by: 30fyllos

    Edwin Schwellinger hat geschrieben:
    What is new in this version CODESYS Control for Raspberry Pi SL V2.0.1.0?
    Image based on
    Raspbian Debian Wheezy
    Version:September 2014
    Release date: 2014-09-09
    - OneWire is supported - example project "c:\Users\<yourusername>\CODESYS Control for Raspberry PI\2.0.1.0\Onewire.project"
    - two I2C Master are possible (B+)
    - SPI speed configurable
    - GPIO's A/B and the B+ model
    - plc runtime Version 3.5.5.20
    After installing the store package you need to update the raspberry pi device in the device tree by rightclick 'update device'
    for your existing projects.</yourusername>

    How to connect a one wire device (ds18b20) to raspberry (pin number, circuit ?)

     
  • eschwellinger

    eschwellinger - 2014-10-10

    Hi,

    there are so many out there in my case I've used:

    http://www.amazon.de/gp/product/B00DGJW ... UTF8&psc=1

    Attention: the colors might be different if you use other sensors!
    Wiring:
    White=Data, Black=GND Red=3.3V.

    White=Data= GPIO4
    Red=3.3V
    Black= GND

    BR
    Edwin

    IMG: OnewirecConnect.jpg

     
  • switcher - 2014-10-14

    Hi,

    I have tested 1-wire functionality and it is a great new future, thank you!

    I connected 7 sensors to test.
    I saw that the values for sensor refreshes every 6sec., this means almost 1sec/sensor.
    I am interesting how communication like this occupies Raspberry and if this drastically reduces performance of Raspberry (regarding executing the rest of Codesys program).

    Thank you.

    Best regards,
    Zdenko.

     
  • eschwellinger

    eschwellinger - 2014-10-14

    Hello,

    I would recommend in any case to use the 1-wire in an additional task. (low prio )
    Then the other stuff in you plc project should not be influenced by this "temperature measuring" ....
    Even if you use 1 wire under Linux, you will see this has the same performance which is ok for measuring temperature
    Regards
    Edwin

     
  • m-eriksson - 2014-11-10

    Hello

    I have a project with four DS18B20 sensors which I use in a low prio task and the other plc code in another task with higher prio.
    The task with high prio runs ok and in monitor mode it updates independent from the slow temp measurement. But writing to physical GPIOs seems to be slowed down by the 1-wire bus cycletime (aprox. 4sec).
    Any ideas on how to get around this problem?

    Regards, Magnus

     
  • eschwellinger

    eschwellinger - 2014-11-10

    Hello Magnus,

    think you need to specify the Task which are updating the IO's

    For one wire see screenshot slowtask.jpg
    and for GIPO's you need to assign them to the plc_prg ... plc task.
    Sure use the IO's only in the specified task is an additional precondition.
    This should solve your problem.

    BR
    Edwin

    IMG: GPIOTask.jpg

    IMG: slowtask.jpg

     
  • acter - 2015-03-09

    Edwin Schwellinger hat geschrieben:
    Hi,
    there are so many out there in my case I've used:
    http://www.amazon.de/gp/product/B00DGJW ... UTF8&psc=1
    the colors might be different if you use other sensors!
    Wiring:
    White=Data, Black=GND Red=3.3V.
    White=Data= GPIO4
    Red=3.3V
    Black= GND
    BR
    Edwin

    Isn`t it dangerous connect a bus directly to RasPi pins ? For example induct voltage at wires...

    Doesn`t exist any bus optical separator ?

     

Log in to post a comment.