Erroneous behaviour with Nodemcu and KeybusReader - help troubleshooting #270
-
First, let me start off with how awesome this is! I used the Unlocker to help get my installer code and it worked like a charm! So happy to have control over my alarm system finally. I'm moving up to the next step which is controlling the alarm system directly, long term, through Home Assistant, however, when I tried using a nodemcu instead of the arduino uno I had used for the unlocker, I ran into issues, namely that the alarm system went haywire and the alarm started going off. I decided to step back and just do the KeybusReader sketch as a troubleshooting step and the same thing happened. So, I took the exact same breadboard circuit I was using with the nodemcu, swapped out the 33K resistors for 15K resistors and connected it up to the arduino with the KeybusReader sketch loaded, and it worked beautifully. I re-flashed the nodemcu, swapped it back and same issue, the system goes haywire, and on the serial monitor there is a bunch of stuff like this showing up: 20:24:35.988 -> 123.58: 00000101 0 10010001 00000010 00010000 11000111 00010000 10000011 00000000 01000011 [0x05] Partition 1: Ready Trouble Backlight - Stay zones open | Partition 2: disabled | Partition 3: Trouble - Unknown data: 0x83 | Partition 4: none - Unknown data: 0x43 For the Arduino I'm using pins 3,5,6, per the sketch. I connect ground to the "Aux -" since I'm powering the board with the USB for the serial monitor, and I'm using a 2n2222A that I had lying around. For the nodemcu, I'm using pins D1, D2, and D8 per the sketch, same thing, I connect ground to the "Aux -" on the DSC since I'm powering the board with the USB, everything else is the same except the resistors. I'm just taking the leads from the breadboard and plugging them into the nodemcu instead of the Arduino. Also, I've got a DSC 1832. Maybe it has something to do with the ground and the AUX - setup? I don't have a voltage regulator handy, so I figured I could power things with just the onboard USB plug on the nodemcu, but maybe tying that into the DSC AUX ground is creating a challenge? If I don't plug the ground into the AUX - though, the KeybusReader doesn't work with just the yellow and green connected. I greatly appreciate any thoughts, or troubleshooting suggestions, and thank you again for your hard work on this! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
I got a chance to test some suggestions from the AVRFreak forum around changing where the ground was tied into the DSC, and it looks like I was getting the same issue whether I tied into the AUX -, the black terminal, or the GND terminals for the sensors. I did some additional troubleshooting though and it looks like the culprit ended up being the resistors in the clock and read circuits. There were two issues.
It took me a while to track this down last night, but I had the thought that all the erroneous behavior seemed to be "write" related, rather than "read" related, so I thought, "I wonder what would happen if I just remove the 'write' pin and leave it in read only mode?" Surprise, it worked like a charm! So I was thinking, hey I've got this nailed down to only a few components which help write data to the system. So I do a little bit more and it starts to look like the NPN transistor is the culprit. So I figure, let me cross check what I'm seeing when the nodemcu is connected, against the Arduino, since both circuits were using the transistor and if it was a problem for one, I would've expected it to be a problem for the other. I plug all the interface pins of the circuit into the Arduino, to see why the write seems to work fine with the arduino but not the nodemcu, and wouldn't you know it, it's not working with the arduino either. What the heck?? I'm scratching my head. I review the circuit and see in my haste that I accidentally used the 33K resistors for the nodemcu instead of the 15K resistors for the arduino. I plug into the 15K resistors and the issue is gone, no problems reading or writing. So I take the circuit back to the bench and test the resistors. Yeah, one of the 33K resistors was showing a resistance of 0.00, so that wasn't good. But even after swapping both out for 33K-measured, resistors, it still gave the erroneous behavior. In the end, I've just stuck with the 15K resistors which send a little less than 5v to the nodemcu and I'm monitoring to see how that goes. I think I'm going to switch over to an opto-isolated circuit to eliminate the issue with the voltage difference completely and go from there. But I wanted to share in case other's had the same challenges and were looking for some insights. |
Beta Was this translation helpful? Give feedback.
-
I doubt the voltage divider is the issue here . As long as you have the correct ratio. 33/15 will give you about 5volt for arduino. You need 33/10 for the ESp as you need no more than 3.3 volt . This circuit as designed works very well both for both arduino and the esp . I suspect you have other issues with your circuit. If you accidentely used 0 ohms instead of 33k then you were then feeding 12volt into the chip since the 33k is there to drop the excess voltage which potentially killed that pin causing you more issues. Try new input pins now or a different chip. |
Beta Was this translation helpful? Give feedback.
-
The 2n2222 is perfectly fine. It's not a critical component. When you say erroneous behaviour what do you mean exactly? Is it affecting the panel itself or are you not getting any data in /out? If the panel is affected, you either have a bad ground or you are loading up one of the data lines on the panel. Either via a short or putting spurious data unto the line.. Unfortunately to debug something like that properly you would need a scope. Are you sure you are using the correct write pin from the Nodemcu? If you have the wrong pin, you would be driving the line all the time, causing panel issues. Also, ensure you have the npn wired correctly which I assume you already checked. Sometimes you just need to step back and recheck everything again and never assume something is correct. |
Beta Was this translation helpful? Give feedback.
-
Well, obvioulsy you have something wrong with the transistor circuit or the d8 line or somewhere else with your hookup. I really can't say what it is. Good luck! Check your voltages on the d8 line and the transistor base to see what they are at least. They should be zero at idle. |
Beta Was this translation helpful? Give feedback.
-
I would question your input power. DSC supplies 12V which I believe is greater than the nodeMCU max input voltage. I used this buck converter: 5 Pack Mini DC-DC Buck Converter, 3A Step Down Power Supply Module Adjustable 12-24V to 5V https://www.amazon.com/dp/B08L5XSXD9/ref=cm_sw_r_cp_api_glt_i_3BMH3AF2WWHQFD8XQ3M1?_encoding=UTF8&psc=1 It is currently unavailable, but you should be able to find others like it. With this one or some others like it you would have to cut the trace on the back for the ADJustment potentiometer and solder across the pads for 5V. The resistors and transistors as described on the main page worked perfectly for me with the above voltage regulator and a WeMos D1 Mini NodeMCU connecting to a DSC Power Series 832 (PC5010). |
Beta Was this translation helpful? Give feedback.
Well, obvioulsy you have something wrong with the transistor circuit or the d8 line or somewhere else with your hookup. I really can't say what it is. Good luck! Check your voltages on the d8 line and the transistor base to see what they are at least. They should be zero at idle.