I have an Arduino motor shield like this one plugged into my Mega board.
Arduino motor shield
I would like to know some more information about the orange and white pin blocks on the board. The Arduino website has the following information, but it doesn't give any explanation of what is best to use them for or which pins are mapped to the data pins etc.
- TinkerKit connectors for two Analog Inputs (in white), connected to A2 and A3.
- TinkerKit connectors for two Aanlog Outputs (in orange in the middle), connected to PWM outputs on pins D5 and D6.
- TinkerKit connectors for the TWI interface (in white with 4 pins), one for input and the other one for output.
What I want to do is connect a servo up to the board and was hoping I could use one of the orange OUT
blocks. I haven't been successful in finding any examples of this which leaves me in doubt as to whether it is possible or not. I would just plug it in, but I'm afraid of frying the shield/mega/servo. Probably an irrational fear, but I can't afford another one of any at the moment!
I don't know which pins in the block are assigned to the data, vcc and out, so if anyone know I would be grateful for the answer.
Also, just because it is annoying not to understand, what are the TWI
connectors for?
I hope this isn't too general a question as I could really use some answers!
-
The Arduino forum has some info you might find useful: forum.arduino.cc/index.php?topic=94474.0akellyirl– akellyirl2014年03月04日 16:41:58 +00:00Commented Mar 4, 2014 at 16:41
-
Thanks @akellyirl, that is definitely helpful. Not what I was hoping for, but I'm not surprised... I'll just have to extend the 3-wire cable from the servo with individual connectors to go to separate pins on the Arduino as necessary. (I don't particularly want to splice the connector) Oh well!bladepanthera– bladepanthera2014年03月04日 16:56:21 +00:00Commented Mar 4, 2014 at 16:56
-
For what it's worth, Adafruit do a Motor Shield that brings out pins for 2 servos: learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/…akellyirl– akellyirl2014年03月04日 17:01:50 +00:00Commented Mar 4, 2014 at 17:01
-
TWI = Two Wire Interface (the other 2 pins are power and gnd). This is just a renaming of a possibly incomplete implementation of I²C bus, see: en.wikipedia.org/wiki/I%C2%B2C#Derivative_technologiesRon– Ron2014年03月14日 09:55:11 +00:00Commented Mar 14, 2014 at 9:55
-
The 4-pin TWI headers have pitch 2.54 mm and are compatible with Molex crimp housing 22013047 each holding 4x crimp contacts 8500113. Molex also offers complete cable assemblies in three different lengths: 150 mm (2177971041), 300 mm (2177971042) and 600 mm (2177971043).boink– boink2024年08月20日 13:17:25 +00:00Commented Aug 20, 2024 at 13:17
4 Answers 4
I don't know which pins in the block are assigned to the data, vcc and out, so if anyone know I would be grateful for the answer.
Following the example on TinkerKit's Custom Distance Sensor page, we see that:
If you look on the edge of the sensor, you can see the three pins, that are power (5V), ground and signal. The same as your TinkerKit! modules, just in a different order.
The only difference is that the signal and ground cable are inverted.
So the order in the connector is Vcc Signal Ground.
Another way, and what I would do to be 100% sure, is measure resistance with a multimeter. If your meter has a continuity test feature, that's even better because it'll beep.
Anyway, put one end of the probe on pin 1 of the connector and the other end on GND and see if the resistance is very close to 0 ohms. If it's reading OL (Over-Limit) then that pin is not GND.
Put the probe on Vcc instead and it should show 0 ohm or beep. So now you know that pin is Vcc.
Do the same for the other pins and find out which one is ground. The third pin is your PWM output. It's connected to D5 or D6, check the continuity on those pins to see which one.
...which pins are mapped to the data pins etc.
The shield page provides a schematic
I would like to know some more information about the orange and white pin blocks on the board
These have the reference printed on the board enter image description here
TWI IN and TWI OUT
They are the same and are both connected to the same I2C pins of Arduino (SCL, SDA). They are intended to help in case you want to connect more than one device. enter image description here
OUT 5, OUT 6
Connected to Arduino pins 5 and 6 (PWM outputs)
enter image description here
IN 2, IN 3
Connected to Analog in A2 and A3
enter image description here
The power outputs of L298 intended to drive the motor are the blue screw connectors.
enter image description here
-
1@bladepanthera also remember when you see the tilde
~
on an Arduino board, they are reminding us these pins support PWM. Also, when using connectors, the concept of "in" and "out" are suggestions. I'd rather see A2, A3 to remind us it is capable of analog input.Krista K– Krista K2014年03月06日 01:06:59 +00:00Commented Mar 6, 2014 at 1:06
You can use Thinkerkit pins(out ~5 and ~6) for controlling servos. Just need to do a bit of tweaking here. Hobby servo motors have got 3 pins orange(signal) , red(live+) in the middle, and brown(gnd-). But, the motor shield rev3 uses the middle pin for signal. To overcome this problem, swap the middle wire with the orange one on the servo plug.
There are three small latches that prevent wires coming out of the plug, use the tip of a needle and with little force slightly lift them up then pull out the wires from the servo plug, they should come off easily.
Remember to attach pin 5 or 6 in the arduino code. I used servo.h library.
Although the 'Orange' (Out) pins of the Deek-Robot Motor Shield can be used to drive a servo by swapping the '+5vdc' and 'Signal' wires at the servo harness plug it is best to not do as this. This is because the current drive for the servo is drawn from the Arduino UNO. Given that an individual servo can draw well in access of 125ma the current draw may/will exceed the current sink limitations of the associated Arduino UNO circuitry. It is best to use an external power source, properly filtered for electrical noise, as the current source for the servo(s). This has been documented/recommended in multiple information sources.