Help Center
  • FAQ
    browse most common questions
  • Live Chat
    talk with our online service
  • Email
    contact your dedicated sales:
  • Call Us
    9:00 - 18:00, Mon.- Fri. (GMT+8)
0

How to DIY A Raspberry Pi Expansion Board?

Published on 2/24/2017 4:20:59 PM

Description

<style>.e_editor{font:14px/24px Arial,'microsoft yahei','Times New Roman','b8bf53';}.e_editor div,e_editor p,e_editor td,e_editor th,e_editor li{font-weight:inherit;font-size:inherit;font-style:inherit;font-family:inherit;}.e_editor ul{margin:-10px 0 20px;}.e_editor li{padding:5px 0;}.e_table{width:96%;border-collapse:collapse;empty-cells:show;}.e_table th,.e_table td{padding:5px;border:2px solid #eee;}.e_img{padding:10px 0;text-align:center;}.e_p{line-height:20px;padding:0 0 20px;text-indent:0em;}</style><p> The expansion board of Arduino is called Shield, while raspberry pi expansion board is named as HAT (Hardware Attached on Top), referring to the hardware board attached to the top of raspberry pi. Now let’s design an open source raspberry pi expansion board, temporarily named Raspberry Pi ICA HAT. </p><p><br/></p><p style="text-align:center;"><img src="https://jpfile1.oss-cn-shenzhen.aliyuncs.com/allpcb/web/image/20190605/6369534260348735001697491.jpg" alt="160828981.jpg" title="undefined"/> </p><p><strong>1. Demand analysis</strong> </p><p> HAT is designed to provide raspberry pi with basic display and user input function, and leads to hardware interfaces such as UART, I2C, SPI, etc. It easily accesses to other modules and serves as the starter board for users who learn the raspberry hardware. The ICA HAT is configured as follows: </p><p> 1. Key x5 can be used as the button of up, down, left, right and “OK&quot;; </p><p> 2. User LED x4 is to achieve the basic instructions, and another LED is for power indicator; </p><p> 3. Active buzzer x1, providing alarm function; </p><p> 4. Infrared emission tube x2, infrared receiver head x1, to achieve infrared remote control function; </p><p> 5. Seven-segment digital tube x2, to achieve 8-bit digital display, through the MAX7219 chip driver of SPI interface; </p><p> 6. Several I/O and power extension pin. </p><p> After setting the demand, you should consider the structure firstly. This case is designed for the raspberry pie 2B model, but also compatible with the generation of B+ models. The following picture shows the mechanical structure of raspberry pie 2B/B +: </p><p><br/></p><p style="text-align:center;"><img src="https://jpfile1.oss-cn-shenzhen.aliyuncs.com/allpcb/web/image/20190605/6369534264641721956551511.png" alt="160911806.png" title="undefined"/> </p><p> For the mechanical structure of raspberry pi, you can design two HATS of full and half length. The frame size of full-length board is the same as the raspberry pi. Considering the raspberry pi USB and RJ45 connectors are high, you should check whether the devices at the bottom will touch the connectors. </p><p> The half-length board contains only four screw holes. </p><p> Both boards are connected to the pins on the main board by 2.54mm spacing and are secured to the motherboard via four M2.5 copper studs or screws. As shown below: </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/160951008.png" alt="" height="340" width="530"/> </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161015836.png" alt="" height="256" width="482"/> </p><p style="text-align:left;"> Storing two HATs in the GitHub, then the reader can begin design. </p><p> After analyzing the mechanical structure, you should consider the I/O resource allocation. In 2B/B+ of raspberry pi, I/O includes two SPI interfaces, two I2C interfaces and one UART interface, except for the hardware of PWM and ADC. Additionally, I2C0 is used to read HAT board information as IDPROM interface, but the users can not use. SPI1 is also known as SPI_AUX in the CPU, the current Linux driver can be invoked by the pigpo library though it is not perfect currently. As shown below: </p><p><br/></p><p style="text-align:center;"><img src="https://jpfile1.oss-cn-shenzhen.aliyuncs.com/allpcb/web/image/20190605/6369534278068499304694043.png" alt="161149162.png" title="undefined"/> </p><p> In this example, SPI0, I2C1 and UART0 are led out to the pins; SPI1 is used for controlling by MAX7219 and GPIO are allocated arbitrarily according to the wiring. </p><p><strong>2. Hardware design and production</strong> </p><p> After demand analysis, then we come to the hardware design. Taking Cadence 16.6 tools for example, schematic tool is OrCAD Capture CIS, and Allegro PCB Editor is for PCB tool. </p><p style="text-align:center;"><img src="https://jpfile1.oss-cn-shenzhen.aliyuncs.com/allpcb/web/image/20190605/6369534283942342105849675.png" alt="161247264.png" title="undefined"/> </p><p style="text-align:left;"> For the IDPROM, you should connect an EEPROM and raspberry piI2C0 firstly. This part of the circuit is not installed in the actual production for reserving function (the actual non-welding device is defined as NC).The user LED is controlled by the GPIO current and the LED lights when IO is low. </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161314597.png" alt=""/> </p><p style="text-align:left;"> The key function is achieved by the GPIO detecting the electrical level on left side. The level is high when the key is released and low after pressing. </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161421830.png" alt=""/> </p><p style="text-align:left;"> Infrared tube needs a large current, so a GPIO is required to drive the infrared LED by controlling NPN transistor, and the infrared tube will be conducted on high electrical level. Of course, you can only weld and use one LED, and two LED can enhance the infrared signal. </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161525418.png" alt=""/> </p><p style="text-align:left;"> Integrated receiver HS0038 is used for receiving infrared, which can work at 3.3V voltage and receive infrared signals via a GPIO. </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161550500.png" alt=""/> </p><p style="text-align:left;"> Active buzzer also requires a large current, just like infrared tube, it is driven by transistor and the buzzer sound when GPIO reaches high electrical level.</p><p style="text-align: center;">&nbsp;<img src="https://file.allpcb.com/bbs/17/02/24/161616070.png" alt="" style="text-align: center;"/></p><p style="text-align:left;"> Digital display is using two 4-bit 7-segment digital tubes (common cathode, count the decimal point is actually 8), and is driven through the MAX7219 chip. MAX7219 offers display up to 8-segment and 8-bit, where the MAX7219 segment A-DP is connected with two digital tube in order simultaneously, for displaying the contents of each bit. And selection signals of MAX7219 digital are connected to the each common port of two digital tubes. </p><p> The MAX7219 is connected to the raspberry by SPI, and DOUT is not necessary to connect as it only needs control instead of reading information. Chip is power supply by 5V, strictly speaking, the SPI should use the 5V. 3.3V electrical level can also be normally controlled through raspberry pi, but it is recommended to set the electriclevel conversion circuit. </p><p style="text-align:center;"><img src="https://jpfile1.oss-cn-shenzhen.aliyuncs.com/allpcb/web/image/20190604/6369526381863275997164440.png" alt="161706101.png"/></p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161734619.png" alt="" width="474" height="66" style="width: 474px; height: 66px;"/> </p><p><br/></p><p style="text-align:left;"> As for the interface expansion pin, the series of 100ohm resistance plays the role of current limiting protection. Each interface respectively provides 3.3V power and GND. </p><p style="text-align:left;"><br/></p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161755792.png" alt="" width="258" height="175" style="width: 258px; height: 175px;"/> </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161806167.png" alt="" width="229" height="214" style="width: 229px; height: 214px;"/> </p><p><br/></p><p> ICA HAT PCB is using low-cost double-sided boards (only 50RMB for 10 <a href="https://www.allpcb.com/two_layer_pcb_production.html" target="_blank">PCB productions</a>) and the layout should be explained. </p><p> According to the general users habits, the digital tube placed in the upper part of the board side by side (the most eye-catching position), the keys on the lower right corner of the board (left-hand friends can place on the left). Infrared transceiver and IO interface are neatly arranged around the board edge to prevent blocking for easy wiring. Besides, LEDs and buzzers can be placed in the middle of the board. </p><p><br/></p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161835342.jpg" alt="" width="467" height="294" style="width: 467px; height: 294px;"/> </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161845751.jpg" alt="" width="467" height="277" style="width: 467px; height: 277px;"/> </p><p><br/></p><p> Designed PCB files can be exported to Artwork and Drill files submitting to PCB manufacturers. Domestic manufacturers typically receive Altium Designer and Protel format engineering documents which actually are converted to Artwork for manufacturing. Manufacturers will also provide free testing to ensure that the circuit does not appear short circuit, etc. Here is the picture showing good PCB: </p><p><br/></p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161915238.jpg" alt="" width="629" height="361" style="width: 629px; height: 361px;"/> </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161936001.jpg" alt="" width="636" height="322" style="width: 636px; height: 322px;"/> </p><p><br/></p><p> The component soldering is after <a href="https://www.allpcb.com/pcb_production" target="_blank">PCB production</a>, and it is necessary to provide a solder mask file for the stencil production and assembly file if soldered by machines. </p><p> Since the component is simple and small, we can manually weld from the difficult and pin-intensive (SMD) IC, then the components of the lower height, and finally higher through-hole parts. The connector and the digital tube can be welded in the end. The following figure shows the manual completion of circuit board, namely, PCBA: </p><p><br/></p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/161954858.jpg" alt="" width="616" height="343" style="width: 616px; height: 343px;"/> </p><p style="text-align:center;"><img src="https://file.allpcb.com/bbs/17/02/24/162014975.jpg" alt="" width="607" height="358" style="width: 607px; height: 358px;"/> </p><p> It should test the circuit whether short circuit exists after the welding, especially in the power supply. Only after that can you use electrical test, otherwise it may not only burn the HAT board, but damage the main board of raspberry pi. </p>

32

comment

All comments

Unknown

7381

0

32

Go to Order My Own PCB

Rules about cashback: 1. Valid time: ALLPCB cashback activity will end on April 1st. 2. Capped amount: The capped amount of cashback for each account is $5,000. Each order can get a maximum of $2,000 cashback. That means every author can get $5,000 max. 3. Cashback range: The cashback activity only covers the corresponding PCB order. The order amount for other combined payment products will be invalid. 4. Clicking your own promotional link will be invalid. The same email address, shipping address, contact information, and phone number are all recognized as the same account. 5. ALLPCB has the final interpretation right of the cashback activity.

ALLPCB will donate 2% to the author for this promotion link.

Other Projects

Home / Industrial Automation low Cost with Arduino an ESP01

2460

0

314

Alternate Text josemarjr