|
Post by papa on Oct 30, 2018 21:17:41 GMT
Vibration Sensor Node, Configuring for OpenHAB 2 Results Updated Nov. 26, 2018
(Note: the following assumes NODEID 90 (see customizing above) & installation of OpenHAB 2, MQTT binding, & Mosquitto.) Vib_Sense90.items (573 B) << Download & save to OpenHAB 2's \conf\ items folder This file contains items for Node 90 radio signal strength, voltage, vibration state, & vibration value (vibration seconds), & vibration change timestamp. Vib_Sense90.rules (979 B) << Download & save to OpenHAB 2's \conf\ rules folder This file contains a "Vibr90_Timer_Status" rule that converts negative vibration values (secs) to quiet & positive values to VIBRATE in the item Node90VibState. That rule also timestamps changes in vibration state. The rule "When_Vibr90_State_changes" triggers a OpenHAB log entry when vibration state happens. Add these lines to your xxx. sitemap file in OpenHAB 2's \conf\ sitemaps folder: Switch item=Node90VibState Text item=vibr90_time Text item=Node90VibVal
On the OpenHAB User Interface in a browser or mobile app, this will display the Node 90 vibration state (as a switch), & vibration value (vibrations seconds), & vibration change timestamp.
Next, Vibration Sensing / Timing Node, Getting OpenHAB 2 Results
|
|
|
Post by papa on Oct 29, 2018 20:05:02 GMT
Vibration Sensing & Timing Node, Serial Monitor Results Updated Nov. 26, 2018
Open the Arduino IDE's Serial Monitor & at the lower right, set it to 115200 baud & here are some sample results you could expect (my comments in colored text):
(If // #define sampleReport is UNcommented, more sampling detail will show) Node 90 Version MhF9p VIBtsai GW2.5.1 [ NODEID, sketch version, function, Gateway version [startup messages]Transmitting at 915 Mhz... < RFM69 radio frequency, successful transmission to Gateway Node: 90 dev: 99 cmd: 0 Ival: 0 Fval: 0.00 RSSI: -48 < device 99, wake upNode: 90 dev: 2 cmd: 0 Ival: 0 Fval: 0.00 RSSI: -49 < device 2, Radio Signal Strength (RSSI=-49)Node: 90 dev: 4 cmd: 0 Ival: 0 Fval: 3.26 RSSI: -48 < device 4, node voltage (3.22)Node: 90 dev: 9 cmd: 0 Ival: 1 Fval: 3.26 RSSI: -48 < device 9, transmission attempts needed for success (only 1)Node: 90 dev: 71 cmd: 0 Ival: 0 Fval: 3.26 RSSI: -48 quiet !! < periods of quiet quiet !! signal running, secs: 0 < started sensing vibrationNode: 90 dev: 71 cmd: 0 Ival: 0 Fval: 0.00 RSSI: -49 signal running, secs: 2 signal running, secs: 4 < vibration secs, updates on Serial Monitor signal running, secs: 6 but not sent to OpenHAB signal running, secs: 8 until vibration ends total seconds of signal: 10 quiet !! < ^ detect quiet, ending duration of vibration
Node: 90 dev: 71 cmd: 0 Ival: -10 Fval: 0.00 RSSI: -54 quiet !! ^ -10 negative means vibration ended ^ device 71 sent to OpenHAB via Gateway
Next, Vibration Sensing/Timing Node, Configuring for OpenHAB 2 Results
|
|
|
Post by papa on Oct 29, 2018 19:57:59 GMT
Customizing the Node Choices Sketch for a Vibration Sensing & Timing Node Updated Dec. 16, 2018
To the initial customization obtained above, add:
#define NODEID 05 << change 05 to a unique number in your RFM69 network (For this sound sensor node, I suggest you use NODEID 90 as I will below.)
Find these THREE lines & UNcomment the first two lines : // #define sample_tsai < Uncomment this line (no // at its start) // #define VIBR_tsai < Uncomment this line // #define MIC_tsai < leave this line commented
(Caution: VIBR_tsai & MIC_tsai cannot be used on the same node)
Optional, for more Serial Monitor detail, UNcomment this line: // #define sampleReport
Connect the node to your computer's USB. Using the Arduino IDE, upload the customized sketch to the Vibration Sensor End Node. Next, Vibration Sensor End Node, Serial Monitor Results
|
|
|
Post by papa on Oct 29, 2018 19:53:12 GMT
Program an RFM69 Vibration Sensor Node Updated Nov. 26, 2018
GO HERE to download the latest node choices sketch (new version Dec. 7, 2018) & achieve initial customization. Open the with the Arduino IDE. This coding now uses the tsai sampling that works well for the MIC Sound Sensor & works much better for the vibration sensor. To see how the vibration sensor code works, look at the sketch sections that start with #ifdef VIBR_tsai. This vibration sensor programming is different from what Joshua provided in his Adding More Sensors to RFM69 Nodes thread. However, I made I also changed Joshua's wiring: Joshua used Arduino A 4 to receive vibration data from the sensor, but I use A 0. Joshua used an Arduino power socket, but I used Arduino D4 (set to output HIGH) to power the sensor. Next, Customizing the Node Choices Sketch for a Vibration Sensor Node
|
|
|
Post by papa on Oct 27, 2018 20:00:15 GMT
Schematic for An RFM69 Vibration Sensor Node
Be kind to yourself & do NOT build this node until you have created your RFM69 Gateway & a least one previous node (See previous post).
<< Forum members, click on pic for larger view
added parts: 3 (color-coded ?) dupont male to female cables to connect the Arduino sockets to the sensors' pins.
Note 1: In this schematic, its important to use an Arduino compatible (like a Buono Uno) that sends 3.3 volts through its digital pins (like D2). A 5 volt Arduino would damage the RFM69 radio. The Building an RFM69 Home Automation Network thread & the linked Gateway thread gives more about this.
Note 2: The Vibration Sensor's VCC is powered by 3.3 volts from Arduino D4, not from Arduino's 3.3 volt socket. The sketch below will set Arduino D4 HIGH so it can power the sensor.
Note 3: Make the connections according to the labels of the pins. The pins' locations in the schematic diagram do NOT match their actual locations.
Next, Program an RFM69 Vibration Sensor Node
|
|
|
Post by papa on Oct 27, 2018 19:38:24 GMT
Update Oct. 24, 2018: Again, as in the last post, OpenHAB would briefly flash its console window, but not start up & the OpenHAB User Interface would not load. I remembered that I had just updated Java & that I had left the above post's hint for us. I used the steps above to update to my latest Java's path, C:\Program Files (x86)\Java\jre1.8.0_191
Since the previous occasion of this problem, I had established OpenHAB2 as a Windows service. So in Windows Services, I started the OpenHAB2 service. One could also run cmd.exe as an administrator & enter the command: net start OpenHAB2.
This got OpenHAB2 back in business again.
|
|
|
Post by papa on Oct 26, 2018 15:44:47 GMT
I just fixed a compiling error that might be instructive to others: "a function-definition is not allowed here before '{' token" That error was flagged at "void loop() {" , namely the start of the sketch's main code loop.
Sometimes the Arduino IDE compiler points very near where the problem is created, but frequently the compiler just points to where the problem was noticed. I eventually looked at some recently added code & found that I began a section with "if ..... {" & did not close the section with the matching } curly bracket that should close the "if" section. This threw off the compiler's count of matching curly brackets. Each left curly bracket must have a later right curly bracket.
Insight: When an error includes a bracket, look above the error flagged line for a missing bracket & especially look in recently added code to see if you missed including a bracket there.
|
|
|
Post by papa on Oct 25, 2018 21:34:02 GMT
Preparing for An RFM69 Vibration Sensor Node
In order to communicate with OpenHAB, this node needs you to have built & programmed a separate RFM69 Gateway. You also need experience achieving an RFM69 network. The Building an RFM69 Home Automation Network thread & the linked Gateway thread will lead you step by step (with troubleshooting hints) to achieve your first network. In that RFM69 Network thread, work your way through making the RFM69 Bare Bones End Node & getting it communicating with the RFM69 Gateway. That is, you can follow the thread & stop after achieving this post. Then you can add the vibration sensor breakout board to the Bare Bones End Node (schematic below) with a high likelihood of success.
Skip this step if you already have a working Gateway & node. If you do NOT have a working Gateway & node yet, do NOT skip this step because it is probably the most challenging aspect of the project.
Next, Schematic for An RFM69 Vibration Sensor Node
|
|
|
Post by papa on Oct 24, 2018 19:26:08 GMT
Connect Vibration Sensor to Arduino Compatible
<< Forum members (free registration), click on pic for larger view.
Above is a diagram of connecting a Vibration Sensor to an Arduino compatible. We are using a compatible that can send 3.3 volts through its digital pins (D2, etc) because 5 volts will damage an RFM69 radio that we want to add later.
Schematic change on Oct. 26, 2018: To power the Vibration Sensor, we now will use Arduino D4 which the sketch will power with 3.3 volts. An Arduino compatible has only one dedicated 3.3 volt socket & later we will need that to power an RFM69 radio.
Make the connections according to the labels of the pins. The pins' locations in the diagram do NOT match their actual locations.
We will use these connections in this thread's sketches. We will later build on these connections to create a node that communicates vibration data wirelessly to OpenHAB.
Next, Preparing for An RFM69 Vibration Sensor Node
|
|
|
Post by papa on Oct 23, 2018 21:01:45 GMT
<< Forum members (free registration), click on pic for larger view. This ^^ illustrates & labels the vibration sensor board that I'm using. When the Dremmel tool (see the last post) was on & making vibrations, the board's signal indicator LED flashed (a way to see vibration detected without using the Arduino IDE's Serial Monitor). The board can lay flat on a strong vibration source & vibration will be detected. On one end of the sensor board, note the cylinder that is the vibration sensor element. Not-so-strong vibration seems to be detected better when the vibration sensor cylinder & the board are perpendicular to the vibration source.
Next, Connect Vibration Sensor to Arduino Compatible
|
|
|
Post by papa on Oct 23, 2018 20:55:00 GMT
A vibration sensor could help monitor a variety of things, various motors & machines & other objects that ... create vibrations.
VibrationSensor_Joshua.ino (347 B) << I began testing my vibration sensor board using this sketch excerpted from Joshua's RFM69 contributions. I connected sensor DO to Arduino A0 (Joshua used A4), sensor VCC to Arduino 3.3v, sensor GND to Arduino GND. (My vibration sensor board has only 3 pins & no AO pin.) I did not use the board's potentiometer to change the sensitivity. While running the sketch & watching the Arduino IDE Serial Monitor (SM), I rested the Arduino-connected sensor breakout board on a Dremel type tool. When the Dremel was off, SM showed "Vibration : 30" or "Vibration : 29" When the Dremmel was on & making vibrations, SM showed "Vibration : 1023"
|
|
|
Post by papa on Oct 22, 2018 19:26:13 GMT
Thanks, again, Joshua, for the code, schematics, & your efforts to check its merging into my Multi-Choice Node Sketch. I appreciate your ongoing contributions to this project. Since I'm considering using the VIBRATION_SENSOR to enhance one of my projects, I've looked more closely at its documentation above. A correction may be needed above in sensor fritzing diagram.pptx in the VIBRATION_SENSOR fritz. There you have the sensor's VCC pin connected to Arduino A4 & the sensor's DO pin connected to Arduino 5 volts. Is that correct? ... Did you intend to connect sensor AO to Arduino A4? According to sensor specs, it can operate on 3-5 volts so I believe we'd could connect sensor VCC to Arduino 3.3 volts or 5 volts, right?
VibrationSensor_Joshua.ino (347 B) << I began testing the board using this sketch adapted from Joshua's RFM69 contributions. I connected sensor DO to Arduino A0 (Joshua used A4), sensor VCC to Arduino 3.3v, sensor GND to Arduino GND. (My vibration sensor board has only 3 pins & no AO pin.) I did not use the board's potentiometer to change the sensitivity. While running the sketch & watching the Arduino IDE Serial Monitor (SM), I rested the Arduino-connected sensor breakout board on a Dremel type tool. When the Dremel was off, SM showed "Vibration : 30" When the Dremmel was on & making vibrations, SM showed "Vibration : 1023"
So with the above correction to connecting the sensor board to the Arduino, Joshua's Vibration Sensor code in the Multi-Choice Node sketch should work.
|
|
|
Post by papa on Oct 17, 2018 20:28:33 GMT
Welcome, new members, shxvank & nevembalint & all who have been part of this DIY Home Automation forum.
Your enrolling means that 751 users have joined this forum since its beginning.
Enjoy what is here AND remember to share your projects, ideas, learning, & encouragement for others' contributions.
|
|
|
Post by papa on Oct 11, 2018 18:07:24 GMT
I scanned the multi choice node code looking for errors related to CURSEN. Earlier in the code, I saw that for CURSEN, I changed brump's device 52 (same as Joshua's current sensor) to device 53. But later in the main loop, I found that I did not consistently change those device numbers. In this post, get the Latest Node Choices Sketch & Initial Customization.
In this version ^^ , I corrected those device numbers. This version includes Joshua's LED Strip Driver node. Joshua, please try this version & see if this avoids the RELAY2 or RELAY3 collision with CURSEN. If these changes do not help, we'll probably have to wait for brump's input (& he may be out to sea with not the best internet connection until back home)
|
|
|
Post by papa on Oct 10, 2018 23:28:20 GMT
Joshua & I have moved this node to this new thread
|
|
|
Post by papa on Oct 5, 2018 0:33:39 GMT
I don't remember if there is a separate fritz for the 3.3 volt Arduino compatible. & I'm away from my main computer for a couple weeks.
You might just add a note on the Fritz to use a 3.3 volt compatible rather than the Uno that is pictured because that is what is available.
One more change for the Fritz?? In the Fritz, you use the Arduino D10 pin (which is used for the RFM69 radio). In the sketch, you referred to D6.
|
|
|
Post by papa on Oct 4, 2018 22:33:37 GMT
Joshua, Looks like you are using a 5 volt Uno for this project. If so, how are you attaching an RFM69!radio, via a RFM69 breakout board that can handle more than 3.3 volts?
|
|
|
Post by papa on Oct 4, 2018 15:48:48 GMT
Thanks, Joshua, for adding a thread in the ESP82xx board. We needed new activity here.
Perhaps you could add a wiring diagram for this project.
|
|
|
Post by papa on Oct 2, 2018 18:51:01 GMT
You are welcome, flyyboyy. It's good to get some encouragement & feedback.
|
|
|
Post by papa on Oct 2, 2018 0:33:55 GMT
Thanks for checking in, flyyboyy: "I still have so much to do; proceed forward where I left off or start over in a new direction?"
Good question. I can say that the previous RFM69 projects, while challenging, still work & I believe are still worthwhile to do.
But it's your time & expense & you & others will need to decide where you invest.
Though I have other commitments besides this forum (one in a few days will tie me up for a couple weeks), I'll do my best to provide & encourage support here.
|
|
|
Post by papa on Sept 29, 2018 20:28:26 GMT
^^ Code for Infrared Driver of an LED strip included in the latest Multi-Choice Node Sketch Joshua & perhaps greg, could you test that I included all the new code & that the version above will work to program the new node? As far as I see, to customize for this node, one only needs to: UNcomment #define LED_Driver ... Use a NODEID number unique in your RFM69 network Edit ENCRYPTKEY "xxxxxxxxxxxxxxxx" to match the key you gave your RFM69 Gateway UNcomment according to the frequency of your RFM69 radios Probably UNcomment #define IS_RFM69HW
PS To find the new code, search for: "ifdef LED_Driver" "send35" "case (35)"
|
|
|
Post by papa on Sept 29, 2018 20:17:52 GMT
Thanks, Joshua. Also helpful would be OpenHAB entries (especially for the .items & .sitemap file).
|
|
|
Post by papa on Sept 24, 2018 20:50:49 GMT
I still wonder what others think about "Is this forum dead or inactive?" as jimkernsjr stated "or dying?"
As a whole, the forum has slowed, but as I said, Joshua & I posted things recently about RFM69 nodes. lewishollow made a post & said he is working on a future offering. Seems that June, July, & August have usually been slower maybe because in the northern hemisphere people are more active outside then.
jimkernsjr has shown more interest & activity with the ESP82xx wifi nodes. After I documented using a number of Sonoff ESP82xx wifi products, there has been little or no additions to the wifi nodes. On Oct. 3, 2018, Joshua added an ESP82xx project.
Why such little activity with wifi nodes even though they are easier (no need us to build a gateway device first)? One main reason, I believe: To my knowledge (willing to be proved wrong) most wifi products focus on controlling AC appliances, which is great. However, I don't believe we've seen them do much with sensors except for one Sonoff product that can include temperature / humidity sensors. Having more documentation to use sensors seems to bring us back to using RFM69 nodes even with the extra hassle of getting them communicating with an RFM69 Gateway.
Again, what do others think?
|
|
|
Post by papa on Sept 24, 2018 16:05:30 GMT
Joshua, I have not tried RELAY2 or RELAY3 with CURSEN. I wonder if the issue could be caused by a current shortage. When a node uses too much current, the microprocessor or RFM69 radio may reset. I've had this issue sometimes with using relays with sensors. Instead of using an Arduino pin to power the relay directly, I've used the Arduino pin to cause a transistor to supply Arduino 5 volts to the relay (See schematic below). That's worked well for me.
^^ Forum members (free registration), click on pic for larger view.
|
|
|
Post by papa on Sept 23, 2018 18:48:54 GMT
Thanks, lewishollow, for tracking down that issue & the fix. Since I use the older version of Arduino IDE / w5100.h, I did not know about that issue.
In bold, I highlighted cli() & sei() in lewishollow's post above.
|
|
|
Post by papa on Sept 19, 2018 18:43:40 GMT
Earlier in another thread, jimkernsjr posted: "I've entirely rewritten all my [ESP8266] code from those functions, errorblink and wifiOTAcheck in a version 2. It lessens the main code and makes the wifi and OTA handling trivial.
I don't want to take the time to write it up, because sadly this forum looks dead now. If anyone has a real interest, let me know, and I'll put it on github or something. I also completed my windowshade project, v2! Reproducing it now is trivial. 3d print the parts, and you can order a set of circuit boards I made up off JLCPCB that is a Wemos D1 mini stepper hat with hall sensor for shade up/setting position. If a real interest, let me know.
In light of the inactivity, I'm starting to use Tazmota and Espurna alot now,and I think I'll look into Mysensors again.
I wanted to rewrite this original system with an ESP32+RFM95 and get rid of that outdated RFM69+Arduino Ethernet Combination. But I'll look into existing systems now since there doesnt seem to anymore activity... If anyone reads this anymore, any suggestions for some existing project?
miss you all...lol " =====================================
papa's response: I've been wondering about what you've been up to jimkernsjr. Yes, forum activity has slowed. Though Joshua & I posted some things recently. Also lewishollow PMed me recently about about a User Interface for customizing end nodes that he is developing.
It would be good if you posted version 2 of the ESP82xx code somewhere & put a link here on the forum. (After all, the code probably has a relationship with what computourist offered here originally on the forum.)
I've also been disappointed when people stop by the forum to read, get ideas & help, then don't give back to the forum later with their own ideas & projects, even a quick post that what they read was helpful. From experience, I know that this takes work & putting yourself out there. But that's the only way things move forward.
What do the rest of you think? Is jimkernsjr right, that this forum is dead & we should just move on?
|
|
|
Post by papa on Sept 19, 2018 15:23:46 GMT
I've been wondering about what you've been up to jimkernsjr. Yes, forum activity has slowed. Though Joshua & I posted some things recently. Also lewishollow PMed me recently about about a User Interface for customizing end nodes that he is developing. It would be good if you posted version 2 of the ESP82xx code somewhere & put a link here on the forum. (After all, the code probably has a relationship with what computourist offered here originally on the forum.) I've also been disappointed when people stop by the forum to read, get ideas & help, then don't give back to the forum later with their own ideas & projects. From experience, I know that it takes work & putting yourself out there. But that's the only way things move forward. What do the rest of you think. Is jimkernsjr right, that this forum is dead & we should just move on?
I'm always glad to welcome new projects & documentation & questions here. If you have something, please post.
|
|
|
Post by papa on Sept 16, 2018 18:01:38 GMT
Another good contribution, Joshua. Neat use of phone jacks & phone-type cables.
Thanks also for providing links to sources for the parts.
|
|
|
Post by papa on Sept 14, 2018 21:36:14 GMT
Final Thoughts on Installing the NodeIn my experience, the mail box node inside a metal mail box did not communicate well with the gateway. So I do not recommend that.
I suggest a water-resistant plastic project box big enough to hold the Node with its antenna vertical to the Miniwireless board plus batteries & any battery container. See the solar charger documentation linked above & allow any space that might be needed later for that. I recommend project boxes that have soft plastic inserts to pierce for wire entry. Try to have a project box that can be mounted with its lid on the side so you can most easily install & service inside the box (like getting the batteries for re-charging).
Drill holes in the project box's side that will be up against the mail box mounting board.
As needed, install dupont connectors on wire ends so they will connect to the Miniwireless locations. Thread wires into the project box. With screws, fasten the box to the bottom of the mail box boards. Connect the wires. Etc.
As I wrote earlier, I have only simulated the improved mail box node with the Miniwireless. I have yet completely installed things at a mail box. When I get opportunity to do that, I will post any new thoughts.
|
|
|
Post by papa on Sept 14, 2018 21:18:59 GMT
Thoughts on Installing the Node's Tilt SwitchFor this & other projects, have assorted sizes & colors of Heat Shrink Tubing to protect & strengthen wiring (including 3/32 inch or 3mm) Have small, flexible insulated wire generously long enough to connect the tilt switch's 2 pins to the Miniwireless D6 & GND in a project box below the mail box. Maybe use 2 wires within a length of flexible USB cable. On the USB cable, free a couple inches of two individual insulated wires from the outer insulation. Slip a piece of heat shrink tubing on each wire away from the end. Strip the wire's end. If needed, shorten the tilt switch pins. Solder the stripped wires to each tilt switch pin, slip the tubing over pin, solder, & bare wire & heat shrink the tubing.
Fasten the tilt switch to one side of the mail box flag so when the flag is up, the switch is vertical. Fasten the switch so neither it nor its wires rub or bump much. (See the diagram in this post above.)
Next, Final Thoughts on Installing the Node
|
|