Rei Vilo's fischertechnik Corner
  • About
  • Blog
  • Reviews
    • How to Start?
    • Controllers >
      • Robotics TXT
      • TXT 4.0 Controller
      • Bluetooth Smart Beginner Set
      • Interface Boards for fischertechnik Models
      • Didacta Advance Pi-F5 interface board
    • Sets >
      • Technical Revolutions Set
      • Pneumatic Power Set
      • Automation Robots Set
      • Electro-Pneumatic Set
      • Starter Set for micro:bit
      • Bluetooth Smart Beginner Set
      • Robotics TXT Smart Home Set
    • Exploring the Lego World >
      • Purchasing
      • Unboxing
      • Installing
      • Building
      • Programming
      • Connecting
      • Playing
      • Expanding
      • Concluding
  • Models
    • Back to the 70's
    • Micro Models
    • New Magasin >
      • Magasin releases 1, 2 and 3
      • Long X-Axis
      • Moving Desk And Y-Axis
      • Compressed Air And Vacuum For Z-Axis
      • Pictures
      • Specifications
    • Power Saving White LED
    • Flipper with I²C LCD Panel
    • Celebrating 50 Years!
    • ft Convention 2013
    • ft Convention 2014
  • Sensors
    • Interfacing an Arduino to a Robo TX Controller >
      • Analog Interface
      • Digital Interface
      • I²C Interface
    • Standard Sensors >
      • Playing With Accelerometers
      • Proximity Sensor
      • Pressure Sensor
    • Advanced Sensors >
      • Industrial Colour Reader
      • Stepper Motor Controller
      • DC-Motor with Quadrature Encoder Controller
    • smartDevices >
      • smartColours
      • smartRFID
      • smartLED
      • smartHub
      • smartControls
      • smartMeter
      • smartCamera
      • smartNewCamera
      • smartWiFi
      • smartBLE
      • smartNode
      • smartIMU
  • RoboPro
    • Value Operations >
      • Min and Max Functions
      • Signal Management With Median
      • Modulo Function
      • Map Function
    • Standard Modules >
      • Software Managed Compressor
      • Self-Calibrated Colour-Reader
      • Standard Conveyor Belt Routine
      • Management Panel
      • Encoder-Motor Position Management
    • Variable Types >
      • CSV List Management
      • Queue Function
    • Program Structures >
      • Parallel Processing
      • Multi-Tasking End Management Procedure
    • Tutorials >
      • Setting Bluetooth LAN with Multiple TX-Cs
      • Dealing with Very Large Models >
        • Getting a General View
        • Defining User's Functions
        • Elaborating the Modelisation
        • Defining the Processes
        • Setting the Messages
        • Going Further
        • References
      • Program Error 2 Message
  • I²C
    • How to Connect an I²C Device to the Robo TX?
    • How to Connect an I²C Device to the Robotics TXT?
    • How to Manage an I²C Device?
    • How to Use an I²C Driver?
    • List of I²C Drivers for Sensors >
      • I²C Real Time Clock DS1307
      • I²C LCD screen 4 lines of 20 characters LCD03
      • I²C Triple Axis Accelerometer ADXL345
      • I²C Red-Green-Blue LED BlinkM
      • I²C Two Axis Compass HMC6352
      • I²C Triple Axis Magnetometer HMC5843
      • I²C True Colour Sensor ADJD-S371
      • I²C Stepper Controller AMIS-30624
    • List of I²C Drivers for smartDevices >
      • I²C True Colours Smart Sensor smartColours
      • I²C RFID Smart Sensor smartRFID
      • I²C 4-Digit 7-Segment LED Display smartLED
      • I²C Screen With Touch and SD-Card smartControls
      • I²C Smart Sensor smartCamera
      • I²C Smart Sensor smartNewCamera
      • I²C Remote WiFi Interface smartWiFi​
      • I²C Remote Bluetooth Interface smartBLE​
      • I²C Remote Interface smartNode​
      • I²C New LCD Screen 4 x 20 characters smartLCD
      • I²C Inertial Measurement Unit smartIMU

Didacta Advance Pi-F5 interface board

After the fischertechnik-compatible interface board for the BBC micro:bit launched last year, Didacta Advance has announced three new interface boards. 

They answer the wish I made after my initial review of the micro:bit IO F5 board: I hoped Didacta Advance would consider more powerful third-party boards, including single board computers like the Raspberry Pi or the BeagleBone.

​The new interface boards target the Arduino Uno and Arduino Mega micro-controller and the Raspberry Pi single board computer. fischertechnik mentions them in the Education Catalog 2020.

​I've ordered one Pi-F5 interface board for the Raspberry Pi and used it on a Raspberry Pi 3B and a Raspberry Pi Zero Wireless.

Hardware

 The board consists on two sections:
  • A 40-pin connector to plug the board on top of the Raspberry Pi,
  • Connectors or holes for standard fischertechnik plugs (31336 or 31337), with 12 inputs and 8 outputs.

The fourteen inputs include height digital inputs for the switch (37783), the photo-transistor (36134) and the reed contact (36120), four analog inputs driven by the standard PCF8591 ​connected through I²C, and two servos. All the inputs are protected by the classic resistor and diode circuit.

The eight outputs are driven by two standard L293x Quadruple Half-H Drivers mounted on sockets, easy to replace in case of over-current. Maximum current is 600 mA. So recommended actuators are the LED lamps (164134 and 164135) and the XS motor (137096).

Finally, an I²C port brings expandability for I²C devices.

The board features a 3.5 mm plug for the PLUS Power Set (505283) and also powers the controller board. Another reference features the 5.5 mm plug instead. 
Picture
Picture

Software

All the development solutions available for the Raspberry Pi can be used with:
  • C/C++ and Python IDEs,
  • GUI-based IDEs, like Node-RED,
among other options, not to mention all the IoT tools supported natively, like MQTT.

A pins map is provided with the board, but uses the numbering of the BCM2837​ CPU GPIOs and not those of the 40-pin Raspberry Pi expansion connector.

The Didacta Advance website offers many tutorials with examples on Python with the corresponding cabling (pictured right).

The Raspberry website offers a nice introduction to Python with a list of IDEs and tutorials.

​An example for Python!

Project One

I started with the first project and used Node-RED.

​I faced one issue, one difficulty and one limitation. 
​


​The example ported to Node-RED
  • Although the board is well designed and fits easily onto the Raspberry Pi, some exposed copper pads are too close to the Ethernet plug and may cause a short. 

​​A first solution consists on using standoffs to increase the distance between the Raspberry Pi and the interface board. Another is to affix an 
electrical insulator to prevent any contact.
​


​Beware of the shorts!
Picture
  • The Raspberry Pi board is powered through the expansion board. However, the red LED on the Raspberry Pi, which indicates power, was blinking during operation, which should not happen. 

​The Pi-F5 documentation stipulates 9 V 2.5 A as the minimal requirement, consistent with the fischertechnik Power Set (reference 505283) rated 9 V 2.5 A. Alas, this seems not to be enough to power both the Raspberry Pi 3B (recommended PSU 2.5 A) and the actuators (8 outputs rated at 600 mA and up to 1 A peak). 
​

I asked the support for help and was given two solutions. The MP2307 regulator can be adjusted to provide 5.1 V instead of the initial 5 V, to prevent voltage drops that may reset the Raspberry Pi. A better solution consists on using a more powerful power supply e.g. 9 V ~5 A.

Using the Raspberry Pi Zero Wireless instead of the
Raspberry Pi 3B also solves the problem, as the Raspberry Pi Zero Wireless requires half the power (recommended PSU 1.2 A).
  • The analog ports do not raise events, as the analog converter is an I²C device and does not feature interrupts. As a consequence, the algorithm needs to poll the analog inputs. 

​However, the photo-transistor output can be read through both analog and digital inputs.
​


​The analog to digital converter with 4 inputs and 1 output
Picture

Using Node-RED and events

No surprise, I am a bing fan of ​Node-RED, which excels in IoT. Node-RED comes with all the tools to address the GPIO, even in PWM mode, and the I²C devices. However, Node-RED relies on events, while the initial algorithm was designed for sequential programming. 

​When defining a GPIO with Node-RED, the node displays a map of the GPIOs with the two numbering systems (pictured):
  • GPIO26 corresponds to the BCM2837​ CPU pin, while
  • 37 is related to the 40-pin Raspberry Pi expansion connector.
Other options include pull-up or pull-down resistor for inputs, and digital or PWM signal for outputs. The node also checks no GPIO has conflicting definitions. 
​
To read photo-transistor, I tried the two analog then digital options.
  • The analog input requires using the I²C ADC and a polling mechanism.
  • The digital input implementation is based on event, although the value is in negative logic (LOW=light, HIGH=darkness).​

​Playing with the automatic barrier model

I've reused the same model as last year, an automatic barrier model with 
  • Three inputs, two switches for the motor, one for the photo-transistor; 
  • One combined double output for the XS motor as it operates in both direction; and 
  • Two single outputs for the light barrier and the alarm light. 
​​​
The events are triggered by the inputs the light barrier and the motor switches. They send messages which go through filters based on the current action, and finally define new commands.

Switching from sequential to event-based programming raised no major challenge, provided the initial analysis had been carried thoroughly with a special focus on priorities management
Picture

Turning the projet into IIoT

Once the flow was ready and tested, it was very easy to add IIoT features to the project, including remote command and control dashboard and MQTT messaging, both supported natively by Node-RED. 

Then, the model can be controlled remotely, for example from a tablet!



Picture
Picture
Picture

Finite-state machine to the rescue

The initial flow wasn't very pretty nor easy to read, so I opted for implementing a solution based on a finite-state machine. 

This method relies on an abstract model that lists a finite number of states —hence the name. Inputs can change the machine from one state to another: such changes are called transitions. A last element is the initial state the machine starts with.

More details are available at Using Node-RED for IIoT.
Picture

Conclusion

This series of new boards from Didacta Advance answers the wish I expressed last year, with more powerful third-party boards, including single board computers like the Raspberry Pi.

​At less than 40€, the Raspberry Pi and the interface Pi-F5 board bundle is really affordable and delivers 12 inputs and 8 outputs, 2 servo connectors, an I²C port and a UART port, plus WiFi and Bluetooth. The Raspberry Pi brings all the tools with active support for IIoT projects.

The interface board and the Raspberry Pi are not fixed to the fischertechnik model, contrary to the BBC micro:bit interface board. One idea would be to provide the files for a case to be 3D-printed.

However, keep in mind the Raspberry Pi runs on Linux, and thus could not offer real-time deterministic monitoring or be considered as a PLC.

A more advanced solution would rely on a dual-core configuration, with a CPU for dashboard and communication, and a dedicated MCU to drive the GPIOs.
Picture

Pros

  • Interface board well designed
  • Very popular Raspberry Pi boards 
  • Excellent tutorials for Python
  • Wide offer of tools and IDEs

Cons

  • No interrupt for analog inputs
  • Recommended standoffs and screws not provided

 Wrap-Up

  • Great value
  • Excellent tutorials for Python
  • Wide offer of tools and IDEs, some with native support for IIoT

Links

  • fischertechnik Teaching page
  • Raspberry Pi website
  • Didacta Advance website
Picture
Picture
Picture

Posted: 21 Feb 2020
Updated: 27 Feb 2020, 09 Mar 2020
Powered by Create your own unique website with customizable templates.