完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,所以我使用Sparkfun的突破来连接ADXL362加速度计,以便使用arduino uno。
为了给传感器供电,我从arduino输出3.3V输出到ADXL362的V输入端,arduino地输出到传感器接地端。 我还使用分压器将arduino的9-11引脚从5V切换到3.3V,然后将它们插入CS,SCK和MOSI。 传感器的MISO输出直接连接到arduino的引脚12。 当我尝试从库中运行SimpleRead示例代码时,我得到所有测量的零输出,如下所示。 我也尝试通过第四个分压器连接MISO,但我仍然无法读取任何内容。 我不确定这只是一个布线问题还是编码问题。 我只是加载SimpleRead草图并按下上传。 任何建议表示赞赏! 传感器输出: X = 0。 Y = 0。 Z = 0。 TEMP = 0 X = 0。 Y = 0。 Z = 0。 TEMP = 0 X = 0。 Y = 0。 Z = 0。 TEMP = 0 X = 0。 Y = 0。 Z = 0。 TEMP = 0 X = 0。 Y = 0。 Z = 0。 TEMP = 0 以上来自于谷歌翻译 以下为原文 Hi, so I wired up an ADXL362 accelerometer using a breakout from Sparkfun to work with an arduino uno. To power the sensor I have 3.3V output from the arduino going to the V input of the ADXL362 and arduino ground going to the sensor ground. Also I level shifted pins 9-11 of the arduino from 5V to 3.3V using a voltage divider and plugged those into CS, SCK, and MOSI. The MISO output from the sensor is wired directly into pin 12 of the arduino. When I try to run the SimpleRead example code from the library I get zero output for all measurements as seen below. I also tried connecting the MISO through a fourth voltage divider but I still could not read anything. I’m not sure if it’s just a wiring issue or a coding issue. I am just loading up the SimpleRead sketch and pressing upload. Any advice is appreciated! Sensor output: X=0. Y=0. Z=0. TEMP=0 X=0. Y=0. Z=0. TEMP=0 X=0. Y=0. Z=0. TEMP=0 X=0. Y=0. Z=0. TEMP=0 X=0. Y=0. Z=0. TEMP=0 |
|
相关推荐
11个回答
|
|
只需快速浏览一下你的照片,你就不会在Arduino上的地板上挂上地面。
虽然有点难看。 这意味着您的电阻器实际上不会接地。 我会仔细检查接线。 以上来自于谷歌翻译 以下为原文 Just a quick look at your picture it does not appear that you have your ground plain on the board hooked to ground on the Arduino. It is a little hard to see though. This would mean that your resistors would actually not be grounded. I would double check the wiring. |
|
|
|
嗨罗伯特,地面停了下来。
红线从arduino接地到面包板的负导轨,并使用万用表检查分压器的电压并读取~3.3V。 谢谢! 以上来自于谷歌翻译 以下为原文 Hi Robert, the ground is grounded. The red wire goes from the arduino ground to the negative rail of the breadboard and the voltage from the divider was checked using a multimeter and read ~3.3V. Thank you! |
|
|
|
designSTROM:
ADXL362 @designSTROM让我和我的同事一起来看看这个。 我认为这有点关系。 让我看看我是否能找到这个电路板的示例电路,看看我们能做些什么。 - 罗伯特· 以上来自于谷歌翻译 以下为原文 designSTROM: ADXL362@designSTROM Let me look into this with one one my coworkers. I am thinking that there is something off with how this is wired. Let me see if I can find an example circuit for this board and see what we can do. -Robert |
|
|
|
|
|
|
|
你好@designSTROM,
不幸的是,你无法通过分压器运行信号,将电压从5V提升到3.3V。 电阻会使信号失真太多,分压器中的两个电阻需要保持完全恒定。 评估板具有不断变化的阻力,无法计算在内。 有一个非常简单的解决方案可以按照此处的说明将5V Arduino转换为3.3V电压: learn.adafruit.com 3.3V转换| Arduino提示,技巧和技巧| Adafruit学习...... 充分利用您的Arduino 电压固定后,您可以验证传感器和Arduino之间的连接。 以下链接可以帮助解释Arduino如何连接,以便您知道需要使用哪些引脚。 你必须特别使用这个引脚,因为我个人试图使用其他引脚,但有硬件限制只允许这些引脚工作。 https://www.arduino.cc/en/Reference/SPI 我知道这是很多信息,请仔细查看,如果您有任何其他问题,请告诉我们。 以上来自于谷歌翻译 以下为原文 Hello @designSTROM, Unfortunately you can’t run the signal through a voltage divider to bring the voltage from 5V to 3.3V. The resistance distorts the signal too much and the two resistances in the divider would need to remain perfectly constant. The eval board has an ever-changing resistance and can’t be counted on. There is a pretty easy solution to turn your 5V Arduino into a 3.3V one by following the instructions located here: learn.adafruit.com 3.3V Conversion | Arduino Tips, Tricks, and Techniques | Adafruit Learning... Get the most out of your Arduino After the voltages get fixed then you can verify the connections between the sensor and Arduino. The below link can help explain how the Arduino is hooked up so you know which pins need to be used. You have to use this pins specifically as I have personally tried to use other pins but there are hardware restrictions allowing only these pins to work. https://www.arduino.cc/en/Reference/SPI I know this is a lot of info, please look it over and let us know if you have any further questions. |
|
|
|
谢谢乔伊!
那么,如果我选择一个从5V到3.3V的逻辑电平转换器(反之亦然),那会解决问题吗? 所以我只想将逻辑转换器设置为将电线与Arduino和传感器分开的适配器。 我将确保根据您发送的第二个指南连接引脚。 以上来自于谷歌翻译 以下为原文 Thank you Joey! So if I picked up a logic level converter that goes from 5V to 3.3V (and vice versa) would that resolve the issue? So I would just set the logic converter as an adapter separating the wires from the Arduino and the sensor. And I will be sure to connect the pins according to the second guide you sent. |
|
|
|
是。
实际上,SPI接口推荐使用SparkFun的逻辑电平转换器(1568-1209-ND)。 这样可以避免转换的焊接部分,并使用它们的连接引导使其变得非常容易。 以上来自于谷歌翻译 以下为原文 Yes. Actually SparkFun’s logic level converter (1568-1209-ND) is recommended for SPI interface. This would avoid the soldering part of the conversion and using their hook-up guide makes it really easy. |
|
|
|
出于好奇,逻辑电平转换器与电阻分压器的不同之处是什么?
为什么一种方法可行而不是另一种方法? 以上来自于谷歌翻译 以下为原文 Just out of curiosity, what does a logic level converter do differently than a resistor voltage divider? Why would one approach work and not the other? |
|
|
|
分压器的最大问题是电阻的连续变化。
我将在下面参考我极其粗略的绘图。 假设那里只有两个100欧姆的电阻器,我们将在每个电阻器上获得5V,因为电阻是相等的。 将电压降低一半,简单易行。 一旦我们在其中添加10欧姆电阻(这将是您的评估板的一个示例),底部电路的电阻会发生变化。 由于它们并联连接,底部电阻和评估板的总电阻将低于电路中的最小电阻,当然是10欧姆。 这会使比例偏离,你不再拥有以前的电压。 即使您有办法测量评估板的电阻并确保比例准确,您也必须记住,当评估板工作时,内部电阻将不断变化。 逻辑电平转换器基本上是在接收信号时接通次级电压的晶体管。 关于这一点的好处是,当它获得输入电压时,它将发出完全独立的电压,这意味着它将比通过电阻器运行它更清洁。 我希望这是有道理的。 以上来自于谷歌翻译 以下为原文 Biggest issue with the voltage divider is the continuous change in resistance. I’m going to reference my extremely crude drawing below. Assuming there was only the two 100 Ohm resistors there, we would get 5V across each of those resistors because the resistances are equal. Cut the voltage in half, simple and easy. Once we add the 10 Ohm resistor in there (this would be an example of your eval board) then the resistance of the bottom circuit changes. Since they are connected in parallel, the total resistance of the bottom resistor and the eval board is going to be below the smallest resistance in the circuit which is of course the 10 Ohms. This throws the proportions way off and you no longer have the same voltages you did before. Even if you had a way to measure the resistance of the eval board and get the proportions exact, you have to keep in mind that as the eval board operates the internal resistance is going to be changing constantly. A logic level converter is basically a transistor that switches a secondary voltage on when it receives a signal. The nice thing about that is when it gets that input voltage it will send out a completely separate voltage which means it’s going to be a lot cleaner than if you were to run it through resistors. I hope that makes sense. |
|
|
|
我拿起了一个逻辑电平转换器。
不是来自Sparkfun的那个,而是这个:http://amzn.to/2h7m8rn。 它说I2C但是对于逻辑转换器来说这有关系吗? 无论如何,我把它插入系统,我仍然没有输出。 我测试了转换器的输出,它们都是3.2V,应该在传感器的范围内。 你有什么想法可以导致这个问题吗? 以上来自于谷歌翻译 以下为原文 I picked up a logic level converter. Not the one from Sparkfun, but this one: http://amzn.to/2h7m8rn. It says I2C but for a logic converter does that matter? Anyway I plugged it into the system and I am still getting no output. I’ve tested the output of the converter and they are all 3.2V which should be within range of the sensor. Do you have any ideas as to what else could be causing this issue? |
|
|
|
@designSTROM
首先,我会仔细检查你的接线,以确保一切都有良好的连接。 也许你可以告诉我什么是连接到哪些引脚。 其次是ADXL362的输出? 你可以在没有转换的情况下做一个簧片,看看是否有输出。 这可以验证ADXL362是否正常工作。 第三,我们需要查看代码以确保它正常工作。 我自己没有使用过简单的读库。 我可能需要加载它以查看所涉及的内容。 如果你想要,你可以在这里加载你的代码,我们明天可以和我的团队一起看看。 我正在查看其他教程之一,它显示了这样的订单。 ◦SS - 数字10.您可以使用其他数字引脚,但10通常是默认值,因为它紧挨着其他SPI引脚; ◦MOSI - 数字11; ◦MISO - 数字12; ◦SCK - 数字13; 你声明你使用的是9-11我只想确保你的设置正确连接所有东西。 - 罗伯特· 以上来自于谷歌翻译 以下为原文 @designSTROM First I would just double check you wiring to make sure everything has good connections. Maybe you can show me what is hooked up to which pins. Second is there an output from the ADXL362? Can you do a reed without the conversion to see if there is an output. This may verify that the ADXL362 is working properly. Third we need to look at the code to ensure it is working properly. I have not used the simple read library myself. I may have to load it to see what is involved. If you want you can load your code on here and we can look this tomorrow with my team. I was looking at one of the other tutorials I have and it shows the pins ordered as such. ◦SS – digital 10. You can use other digital pins, but 10 is generally the default as it is next to the other SPI pins; ◦MOSI – digital 11; ◦MISO – digital 12; ◦SCK – digital 13; You stated you were using 9-11 I just want to ensure everything is hooked up correctly per your set-up. -Robert |
|
|
|
只有小组成员才能发言,加入小组>>
3475 浏览 3 评论
515浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 10:06 , Processed in 1.070946 second(s), Total 66, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号