Tinkerforge Motor Driver
There is a nice mikrocontroller kit system available, see tinkerforge.com . Just connect the bricks and begin to program your application! No need to have a soldering iron…
There are lots of sensors and also IO-boards (named “bricklets”) – however there was no bricklet which can control 4 tortoise turnout motors “out of the box”.
Schematics: (for the software the module is identical to the IO-4 Bricklet )
Using this bricklet with JAVA
If you connect to a RaspberryPI (and with “raspian”OS ), you must first
- install the pm-utils:
sudo apt-get install pm-utils
- download the brick-deamon and install it with
sudo dpkg -i brickd-2.1.0_armhf.deb
- download the Tinkerforge java-lib (Tinkerforge.jar), store for example in /opt/javalib
- for additional info see this link: Java and Tinkerforge
- finally compile and run the following test program (change UIDs to your UIDs, make sure that Tinkerforge.jar can be found on classpath etc.). This test program switches a turnout at port 1 in one direction and after 5 seconds in the other direction.
import com.tinkerforge.BrickMaster; import com.tinkerforge.IPConnection; import com.tinkerforge.BrickletIO4; public class JLPITinkerMain { private static final String HOST = "localhost"; private static final int PORT = 4223; // master brick UID 6qAdgK // wdec UID mb84w private static final String MASTER_UID = "6qAdgK"; private static final String WDEC84_UID = "mb84w"; public static void main(String[] args) throws Exception{ IPConnection ipcon = new IPConnection(); // Create IP connection BrickMaster master = new BrickMaster(MASTER_UID, ipcon); // Create device object BrickletIO4 wdec84 = new BrickletIO4(WDEC84_UID, ipcon); // Create device object ipcon.connect(HOST, PORT); // Connect to brickd // Don't use device before ipcon is connected // Set pin 1 output high wdec84.setConfiguration((short)(1 << 1), 'o', true); // wait 5 seconds Thread.sleep(5000); // Set pin 1 output low wdec84.setValue((short) 0); System.out.println("press key to exit"); System.console().readLine(); ipcon.disconnect(); } }
To control tinkerforge modules via “Lanbahn” UDP Multicast pakets, I have written some small java programs which you find on: sourceforge – project Lanbahn, directory tinker
“work in progress”: a compact 4-channel “train-on-track-indicator” (with galvanic isolation via optocouplers) for the Tinkerforge System. The blue connector is for ISP programming of an ATtiny84. | ![]() |