In this project guide, we show you how to make the popular DHT22 sensor. This DHT22 easily connects to a variety of microcontrollers to send digital temperature and humidity readouts. You can monitor temperatures on your phone, create an alarm to signal when humidity reaches a certain level, or simply read statuses on your computer.
- Bantam Tools Desktop PCB Milling Machine
- Computer with Bantam Tools Desktop Milling Machine Software installed
- Adafruit DHT-sensor-library installed
- Flat end mill, 1/32" (optional)
- Flat end mill, 1/64”
- Bit fan
- Alignment bracket
- Soldering iron
- Diagonal wire clippers
- USB cable
- PCB blank, FR-1, single-sided
- Tape, high-strength, double-sided
- DHT22 sensor, AM2302
- 4.7K resistor, 0805 SMD
- 1K resistor, 0805 SMD
- 0.1 uF ceramic capacitor, 0805 SMD
- LED, 5mm
- Male headers, 1x3 at 90º angle
Humidity-Temperature-Sensor.brd file downloaded
Step 1: Set up your job.
Hook up the Desktop PCB Milling Machine to your computer, open the Bantam Tools Desktop Milling Machine Software, and home the mill. Next, install the alignment bracket onto the spoilboard. In the Bantam Tools software, under Fixturing, select Locate and follow the instructions.
Note: Using the alignment bracket will ensure that your board is perfectly squared in the front left corner. If you haven’t installed the alignment bracket before, follow the steps in our support guide.
Now it’s time to set up your job. If you need more guidance on how to load your tool or enter information into the software, refer to the Light-Up PCB Badge project.
- Double-check to make sure it says Bracket under Fixturing.
- Select the 1/64" Flat End Mill, load it into the mill with the bit fan attached, and locate the tool.
- In the Material dropdown menu, select Single-Sided FR-1.
- Measure and enter dimensions in the X, Y, and Z values under Material for the FR-1. Then apply high-strength, double-sided tape on the backside of the PCB, and place it onto the spoilboard so it aligns with the corner of the alignment bracket.
- Be sure to account for the tape’s thickness (Z height) under Material Placement. The thickness of the high-strength, double-sided Nitto tape we sell in our store is typically 0.006 in.
Step 2: Import your file.
In the Bantam Tools software, under Plans, click Open Files and select the Humidity-Temperature-Sensor.brd file. You have the option to use both the 1/32” and 1/64” flat end mills or just the 1/64” flat end mill for this job. Using both end mills will cut your mill time to about three minutes, and if you only use the 1/64” end mill, it’ll take roughly eight minutes. For this project, we used the following recipes.
For the 1/64” flat end mill:
- Feed Rate: 50 in/min
- Plunge Rate: 15.00 in
- Spindle Speed: 25,000 RPM
- Stepover: 50%
- Pass Depth: 0.007 in
For the 1/32" flat end mill:
- Feed Rate: 59 in/min
- Plunge Rate: 15 in
- Spindle Speed: 25,000 RPM
- Stepover: 49%
- Pass Depth: 0.010 in
Your mill time will also vary depending on your speeds and feeds recipes. If you’d like to adjust your speeds and feeds to match ours, click File > Tool Library > Add Tool. Name your new tools and then input the speeds and feeds recipes. You can learn more about customizing your Tool Library in our guide.
Step 3: Start milling.
Ready? Click Start Milling.
If you’re using both the 1/64” and 1/32” flat end mills, the software will prompt you to change your tool. Swap out your tool, install the new one with the bit fan, locate the tool, and select Mill All Visible to finish your job.
Step 4: Solder the components.
Lay out your components and turn on your soldering iron. It’s easiest to solder the components in the following order:
- 4.7K resistor
- 1K resistor
- 0.1uF ceramic capacitor
- Male headers
- DHT22 sensor (bend the legs before soldering)
On the sensor module, the DHT22 is intended to rest perpendicular to the board. There’s a 4.7K pull-up resistor on the data line, a 0.1uF filtering capacitor on the VCC line, and a power-indicating LED via a 1K resistor. The 90º male headers will allow for easy breadboarding.
This is what your board will look like after you’ve assembled and soldered it.
Step 5: Program and test your sensor.
Now that you’ve assembled the circuit board, it’s time to program and test your sensor. Install the Adafruit DHT-sensor-library, if you haven’t already done so. Then select Examples > DHT Sensor Library > DHTtester. Connect the 5V to pin 1 on the module, D2 to pin 2, and GND to pin 3. The DHT22 is the default typeset in the example sketch, so you’ll need to change this in the code if you’re using a different DHTxx sensor. When you’re finished, upload the code and open the Serial Monitor.
Nice job! You’ve successfully milled and programmed your own DHT22 sensor. Want to take things to the next level? Here are three of the many projects where you can utilize your new sensor: Smart Plant Care System, Soil Moisture Sensor, and Apple HomeKit Temperature Sensor.