Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo Assembly hardware documentation #54

Merged
merged 11 commits into from
Dec 16, 2017
4 changes: 3 additions & 1 deletion .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ square-ish
70x84x20mm
83x99x24mm
4mm
2.2A.
2.2A.
uno
3.3V
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ title: Ultrasound

We noticed many teams used ultrasound sensors to assist the vision system for finer distance measurement. So we've built in the mechanisms for reading and measuring distances using ultrasound right into the kit!

Ultrasound sensors are connected to 2 pins, a _trigger_ pin, and an _echo_ pin. A signal is sent to the sensor on the _trigger_ pin, and the delay on a response on the _echo_ pin can be used to calculate the distance.

{{% notice warning %}}
Ultrasound should only be considered accurate up to around 2 metres, beyond that the signal can become distorted and produce erroneous results.
{{% /notice %}}

## Reading a distance
Assuming you wired the _trigger_ pin to pin 6, and the _echo_ pin to pin 7, you can query the distance from the sensor using:

Expand Down
2 changes: 1 addition & 1 deletion content/kit/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Besides the Pi, there are 3 main controller boards to interface with your kit.

| [Motor Board](motor-board) | [Power Board](power-board) | [Servo Assembly](servo-assembly) |
|---|---|---|
| ![Motor Board](/img/kit/mcv4b.png) | ![Power Board](/img/kit/pbv4.png) | Coming Soon! |
| ![Motor Board](/img/kit/mcv4b.png?width=20pc) | ![Power Board](/img/kit/pbv4.png?width=20pc) | ![Servo Assembly](/img/kit/servo-assembly.jpg?width=20pc) |
14 changes: 14 additions & 0 deletions content/kit/servo-assembly/GPIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: GPIO
---

The arduino allows you to connect your kit to your own electronics. It has 14 digital I/O pins, and 4 analogue. The analogue pins can read an analogue signal from 0 to 5V. The board also has a couple of ground pins, as well as some pins fixed at 3.3V and 5V output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend saying 6 analogue pins here rather than 4, since the you go on to say immediately below that two are reserved for the servo shield.


The pin layout of the servo assembly is the same as an Arduino uno.

![Pin Map](https://raw.githubusercontent.com/Bouni/Arduino-Pinout/master/Arduino%20Uno%20R3%20Pinout.png?width=50pc)


{{% notice note %}}
The servo hat communicates using 2 of the analogue output pins (4 and 5), and so these are inaccessible.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change "analogue output" -> "analogue input".

Also, "inaccessible" -> "reserved". You can still physically plug stuff into them; it'll just make your servo shield behave weirdly.

{{% /notice %}}
18 changes: 18 additions & 0 deletions content/kit/servo-assembly/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
---
title: Servo Assembly
---

The servo assembly allows you to control GPIO pins, Analogue pins, and servos. It's comprised of [an arduino](https://store.arduino.cc/arduino-uno-rev3), and a [servo hat](https://learn.adafruit.com/16-channel-pwm-servo-driver/overview).

![Servo Assembly](/img/kit/servo-assembly.jpg?width=30pc)

## The servo hat
The servo hat enables you to control up to 16 servos. It's attached to the top of the arduino, passing through its pins.

## The reset button
The reset button allows you to instantly reboot the arduino in case it isn't working. This is not a guaranteed fix, however may solve the problem.


## Designs
The board diagrams for both the Arduino and hat are below, as long as the custom firmware on the Arduino. You do not need this information to use the board but it may be of interest to some people.

- [Servo Hat Schematic](https://cdn-learn.adafruit.com/assets/assets/000/036/269/original/adafruit_products_schem.png)
- [Arduino Uno Schematic](https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf)
- [Firmware Source](https://github.com/sourcebots/servo-firmware)
8 changes: 8 additions & 0 deletions content/kit/servo-assembly/servos.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
title: Servos
---

By themselves, an Arduino is incapable of driving servos, without a lot of hard work and pin munging. So we're using a hat instead! This hat allows control of 16 servos.

## Connecting your servos
There are a total of 16 servo connectors, grouped into 4 groups of 4. Servo cables are connected with 0V (the black or brown wire) towards the side of the reset button.

## Power
The Arduino itself is powered entirely over USB. If you wish to use servos, you'll need to supply an additional 5V through the connector on the hat from the [power board](/kit/power-board). There are 2 red LEDs next to the power input, but these lights will turn on if the board is correctly powered.
13 changes: 13 additions & 0 deletions content/kit/servo-assembly/ultrasound.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
---
title: Ultrasound
---

Ultrasound sensors are a useful way of measuring distance when objects are too close for the [Webcam](/api/webcam) to detect, or if they don't have markers. Ultrasound sensors communicate primarily over 2 pins. A signal is sent to the sensor on the _trigger_ pin, and the delay on a response on the _echo_ pin can be used to calculate the distance.

{{% notice warning %}}
Ultrasound should only be considered accurate up to around 2 metres, beyond that the signal can become distorted and produce erroneous results.
{{% /notice %}}

## Wiring up the sensor
The sensor has 4 pin connections: ground, 5V, _trigger_ and _echo_. Most ultrasound sensors will label which pin is which. The ground and 5V should be wired to the ground and 5V pins of the arduino respectively. The trigger and echo pins should be attached to 2 different digital IO pins. Take note of these 2 pins, you'll need them to [use the sensor](/api/servo-assembly/ultrasound).

{{% notice tip %}}
If the sensor always returns a distance of 0, it means the _trigger_ and _echo_ pins are connected the wrong way! Either change the pins in the code, or swap the connectors.
{{% /notice %}}
Binary file added static/img/kit/servo-assembly.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.