Dreamstime.com
Dreamstime L 178196981

Essential Pi: Tips for Getting the Most Out of Your Raspberry Pi

2021年3月11日
纽瓦克(Newark)的PI专家提供了有关最大化Raspberry Pi体验的提示和建议。

查看Raspberry Pi TechXchange有关Raspberry Pi的更多文章。

What you’ll learn:

  • How to leverage tips and advice from Newark and the element14 Community to get the most out of your Raspberry Pi.

尽管Raspberry Pi并不是市场上第一台单板计算机,但没有人享有同样的成功。Raspberry Pi的替代方案可能具有更快的CPU速度,更多的IO或专门的板载外围设备,但它们都没有价格,支持,功率和功能的“正当”组合。

The Raspberry Pi has evolved from a tool for students and hobbyists to a viable option for certain types of engineering projects in the form of the Compute Module, and most recently the Raspberry Pi Pico. The latter brings Raspberry Pi’s signature values of high performance, low cost, and ease of use to the microcontroller market in a game-changing $4 development kit.

如果你正在考虑的覆盆子π因为to curiosity about electronics and coding, or even if you’re a practicing engineer, just go for it. The size of the community and the sheer number of publicly available forums tutorials and projects means than you will be in good company as you explore and experiment.

But while the Raspberry Pi might possess that “just right” feel of functionality, it also has its eccentricities and idiosyncrasies like anything else. Focusing on Raspberry Pi’s traditional offering—the latest of which is the Raspberry Pi 4—the following tips can help you overcome some of the vulnerabilities and limitations when inventing with the Pi(Fig. 1).


电力的需求

由于Raspberry Pi不带有机载电源,因此您必须提供一个。根据经验,请考虑比必要的更高的毫安(MA)评级。当您开始添加配件和外部电路时,额外的安培数可能会防止覆盆子PI重置。

Even if your configuration doesn’t overload the circuit, an insufficient power supply may inadvertently hurt your Raspberry Pi’s performance or corrupt the SD card. If the supply voltage dips or the unit overheats, the GPU in the Raspberry Pi will throttle the CPU speed down.

Overcoming Storage Limitations

Raspberry Pi没有硬盘驱动器,但是这种限制实际上很容易克服。您可以通过以太网端口或Wi-Fi将Raspberry Pi连接到NAS单元,或通过USB到SATA适配器通过一个USB端口连接外部驱动器(Fig. 2).


Keep in mind that connecting external storage to the Raspberry Pi isn’t just a novelty—it’s insurance. As you experiment with Raspberry Pi, you will inevitably corrupt your SD card. It’s good practice to store anything important somewhere other than the SD card.

告诉时间

覆盆子PI无法独自分辨时间,因为它们没有实时时钟(RTC)或模数转换器(ADC)。另外,董事会上的GPIO引脚在3.3 V DC上运行,而大多数配件可能希望与Raspberry Pi一起使用,在5 V DC下运行。幸运的是,RTC,ADC和3.3至5-V转换器模块是便宜且易于获得的设备。

如果您的时间销售要求并不非常严格,则可以简单地设置Raspberry Pi来通过Wi-Fi,以太网或蓝牙连接来检查时间。

Switching Inductive Loads

像大多数数字电子产品一样,覆盆子PI易受转换电感载荷带来的电磁干扰(EMI)和背部电动力(EMF)。这些干扰罪犯的一些例子包括电磁阀,继电器,接触器和电动机。覆盆子Pi甚至可以通过太近的螺线管阀或强力继电器来重置或锁定。

为了避免这种干扰及其造成的潜在损害,请始终将覆盆子PI从电感载荷中隔离,并带有pi帽子(连接到顶部的硬件,为Raspberry Pi制作的硬件规范),或为此目的设计的硬件规范,或者是optoisolator。

Another good rule is to avoid powering inductive loads from a Raspberry Pi’s power supply. The amount of trouble an inductor will give you will be roughly proportional to its physical size. In some cases, you may find that you will need quite a bit of physical separation between the Raspberry Pi and the inductor. In cases where this separation isn’t an option, consider employing a snubbing circuit of some sort, like a diode in parallel with the relay coil or an RC snubber on a dc motor.

Hitting Reset

与台式电脑,当出现的心田y, a Raspberry Pi user can’t simply Ctrl+Alt+Delete to reset it out of a halted state. Yet it’s inevitable that you will lock up your Raspberry Pi at some point during your experimentation.

Usually this isn’t a big deal, and you have a few ways of dealing with it. For one, you can power cycle your Raspberry Pi by unplugging the power supply from it, but this can get pretty tedious.

A better option is to get a power cable with an integrated On/Off switch, or purchase a USB pass-through board with a switch on it. If you have a Raspberry Pi 4, another option is to reset the Pi’s SoC by connecting the Global_ EN pin to a ground.

利用LED来控制

When writing code that controls the hardware on the Raspberry Pi, start by blinking an LED. It doesn’t matter if you’re attempting to control the GPIO pins on the Raspberry Pi itself, or some aspect of a Pi HAT or accessory board. When you can blink an LED at exactly the rate you want, then you have begun to exert a measure of control over that hardware. Blinking an LED is the “Hello World” of hardware programming.

LEDs can also be used as a kind of physical breakpoint in your code, by setting one up to blink or activate when a program hits certain points or thresholds. This isn’t always possible due to the nature of a project, but when circumstances allow it, an LED is a dead simple diagnostic tool.

创意图形

Python是Raspberry Pi的首选编程语言。开始编写Python代码后不久,您将要制作自己的自定义GUI。Tkinter是Python的事实上的GUI包,如它的顶部所述Wiki page. Unfortunately, Tkinter isn’t documented very well in any one place. To learn it, you will have to spend time combing the internet and pooling information from multiple sources.

对于新用户来说,TKINTER可能有些不知所措,甚至令人沮丧。看起来更容易看Guizero,Python 3的图书馆也许是在Python制作GUI的最快,最简单的方法。

最后的想法

覆盆子PI的易用性使其在选择开发板时使其对制造商,工程师和设计师如此有吸引力。但是,这种功能和配置权衡带来了一些轻松的选择。

The good news is that the broader Raspberry Pi community has figured out solutions to most of these limitations. By leveraging the abundance of tips and advice from the community, you can gain a solid understanding of the coding and electronics needs of your solution.

If you’re looking for more information and additional tips for troubleshooting the Raspberry Pi, download this helpfuleBookfrom the element14 community.

来自我们的合作伙伴

您的技术商是什么?

Take a bite size look on the tech landscape of AI - where we have been, where we are, and where we are going. Then explore more with our partner Micr…

好处of a Smart Battery Charging and Testing Unit

Top Tips: Benefits of a Smart Battery Charging and Testing Unit | 1. Sponsored by. Use the device longer Thanks to the Battery Care philosophy and stra…

11种保护您的电力路径2的方法

TI.com I 2019. 11 Ways to Protect Your Power Path Design Tips and Tradeoffs Using TI’s Power Switches. Table of Contents Introduction: Basics of Power…

专业的物联网设备调试工具和技术指南

March 23, 2021
嵌入式系统的开发,软件和硬件必须很好地发挥作用,甚至变得非常复杂和具有挑战性,甚至……

同步整流器的控制和设计挑战

随着电信和移动技术的开发,智能手机,平板电脑和笔记本计算机成为日常LI的重要部分…

Voice your opinion!

This site requires you to register or login to post a comment.
尚未添加评论。想开始对话吗?

来自我们的合作伙伴

您的技术商是什么?

Take a bite size look on the tech landscape of AI - where we have been, where we are, and where we are going. Then explore more with our partner Micr…

好处of a Smart Battery Charging and Testing Unit

Top Tips: Benefits of a Smart Battery Charging and Testing Unit | 1. Sponsored by. Use the device longer Thanks to the Battery Care philosophy and stra…

11种保护您的电力路径2的方法

TI.com I 2019. 11 Ways to Protect Your Power Path Design Tips and Tradeoffs Using TI’s Power Switches. Table of Contents Introduction: Basics of Power…

专业的物联网设备调试工具和技术指南

嵌入式系统的开发,软件和硬件必须很好地发挥作用,甚至变得非常复杂和具有挑战性,甚至……
2018beplay

英特尔雇用顶级苹果工程师监督Mac的M1芯片

Jan. 13, 2022
除非其工程团队达到延误,否则2022年是苹果公司计划将英特尔完全推出其MAC阵容的一年,甚至从目前...
18beplay下载

GM Taps Qualcomm Chips For Self-Driving System Due Out in 2023

2022年1月12日
Qualcomm is wrestling with Intel's Mobileye and automotive chip giants such as NXP to win market share in chips that power self-driving systems in cars.
Baidu