Extension board · Sensors and inputs

ACS712 current sensor

Measures the current in a low-voltage DC wire, such as a spindle or heater supply, and reports it as a voltage the controller can read. The measured circuit stays isolated from the signal side inside the sensor.

Top view of the current sensor board: a two-way screw terminal beside a wide copper path to the sensor, and a socket on each short edge of the signal side.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
±20 Asensor range
15 Acontinuous design target
30 V DCmaximum measured circuit
64.3 mV/Aat the controller pin
1.61 Voutput at zero current
60 × 40millimetres, four M3 holes
High current hazard. A loose terminal or thin wire can overheat and start a fire. Never connect mains or any circuit above 30 V DC. Fuse the measured circuit at 15 A or less. Do not rely on this reading as the only overcurrent protection.

Tech specs

PurposeWatching the current of a 12 or 24 V load, or detecting a stalled or open load
SensorAllegro ACS712ELCTR-20A-T, 1.2 mΩ path, 100 mV/A nominal (96 to 104)
OutputsContact 3: current signal; contact 4: monitor of the 5 V supply, both scaled by 18/28
BandwidthAbout 2.5 kHz
Supply4.5 to 5.5 V from the socket, about 10 mA
ConnectorsTwo-way 5 mm screw terminal in series with one conductor; two Gadgeteer type A sockets
Size60 × 40 mm, four M3 holes on a 50 × 30 mm pattern; 2 oz copper recommended
Works withSmoothieboard V2 Prime header GH electrically; no firmware module scales the reading
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
    Current terminal (J3) — One wire of the measured circuit goes in at IN and leaves at OUT.
  2. 2
    Current sensor (U1) — Current flows through one side; the signal leaves isolated on the other.
  3. 3
    Input socket A IN (J1) — Current on contact 3, supply monitor on 4.
  4. 4
    Chain socket CHAIN (J2) — Contacts 5 to 9 pass through.
  5. 5
    Signal divider (R1, R2) — 10 kΩ and 18 kΩ, 0.1 %.
  6. 6
    Monitor divider (R3, R4) — Reports the 5 V rail with the same ratio.
  7. 7
    Filter capacitor (C3) — Sets the sensor bandwidth.
  8. 8
    Supply capacitors (C1, C2) — On the sensor 5 V.
  9. 9
    Chain links (JP3, JP4) — Open as delivered.
  10. 10
    Mounting hole — One of four M3 holes. Keep hardware clear of the current copper.
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

The terminal side and the socket side must never be connected to each other.

J3: measured conductor

TerminalUse
INFrom the supply side. Current entering here reads positive
OUTTo the load side

J1: input socket (A IN)

ContactSignalUsePrime header GH
13.3 VPassed to the chain3.3 V
25 VSensor supply5 V
3I_OUTCurrent signalPC3 (ADC1_5)
4V_MON5 V monitorPA3 (ADC1_6)
5 to 9Passed throughNot usedPC2, PF2, PI10, PH7, PB12
10GNDSignal groundGND

What you need

A DC circuit of 30 V or lessFused at 15 A or less.
Heavy wire and ferrulesRated for the current; up to the terminal’s limit.
Two analog inputsPrime header GH contacts 3 and 4.
A multimeterTo record the zero reading and check the scale.

Get started

Minimum wiring: supply +, after fuse to IN, current in; to load + to OUT, current out. Measured circuit Terminal J3 supply +, after fuseINcurrent in to load +OUTcurrent out
Only one conductor passes through the board. Never connect both supply poles to J3.
  1. Remove all power

    Switch off and discharge the measured circuit and the controller.

  2. Insert the board

    Break one conductor; supply side to IN, load side to OUT. Tighten firmly and relieve strain.

  3. Connect the signal side

    Plug J1 into header GH.

  4. Read zero

    Power the controller with the load off and measure test points I_OUT and V_MON.

    By design about 1.61 V and 3.21 V.

  5. Check with load

    Apply a known current and compare. Watch the temperature of terminals and copper on the first long run.

    I_OUT should rise by about 0.064 V per ampere.

Configuration

You wantModuleExample
Show amperesNoneNo SmoothieV2 module scales this sensor

There is nothing to add to config.ini. Your own software computes the current as (V3 - zero) / (0.0643 * V4 / 3.214), where V3 and V4 are the voltages on contacts 3 and 4 and zero is the contact 3 reading at no current, scaled the same way.

How it works

Current through the sensor makes a magnetic field that is turned into a scaled voltage. J3 INmeasured current U1 path1.2 milliohm J3 OUTto load U1 Hallisolated 10 k / 18 kscale J1.3to ADC
Power path above, signal path below.

The sensor senses the magnetic field of the current in its internal conductor, so no electrical connection exists between the two sides. Its output sits at half the 5 V supply and moves by 100 mV per ampere. The divider keeps it under 3.3 V even if it reaches the supply rail. Because both zero and scale follow the 5 V supply, the second divider lets software correct for it.

Solder links

Leave both links open unless another board is meant to read the same signals.

Solder links as delivered: JP3 open; JP4 open. JP3 · openchain contact 3 JP4 · openchain contact 4
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 the current signal to the chainOpen
JP4Joins the monitor to the chainOpen

Chaining

Contacts 5 to 9 are free for a further board.

The controller's ribbon cable goes to the connector A IN of the current 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 current sensor board A IN CHAIN pin 3, current stops here pin 4, monitor stops here 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. The two signals stop here; pin 5 is wired straight through.
ContactSignalOn CHAIN
1, 2, 10Power and groundPassed on
3, 4SignalsStopped by open links
5 to 9FreePassed on

Troubleshooting

SymptomLikely causeWhat to check
Reading stuck near zero voltsNo 5 VTest point +5V
Zero is not exactly 1.61 V5 V tolerance and sensor offsetRecord the zero and use the monitor
Current reads negativeIN and OUT exchangedSwap with the power off, or invert in software
Noisy readingSwitching loadsAverage many samples
Terminal or copper hotLoose connection or too much currentSwitch off at once

The board has no indicator lights; use 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. Keep metal spacers and wiring away from the current terminal and copper; keep strong magnets and heavy wires away from the sensor.

Mounting drawing of the current sensor board, component side: outline 60 by 40 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 60 40 0, 0 X Y 1 5.00, 5.00 2 55.00, 5.00 3 5.00, 35.00 4 55.00, 35.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 60 × 40 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
255.005.003.2 mm, not platedMounting, M3 screw
35.0035.003.2 mm, not platedMounting, M3 screw
455.0035.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
Measured circuit voltageJ3——30 V DCDesign limit
Continuous currentJ3——15 ADesign target
Supply5 V4.5 V5 V5.5 VAllegro data sheet
Zero-current outputContact 31.59 V1.607 V1.62 VSimulated at 5.00 V
Output with VIOUT at 4.5 VContact 32.85 V2.89 V2.93 VSimulated
Highest possible outputContact 3—3.21 V3.3 VSimulated
Filter step response, 90 %Contact 3—0.15 ms0.3 msSimulated
Heat in the sensor path at 15 AU1—0.27 W—Calculated

Component stress limits

PartLimitUse on this board
Measured voltage30 V DC12 or 24 V circuits
Current15 A targetFuse upstream
IsolationNot certifiedLow voltage only

Appendix: simulation

The output dividers and filter were simulated with ngspice.

Each simulated value (yellow mark) against its allowed range (green band). Output at zero current1.61 V Output with VIOUT at 4.5 V (+20 A)2.89 V Divider gain643 mV/V 90 % step response of the output filter148 µs Highest output with VIOUT at the 5 V rail3.21 V
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Output at zero current1.61 V1.59 V to 1.62 VWithin
Output with VIOUT at 4.5 V (+20 A)2.89 V2.85 V to 2.93 VWithin
Divider gain643 mV/V640 mV/V to 646 mV/VWithin
90 % step response of the output filter148 µsat most 300 µsWithin
Highest output with VIOUT at the 5 V rail3.21 Vat most 3.3 VWithin

Not simulated: the temperature rise of the current path, which sets the real current limit, and the sensor itself.

Appendix: datasheet

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

First page of the ACS712 Hall-effect current sensor datasheet
ACS712 Hall-effect current sensor — Allegro MicroSystems, 16 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.