Extension board · Sensors and inputs

Hall effect sensor

A magnetic field sensor whose output voltage rises and falls with the field of a nearby magnet, for sensing distance or a passing magnet. It sits at half supply with no magnet. No firmware module reads a general analogue input yet, so using the value takes your own driver.

Top view of the Hall sensor board: a ten-contact socket on the left and right edges and a small sensor near the bottom edge.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
Analogue fieldTI DRV5055A3 linear Hall sensor
1.65 Voutput with no magnet, typical
15 mV/mTtypical sensitivity at 3.3 V
±88 mTlinear range at 3.3 V
3 contactsselectable: 3, 4 or 5
50 × 55millimetres, four M3 holes

Tech specs

PurposeMeasuring the distance to a magnet or detecting a passing magnet. For an on/off endstop use an endstop board instead; not for safety interlocks
SensorTexas Instruments DRV5055A3QDBZR, senses the field perpendicular to the board
OutputAbout 1.65 V with no field, rising for a south pole at the top face, through 1 kΩ and 100 nF
Supply3.3 V from the socket, 2 mA typical, 4 mA maximum
SocketsTwo 10-contact Gadgeteer type A sockets (Samtec SHF-105, 1.27 mm): input and chain
Test pointsOn the underside: 3.3 V, ground and output
Size50 × 55 mm, four M3 holes on a 40 × 40 mm pattern
Works withSmoothieboard V2 Prime header GH electrically; no firmware module reads the value
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket A IN (J1) — The type A socket to the controller. As delivered the sensor is on contact 3.
  2. 2
    Chain socket CHAIN (J2) — Passes the other contacts to the next board.
  3. 3
    Hall sensor (U1) — Bring the magnet to its top face, at the SENSOR marking.
  4. 4
    Supply capacitor (C1) — 100 nF next to the sensor.
  5. 5
    Output filter (R1, C2) — 1 kΩ and 100 nF, a corner near 1.6 kHz.
  6. 6
    Contact selectors (JP23 to JP25) — Close exactly one: contact 3, 4 or 5. JP23 is closed as delivered.
  7. 7
    Chain links (JP3 to JP5) — JP3 is open, JP4 and JP5 closed as delivered.
  8. 8
    Mounting hole — One of four M3 holes, not connected to ground. Use non-magnetic screws near the sensor.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

Check contact numbering with the power removed before wiring by hand.

J1: input socket (A IN)

ContactSignalUsePrime header GH
13.3 VSensor supply3.3 V
25 VPassed to the chain only5 V
3OUTField voltage as delivered (JP23)PC3 (ADC1_5)
4SelectableField voltage with JP24PA3 (ADC1_6)
5SelectableField voltage with JP25PC2 (ADC1_4)
6 to 9Passed throughNot usedPF2, PI10, PH7, PB12
10GNDGroundGND

What you need

A controller socketPrime header GH has analogue inputs on contacts 3, 4 and 5.
A ten-way cable1.27 mm Gadgeteer ribbon cable.
A magnetType and distance decide the signal size; try yours before fixing the mounting.
Your own driverCode that reads one analogue input; none is supplied.

Get started

Minimum wiring: contact 1 to contact 1, 3.3 V; PC3, contact 3 to contact 3, field voltage; contact 10 to contact 10, ground. Prime header GH (J39) Hall sensor J1 contact 1contact 13.3 V PC3, contact 3contact 3field voltage contact 10contact 10ground
Three connections as delivered.
  1. Mount the board

    Keep steel parts and motors away from the sensor, and fix the magnet so its path is repeatable.

  2. Connect with the power off

    Plug J1 into header GH.

  3. Check the rest voltage

    Power up with no magnet nearby and measure between the ground and output test points.

    The data sheet gives 1.59 to 1.71 V at 3.3 V and 25 °C.

  4. Bring the magnet close

    Approach the top of the board above the marking SENSOR and watch the voltage.

    By the data sheet a south pole raises the output and a north pole lowers it.

Configuration

You wantModuleExample
Read the field strengthNoneNo SmoothieV2 module reads a general analogue input
Use it as an endstopNoneUse an endstop board with an on/off output

There is nothing to add to config.ini. The analogue contacts of header GH are ADC1_5, ADC1_6 and ADC1_4 in SmoothieV2.

How it works

The sensor converts the magnetic field to a voltage, which a resistor and capacitor filter before the selector link. Magnetfield through board U1 DRV5055field to voltage 1 k + 100 nFfilter JP23 to JP25contact 3, 4 or 5
One signal path.

The output sits at half the supply with no field and moves about 15 mV for each millitesla. Both the rest voltage and the sensitivity scale with the supply, and so does the controller’s converter. Field strength falls steeply and non-linearly with distance, so calibrate with your own magnet if you want millimetres. Sensitivity also rises with temperature, about 0.12 % per degree typically.

Solder links

To move the sensor to contact 4: open JP23, close JP24, close JP3 so contact 3 passes on, and open JP4. For contact 5: open JP23, close JP25, close JP3 and open JP5.

Solder links as delivered: JP3 open; JP4 closed; JP5 closed; JP23 closed; JP24 open; JP25 open. JP3 · openchain contact 3 JP4 · closedchain contact 4 JP5 · closedchain contact 5 JP23 · closedoutput to contact 3 JP24 · openoutput to contact 4 JP25 · openoutput to contact 5
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP3Joins contact 3 to the chain socketOpen
JP4Joins contact 4 to the chain socketClosed
JP5Joins contact 5 to the chain socketClosed
JP23Puts the sensor on contact 3Closed
JP24Puts the sensor on contact 4Open
JP25Puts the sensor on contact 5Open

Chaining

Further analogue boards can share the socket, each on a different contact.

The controller's ribbon cable goes to the connector A IN of the Hall sensor board. Inside the board each of the ten pins runs through a solder link to the connector CHAIN, where a second ribbon cable continues to the next board. A closed link passes its pin on, an open link stops it. Controller one ten-pin port Hall sensor board A IN CHAIN pin 3, sensor stops here pin 4, free passed on pin 5, free passed on one solder link per pin Next board sees what is passed on
Chaining: one port of the controller serves two boards. Pin 1 of A IN leads to pin 1 of CHAIN, pin 2 to pin 2, and so on, each through its own solder link. The three lines stand for the ten pins and show the links as delivered. Two boards must never drive the same pin, and a pin that one board uses for a signal is not free for the next. As delivered, pin 3 stops here and pins 4 and 5 pass on.
ContactSignalOn CHAIN
1, 2, 10Power and groundPassed on
3SensorStopped by open JP3
4, 5Free analogue inputsPassed on
6 to 9FreePassed on

Troubleshooting

SymptomLikely causeWhat to check
Output stays at 0 VNo selector closed, or no 3.3 VExactly one of JP23 to JP25 closed; test point 3.3 V
No change with a magnetField parallel to the board, or magnet too weak or farTurn a pole towards the top of the sensor and move closer
Output moves the wrong wayOpposite pole facing the sensorTurn the magnet over
Output stuck near a railField beyond the linear rangeMove the magnet away or use a weaker one
Reading shifts without the magnet movingNearby steel, motor fields or temperatureRelocate the board and calibrate in place

The board has no indicator lights; measure at the test points.

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page
3D view, top (PNG)Rendered from the design files
3D view, angled (PNG)Rendered from the design files

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side.

Mounting drawing of the Hall sensor board, component side: outline 50 by 55 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 50 55 0, 0 X Y 1 5.00, 5.00 2 45.00, 5.00 3 5.00, 45.00 4 45.00, 45.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 50 × 55 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
245.005.003.2 mm, not platedMounting, M3 screw
35.0045.003.2 mm, not platedMounting, M3 screw
445.0045.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
Supply voltageJ1 contact 13.0 V3.3 V3.63 VTI data sheet, 3.3 V operating range
Supply current3.3 V—2 mA4 mATI data sheet
Output with no fieldU1, 25 °C1.59 V1.65 V1.71 VTI data sheet
SensitivityU1—15 mV/mT—TI data sheet, A3 at 3.3 V
Linear rangeU1—±88 mT—TI data sheet
Linear output swingU10.2 V—3.1 VTI data sheet
Filter cornerSelected contact—1.6 kHz—Calculated and simulated
Settling after a field stepSelected contact—0.46 ms—Simulated

Component stress limits

PartLimitUse on this board
Sensor supply7 V absolute maximum3.3 V
Sensor output current±1 mALimited by controller input; keep the load high
Capacitors16 V3.3 V

Appendix: simulation

The output filter was simulated with ngspice with a 0.9 V step, as a sudden field change would produce.

Each simulated value (yellow mark) against its allowed range (green band). Settling after a field step463 µs Filter corner frequency1.59e+03 Hz
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Settling after a field step463 µsat most 1 msWithin
Filter corner frequency1.59e+03 Hz1e+03 Hz to 2e+03 HzWithin

Not simulated: the magnetic response, offset and temperature drift, because no sensor model is available.

Appendix: datasheet

The first page of the manufacturer data sheet. Click the page to open the PDF.

First page of the DRV5055 ratiometric linear Hall effect sensor datasheet
DRV5055 ratiometric linear Hall effect sensor — Texas Instruments, 35 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.