RPI Homemade Hat

by BorisS8 in Circuits > Raspberry Pi

1589 Views, 15 Favorites, 0 Comments

RPI Homemade Hat

Hi,
My name is Boris and this is my very first Instructables.

I have a Raspberry Pi 3B+ and I use it for simple home automation like control the TV, AC and some lights.
Recently I bought a cheap chinese CNC router and started to making simple PCBs(I want to point that I am absolute beginner in electronics so there might be some mistakes).

One of the first idea I had was to build board for the RPI that has temperature sensor and IR led.
So this instructable is about what tools I use to accomplish this idea.

BOM

The components I used for the board are simple, however they are mostly SMD:

  1. Raspberry PI 3B+
  2. Si7020-A10 *Temperature and humidity sensor
  3. MF25100V2 *25x25mm fan
  4. 1x4.7k 1206 resistor
  5. 1x63 1206 resistor
  6. 1x100nP 1206 capacitor
  7. 1x1N4148W diode
  8. 1xBC846B transistor
  9. 1x IR Led *I just grab one from old tv controller
  10. PCB Single side copper *the cutout board is with size: 36x46.30mm
  11. 2.54mm 2x20 pin header

For the PCB fabrication I used a 3018 CNC, engraving bit(0.1mm tip with 30˚ angle), 1mm bit for board cutout, 0.7mm bit for PCB drills.
The software I used is:

  1. EasyEda for PCB design
  2. FlatCam for generating gcodes from gerber files
  3. bCNC for controlling the CNC

PCB Schematic

The schematic is very simple, the Si7020 use i2c protocol so it must be connected to pin 3 and 5 on RPI, the fan must be connected to pin 2 or 4 and all other component can be assign at different pins.
Currently i use these pins because for me it was the simplest way to design the traces for the pcb.

It is important to say that when I add component(or make trace) in the pcb design I always make this component pads at least 0.6mm. For example if the pad is with size 0.6x0.4mm I make it 0.6x0.6 and this is because my CNC is unable to make it smaller without cutting too much.

PCB Milling

For pcb milling I use 30˚ angle bit with 0.1mm tip.
FlatCamp setup

  • For traces cutout
    • Tool Diameter: 0.13 Type V.
    • The "Cut Z" should be -0.06mm.
    • Enable Multi-Depth with value: 0.03
    • Travel Z: 1.2
    • Spindle speed: 8000(this is max for my DC motor)
  • For holes drill and board cutout
    • Cut Z: -1.501 *I use 1.5mm F4 PCB so this value should be changed according to your pcb thickness.
    • Travel Z: 1.2
    • Spindle speed: 8000(this is max for my DC motor)

I left all other settings unchanged:

  • Feed Rate X-Y: 80
  • Feed Rate Z: 80

bCNC setup

Before start milling I run autolevel and I aways set X-Y steps for probing to be maximum 3mm.

Soldering

For soldering I use Dremel Versatip which can be used as hot air gun or soldering iron.

First I start with the iron tip. I apply flux to every pad I will use(the brown and black sports on the pcb in image gallery are flux). After that I apply very little amount of tin. Then I switch to hot air gun, position the components on there places and start heating them.

Run and Useful Links

For IR led I use Lirc and for the sensor I wrote a little python script.

Test the sensor:
As you can see the temperature measured by the sensor is 31˚. The actual temp is the room was 24˚.
The diif comes from the RPI temp, which is 45˚ with fan running. So when I return the measured temperature from the sensor I subtract "7" and the returned value is pretty accurate.

FlatCamp + bCNC tutorial

Python i2c for Si7020

Instructables for Lirc

RPI fan tutorial

I apologise for all mistakes I made(my english is not very good).

If you have any questions I will happy to answer you.