PiRoCon from 4tronix

pirocon1Draft information

The PiRoCon from 4tronix is a robot vehicle controller board with direct support for 2 bi-directional motors, 2 servos, an Ultrasonic Module and 8 input/outputs that can handle 5V and 3.3V devices so its very useful for just plug and play robotics 🙂

As well as the above, you can plug an additional expansion module – the Adafruit 16 channel PWM/Servo Board into it and control those outputs as well.

The script on the left shows the variables that it responds to

Tilt can be from -70 to 80, Pan from -90 to 90, MotorA/B from -100 to 100.

Setting Tilt or Pan to off is available to help extend battery running time and the servos will just stay in there last position.

The Ulrasonic support input is exactly the same  as previously documented except no need to wire any resistors as the PiRoCon board does that for you 🙂

If you plug in the Adafruit board, then the pins can be reffered to as Servo1 to Servo16 or Power1 to Power16 if just needing normal PWM outputs for driving motors(thru extra buffer electronics) or direcly varying LED brightness

You may also like...

38 Responses

  1. Hello,
    I tried the sensor on the PiRoCon but it doesn’t work…and I don’t know if it is a sensor problem, a hanlder problem or my scratch knwoledgement problem…

    Could you post an example ?

    Thanks !

  2. Las, no….I only have the value ‘299’ in the scratch main window…
    What is the ‘motoracount’ sensor ?

  3. Sorry, I was in week-end 😀
    Everything works fine with this version : motors, servomotor. I did not tried input yet.

  4. Florian says:

    i Have the PiRoCon Board on the Initio Platform, Motors and Servos work fine,
    but i have a few questions:

    1. The Ultrasonic (HC-SR04 sonar) works sometimes, and sometimes not:
    when i do a broadcast Ultra8 (or Ultra23 tried both) i can not always find the Ultra 8 in the
    Sensing Blocks List, i have to disable RSC and enable it again, but even by doing this, the
    Ultra8 is only every third to fifth time in the list and the pin numbers in the list vary, sometimes
    4 pins (11,12,13,15) sometimes none sometimes two pins are shown in the list…
    what could cause this behavior?
    i´m goning to orde a second PiRoCon, maybe my first one is faulty, but it takes some delivery
    time, so i´m trying to fix the first one 😉

    2. The Initio came with speed sensors;
    Fromt this site(http://4tronix.co.uk/arduino/4tronix-initio.php) i figured out the colors
    (Black – Ground, Red – 5V, Orange – Interrupt, Brown – Direction)
    is it possible to use the speed sensors with Scratch GPIO 4?

    thanks for your answers.

    • cymplecy says:

      1. If your Ultra sensor is not near anything – then it doesn’t return a value. Try putting an object 10cm away. I will make it it returns a value in future 🙂

      2. This is a slight bug that has been fixed in development version and I will release it shortly 🙂

      3. I am currently working on this with 4tronix to see if its possible and have had some encouraging resultsbut it might need a little add on on board.


      • Florian says:

        thank you very much for your answers!
        seems all my problems will be fixed in future updates 😉

        thanks for your great work on scratch GPIO!

  5. Rod Heal says:

    Hi, have the PrRoCon on a RaspberryPi but find that the moters don’t seem to work. I can get the pan and tilt to work fine. Any thoughts

  6. Rod Heal says:

    Hi, Thanks for the reply. The motors now work. I think I hadn’t used the correct version of scratch.
    I find that the Initio won’t run for more than a few minutes on batteries. How long do they normally run on fully charged batteries?
    Any help to get it to last for more than a few minutes would be appreciated.

  7. Michel says:


    I have got 1 Pirocon V1 and 3 Pirocon V1.2. I’ve made up a program with scratch for the Pirocon V1 and everything is OK. Then I change the Pirocon V1 for the 1.2 version, it doesn’t work anymore. The motors turn but sometimes the motor A turns instead of motor B.
    That’s the case for the 3 Pirocon V1.2 that I own.
    Is it a hardware equipement problem or a software problem?
    I’m a frenc teatcher and sorry for my english!!
    Thanks a lot

  8. michel says:

    sorry I was wrong sd card. I installed Scratch GPIO5 and modified Addon PiRoConB. Engines are running well! . Tomorrow I continue with sensors.Thank you

  9. michel says:

    there just has a problem with scratching. When you click the icon, the software does not start
    I have to go through the file manager

  10. michel says:

    there just has a problem with scratch. When you click the icon, the software does not start
    I have to go through the file manager

  11. James Boag says:

    Hi Everyone, Just built my robot my only real issue is that the spin left and spin right actually run forward and reverse on my raspberry pi b+ Checked the wiring all seem to be ok any clues ?

  12. jj says:

    I’m having some trouble with ultrasonic sensor. All other sensors and motors work just not this one. When I attach the four wires into the ultrasonic pins I get the value of 1 (which I think means that no signal is even being sent out). If I connect the Trig wire to pin 8 directly, I get the value 299 (this I would say means that sends the signal but doesn’t receive anything, i.e. the echo wire doesn’t get any signal), are my conclusions correct? Do you have an idea what I might be doing wrong?

    Thank you

  13. Shad says:

    Thanks for building/maintaining this great extension to the Scratch environment. I like the modularity and extensibility of it.

    This is the only place I see reference to the Adafruit 16 servo board. Is there another “AddOn” option that can be used if just using the Adafruit 16 servo board directly, rather than as an add-on to the PiRoCon, or other board?

    I tried using “PiRoCon” as “AddOn”, but received no response on my test LED when sending a value to “Servo1”. (note: I can run the Adafruit Python test script with their library and adjust the LED, so I’m sure it’s hooked up correctly.) I wasn’t sure this would work at all, depending if there were any detection of the PiRoCon board, so I went looking through the code in scratchgpio_handler7.py. I didn’t see anything actually looking for Servo1-Servo16 or Power1-Power16 in the pirocon sections, nor elsewhere. I’m more of a C#/Java programmer, so I’m still muddling my way through Python, so could’ve easily missed something.

    I did find that the sgh_Adafruit_PWM_Servo_Driver.py had the address correct at 0x40, but the i2cbus was set to 0 (correct for original Pi boards, but Pi2 uses i2cbus 1), so I changed that to 1, still no luck on my test LED.

    I’m trying to piece-together the required bits to enable setting of “AddOn” to “Ada16PWM” or some such, and bring in just the parsers for the 16 Servo/Power settings… Does this seem a reasonable way to go about it, or is there another way that I haven’t stumbled upon yet?

    Many thanks,

    • Shad says:

      I found, in scratchgpio_handler7.py, that a directly connected Adafruit 16 servo board has it’s outputs referenced as adaServo1 – adaServo16 or adaPower1-adaPower16. After changing my variables to use those names, my test app is working like a charm.


  14. Hi123456789 says:

    Hi there!

    I just needed to know what Motor A/B are, and if possible the rest of the variables.

  15. Jon Smith says:

    Would an Adafruit stepper motor hat (connected to pirocon via i2c) work with scratchGPIO? I see that a pwm server works? Not sure if an additional python module might be needed to link the stepper logic to i2c?

    • cymplecy says:

      I support any stepper hats working thru I2c sorry. And as well, I don’t support 2 hats being used at the same time so double sorry

Leave a Reply

Your email address will not be published. Required fields are marked *