Add obstacle detection to your buggy and robotics projects with this easy to use ultrasonic range sensor.
This is the HC-SR04 ultrasonic ranging sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm.
Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.
There are only four pins that you need to worry about on the HC-SR04: VCC, Trig, Echo and GND. VCC and GND are for power and Trig, Echo and GND are for your signal. GND is in with the signal set since it's needed for a baseline.
You will find this sensor very easy to set up and use for your next range-finding project! The easiest pins to use on the microbit are 0, 1, and 2. So I used 0 for Trig and 1 for Echo.
This sensor works within the 3.3V - 5V range, if it is the only external device connected to the microbit then it can draw power from the microbit. If combined with other sensor it will need its own power supply.
- Operating Voltage: 3.3V - 5V DC.
- Operating Current: 15mA.
- Measure Angle: 15 degrees.
- Ranging Distance: 2cm - 4m.
- 1 x HC-SR04 ultrasonic ranging sensor.
- Length: 45mm.
- Width: 20mm.
- Max Height: 16mm.
- PCB Thickness: 1mm
- Pin Pitch: 2.54mm
- A 3.3V - 5V power supply.
- A programmable microcontroller, such as; microbit, Arduino or Raspberry Pi.
SparkFun Stock Code:
Same Day Dispatch
- Orders placed online before 3:00pm Monday - Friday (excluding public holidays and our Christmas shutdown period) are always dispatched the same day provided the goods are in stock. If the goods are not in stock we will endeavour to contact you as soon as possible to discuss a dispatch date.
- If you live on the UK mainland and don't have any large materials or lithium batteries in your order it will cost £3.95 (£4.74 including VAT) if you spend less than £40 (£48 including VAT).
- If you spend between £40 and £200 (£48 - £240.00 including VAT, excluding large materials or lithium batteries) delivery is free to most locations, £12 (£14.40 including VAT, excluding large materials or lithium batteries) to Northern Ireland and £15 (£18.00 including VAT, excluding large materials or lithium batteries) to UK remote locations. For a list of postcodes that will be charged the remote location rate click here.
- If you spend over £200 (£240.00 including VAT, excluding large materials or lithium batteries) delivery is free within the UK.
Rest of the world
- These orders are sent via UPS, and the cost is dependant on the service you choose at checkout. Alternatively you can choose the free collection option and have your own courier collect it from us. International orders can only be shipped to the registered card address. Please note: International orders may be charged import duty dependant on local import laws and duty rates. These charges are usually billed to you directly from UPS.
- Delivery times vary for international orders depending on the service selected and the destination. You can see the delivery time and cost at the shipping stage, or by using the shipping estimator from within the shipping basket.
- If you would like to collect your order, or use your own courier then there is an option you can select during checkout. We do not charge a packaging or handling fee for this service, and you will receive an email when your order has been processed, you can collect half an hour after receipt of this email.
- For information about all of the delivery options we offer click here.
Ask a question about this product
Payment & Security
Your payment information is processed securely. We do not store credit card details nor have access to your credit card information.