sainsmart

 

Raspberry PI (Raspberry Pi is a trademark of the Raspberry Pi Foundation) is not only used as a learning plattform – it is already used in productive environments, too. So a lot of embedded systems are based on that plattform already. And we also have some data collecting systems based on R-PI.

R-PI is not really real-time, but good enough for a lot of use cases.

So we have some in productive systems and research projects already in use.

Our latest tests showed us, that Model B and B+ are very reliable and stable – but R-Pi 2 Model B is not.

This is our test scenario:

* SainSmart 8-Kanäle RelaisModul Brett 5V Für Arduino PIC AVR MCU DSP Relay Module, Raspberry PI Model B+ (of course with an ULM2803A module in the middle and some cable), Raspian

* SainSmart 8-Kanäle RelaisModul Brett 5V Für Arduino PIC AVR MCU DSP Relay Module, Raspberry PI 2 Model B (of course with an ULM2803A module in the middle and some cable), Raspian

This is the python script we use for our tests (simple: initialize – on – off – cleanup) and runs endless (via bash script) – results:

* PI 1 Model B+: just stopped after 10 days non stop switching relais

* PI 2 Model B: first run: 242 switches – turned off, 5200 switches – turned off, 542 switches – turned off

That means for such applications PI 2 is not recommended by us nowadays – even if it is really amazing hardware – of course we go on working based on PI2 but going productive on PI1-B+ only.

Here our small python test routine:

import RPi.GPIO as gpio
import time
# peter ports = [6,12,13,19,16,26,20,21]

# port list
"""
#     GPIO-6  ==> relay 1
#     GPIO-12 ==> relay 2
#     GPIO-13 ==> relay 3
#     GPIO-19 ==> relay 4
#     GPIO-16 ==> relay 5
#     GPIO-26 ==> relay 6
#     GPIO-20 ==> relay 7
#     GPIO-21 ==> relay 8
"""
ports = [6,12,13,19,16,26,20,21]

#set pins to BCM mode
gpio.setmode(gpio.BCM)

#setup all pins for output
for port in ports:
gpio.setup(port, gpio.OUT)


#set all pins to high (relay close NO, open NC)
print("high")
for port in ports:
gpio.output(port, gpio.HIGH)


time.sleep(0.1)

#set alls pins to low (relay open NO, close NC)
print("low")
for port in ports:
gpio.output(port, gpio.LOW)
# free gpio pins
gpio.cleanup()