PiRoCon from 4tronix
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
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 !
What sort of sensor?
What pin is it connected to;
Does the sensor have a led indicator on it?
Simon
Oups, sorry, I forget to say it is the HC-SR04 sonar sensor…so there’s nothing on it.
Right – so those 4 pins need to go into the special Ultrasonic 4 pins inputs on the PiRoCon.
Then do a broadcast Ultra8
and then goto sensing blocks and on the second bottom block – click on the the little arrow and select Ultra8 and then tick the box so you can see it updating in your main Scratch window
Simon
Las, no….I only have the value ‘299’ in the scratch main window…
What is the ‘motoracount’ sensor ?
Hi – I’ve wired my PiRoCon back up and ultra8 is working for me using ScratchGPIO4 so I don’t think its a software bug this time 🙁
I’d check your wiring just to make sure all the wires are going to right place
BTW it read 299 if no object is detected (its it max reported value setting)
The MotorACount is me testing to see if I can read the motor encoders that come with an Initio Robot – are you using the Initio chassis or something else?
Can you get hold of another Ultrasonic sensor to test?
Simon
Thanks a lot for trying.
The Ground is the nearest of the edge of the board, then Echo, then Trig, and the Vcc.
Is that correct ?
Is it ultra8 or Ultra8 ?
This sonar is quite different, because it is on a special card for arduino…but without component, just different wire.
That is the way mine is wired.
All commands are case in-sensitive so it makes no difference
Does the sonar module work OK on your arduino – have you got a link to it – this is the ones I use
http://4tronix.co.uk/store/index.php?rt=product/product&product_id=137
Simon
It is the same sonar. but with a card connected to a special shield for children and it is not distributed yet…
But I can send you a file with technical information.
As long as there is nothing in the shield to affect it – it shouldn’t make any difference then – have you tried it in an arduino?
Simon
Yes, and it works…
I’m out of ideas then – maybe a faulty PiRoCon?
Simon
Do the other functions of ScrathGPIO4 and the PiRoCon work OK – does it control Motors for you OK?
Simon
Sorry, I was in week-end 😀
Everything works fine with this version : motors, servomotor. I did not tried input yet.
Thanks.
Hi,
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.
Florian
Hi
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.
Simon
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!
flo
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
Could you email me your Scratch script to just make sure that is right first please 🙂
(or take a picture and post it here if that’s easier)
Simon
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.
Cheers
Rod
I’m using some 2300mAH Energiser Extreme NiMh as recommended by 4tronix – they last longer than a few minutes 🙂
Simon
Hi,
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
If using the 1.2 version – you need to set AddOn to PiRoConB
Let me know if that doesn’t work please
Hi
I change with PiRoConB but it’s the same problem…
I’m away at moment but I’ll check when I get home Can you make sure your in latest version please http://cymplecy.wordpress.com/scratchgpio/scratch-raspberrypi-gpio/ Simon On 6 May 2014 15:06, “CympleCy (SimpleSi)” wrote:
>
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
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
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
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 ?
You know. I’ve seen this before but I can’t rember what the solution was 🙁 are you using ScratchGPIO5 or the test version ScratchGPIO6Alpha?
Hi,
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
An ultrasonic sensor must be wired up as per this diagram http://cymplecy.wordpress.com/scratchgpio/addon-boards/ultrasonic-sensor/ ad not directly connected to pins to work with SCratchGPIO
Cymplecy,
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
Nevermind…
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.
Thanks!
Glad you found it before I got back to you 🙂
Hi there!
I just needed to know what Motor A/B are, and if possible the rest of the variables.
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?
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