problem with DS18B20 #4076
Replies: 1 comment
-
Posted at 2014-01-26 by Frida I use A0, and it works fine. Posted at 2014-01-26 by graf If you are using breadboard make sure that the data wire is connected between the resistor and sensor, or in other words that the resistor is not on the way between espruino and thermometer. Posted at 2014-01-26 by Kim That is exactly how it is wired up. I didn't know about the resistor though, but even changing the position doesn't change the result of null. I changed boards though, to one with 1v43 on it, and then it magically works ... can you confirm the firmware version of your board? Posted at 2014-01-26 by Kim Ok, I just verified my assumption. All wiring as is, I flashed older versions onto the board. Using 1v46 and 1v45 prevents me from reading the signal. Going back to 1v43 and the temperature is measured just fine. Posted at 2014-01-26 by Frida I am running the latest 1V46 Posted at 2014-01-26 by Kim very odd ... it is reproducible though: if I flash 1v46 on there it all stops, and if I go back to 1v43 again the thermometer once again works ... Posted at 2014-01-26 by graf @kim are you loading this module via the WebIDE or is it just copy+paste (the module itself)? I have just tried with the latest 1v47 build and the example code works fine, but I'm using HY board and not official Espruino. After uploading the example code could you please try to clearInterval() and then
And sorry for the ugly code formatting, I don't really get how it works on this forum. Posted at 2014-01-26 by graf Oh and I should have add that I'm using this module for quite a long time now as it's the core for my project and I did not have any issues on previous firmware versions. But then the module itself has also changed in the meantime so it's hard to tell. Could you also give me the output of ```process.env`` so I can try with the exact same version of firmware that you are using. Posted at 2014-01-26 by JumJum As far as I understand, DS18B20 is a serial device and A1/A0 are not serial ports, they are PMW/ADC, at least on Espruino Board. Posted at 2014-01-26 by graf @jumjum could you give me the exact version (build date) so I can flash my board with it and see what happens? Posted at 2014-01-26 by Kim @graf don't worry about the code formatting, it's fine :). with version 1v43
with version 1v46
Posted at 2014-01-26 by graf Thanks. Just tried with 1v46 build on 24th January and it works fine, including on ADC/PWM pin. But again, I'm not using the official Espruino board. This can be helpful to Gordon. Also in your case Posted at 2014-01-26 by graf I wonder wich board is @frida using? Posted at 2014-01-26 by Frida I am using rev. 1.3b that arrived on friday and my env is:
and that is my code Posted at 2014-01-26 by JumJum Just tried yours on my Espruino 1.3b, env is exactly the same. Posted at 2014-01-26 by Frida It is weird. After I updated to 1v46, I done a reset() and a save() before I loaded and run the code. Posted at 2014-01-26 by graf @jumjum just to clarify, could you also confirm that in this last case Posted at 2014-01-26 by JumJum just checked, ow.search returns nothing Posted at 2014-01-26 by Frida I have tried the other 3 boards I have, and 2 of them does not work either.
/
*/ print(getTime()); /* board that not work 7.34425 */ /* board that work 9.21675 The timing here are before, and after the require. Maybe it has something with the timing to do. Posted at 2014-01-26 by JumJum @frida, great job and good point. Posted at 2014-01-27 by Frida Stm32f3discovery 1 Stm32f3discovery 2 Espruino Board 1 Espruino Board 2 Espruino Board 3 Espruino Board 4 With Espruino Board 1 as a reference, I can se that my discovery board's are a lot slower, and my espruino Board 2..4 are faster. And the DS18B20, that came with the kit, can run on my discovery, but my other DS18B20, can't run on the espruino's. It is tested with the following code. CODE print(getTime()); I think we need a variable or something so we can adjust the time. Posted at 2014-01-27 by @gfwilliams Argh. I'll have a look at this later today. So you're saying that some 1v46 Espruino Boards work and some don't? This is almost certainly an issue with the switch to using the RTC. OneWire support uses software to produce/read the signal. On startup the Espruino calibrates itself against the RTC but perhaps the internal oscillator hasn't settled down enough to produce an accurate reading at that point. @frida: Sadly the internal RC oscillator used for the RTC is only ~2% accurate. I've been looking at ways to calibrate it using the high speed oscillator as a guide, but that's relatively low priority at the moment. Sorry about this - I actually gave a talk using the DS18B20 and the latest version of Espruino on wednesday, so I'm amazed this didn't come up then. Posted at 2014-01-27 by Frida No problem, I got my espruino's Friday, and my discovery works. Posted at 2014-01-27 by Frida @gfwilliams
I saw it with github, and it worked, changed path to the EABI, did a make and a make serialflash, you are the man of the day. Posted at 2014-01-27 by @gfwilliams Awesome, great news! I'm going to try and fix the CC3000 HTTP server and then I'll do another proper release. Looks like the low speed oscillator takes a while to start up (on some boards) and that caused the problem... Posted at 2014-01-28 by JumJum Just installed new version 1v47 and it works. There is still one question, A1 is not serial port as far as I understand. Posted at 2014-01-28 by Frida That is because, software that are doing the job, so any pin can be used to DS18B20. Posted at 2014-01-28 by @gfwilliams Yes, OneWire is handled in software, so any pin can do it. At the moment that's it (apart from Posted at 2014-09-06 by Ollie Sorry to revive this. I've been getting the "null" response today. I'm fairly sure I have them connected correctly, whilst I'm new to electronics it doesn't appear to be that hard. Would anyone know if this works ok in V1.69 of the firmware. Picture of my setup in case I'm doing anything obviously wrong. I'm using A1. The two additional wires near A1 are power for a CC3000 which is just out of shot. Edit: I flashed some of the older firmware that people had this working with, still no work so it's likely me, but how/why I don't know. Edit: I have the wrong resistor. Ignore me :( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-01-25 by Kim
I wired the temperature sensor from the set up according to the instructions on http://www.espruino.com/DS18B20 , but all it returns is
null
. Nothing really that I can add as I've redone the wiring twice (power to 3.3V, ground to GND, data to A1, 4.7k resistor connecting power and data).Beta Was this translation helpful? Give feedback.
All reactions