Wanted: ST Arduino Shield

I know this may not be appropriate, but I am desperately searching for a ST shield for arduino. Does anyone know where to get one or have one they want to sell?

Please let support know:

1 Like

Oh absolutely. I saw the post in another thread and have already asked. I even reached out to the electronics store with da fruit in the name. They directed me to their data logger shield. I am going to give that a try and see if it is the same thing or provides the same functionality. My concern is pairing with ST. Until ST decides to resell this item, we are forced to look for alternatives or the second hand market.

1 Like

I recommend giving ESP8266/NodeMCU with Arduino a try, this thread has working example of DH and Arduino code

NodeMCU boards are $8 on Amazon (this is a small board with micro-usb power and programming). Only drawbacks are (1) ESP only has one A2D/analog input, you could add another chip for that if needed. (2) low power, I donā€™t know if ESP will work well using a battery. There are articles/blog posts on the net for how to minimize power usage turning off WiFi though. (3) Iā€™m sure there are others depending on what you want to do.

There is also a D1 mini NodeMCU $7 that has stackable addon boards similar to shields.

I would really like to grab the ST shield because otherwise I would be using a bunch of the Node boards and the cost would get too much I fear. On a different note, how many analog inputs did the shield support with an Arduino mega?

I wanted to pass along a little bit of information I learned in case it saves you some time. I had the idea of using the ST shield to take over my existing alarm sensors. I learned quickly that ST doesnā€™t really have the ability to detect multiple sensors behind a single device. For example, normally you would have one ā€˜thingā€™ and it would have one primary capability, such as a door/window sensor would have one contact sensor. In the case of my situation, I wanted the ST shield (or my Raspberry Pi in my situation) to have multiple contact sensors and each one would be represented as a ā€˜thingā€™ in the system for monitoring purposes. After some research, it appears that this isnā€™t possible with the way that ST is currently setup. You can have the Pi or whatever device show each status but it wonā€™t be represented as individual sensors to other parts of ST (such as the Alarm portion). I ran across a forum post where some people used virtual devices and ā€˜subscribedā€™ to the main receiving deviceā€¦ but I couldnā€™t get it to work very well.

If anyone has any suggestions on how to make that work, Iā€™d love to hear it. The appeal of the ZigBee radio on the ST shield is awesomeā€¦ but the lack of multiple sensors behind the device halted my project unfortunately.

Edit: wording, details

I have found same thing, multiple sensors of same type are not easy to handle. However you can easily add many different sensors (contact,temp, humidity, motion,etc) so long as just one of each (with Arduino/esp8266 at least, donā€™t know about ZigBee shield)

To have multiple sensors of the same type requires you to use a different endpoint for each within zigbee home automation profile. I am not sure how this can be done on the arduino things shield. Hopefully when I get my finger out and sort this replacement solution for the thing shield I will be able to help further.

Well, I had planned to use this excellent tutorial: http://kendrickcoleman.com/index.php/Tech-Blog/total-noob-guide-to-move-your-old-wired-security-system-to-smartthings.html

He is splitting the zigbee response and breaking it down into parts thus creating the multiple endpoints. He is able to register as many devices as you have inputs on one ThingShield.

This is why I am dying to get my hands on a ThingShield. I am willing to pay double or even triple the original cost for one.

Edit: Heck, at this point, name your price and I will listen.

That definitely looks like a promising solution. Bookmarking for future referenceā€¦

I know, right?! So if anyone wants to get rid of their ThingShield, hit me up. I have cash in hand. :smile:

Here is my new version of the ST_Anything and SmartThings Arduino libraries, with added support for Ethernet/WiFi connectivity - no ThingShield required! Hope this helps!

1 Like

This might be a viable solution to my expensive contact sensor problem :wink: Time to dig out the ESP-01s againā€¦

1 Like

FYI - All of my testing was done with a NodeMCU ESP8266-12E board. Not sure about the ESP-01ā€¦???

The ESP-01 is one of the original variations of the ESP platform. The 12E is a custom board with some additional helper parts and an ESP soldered on board (I canā€™t remember which oneā€¦ 06/07 or 08). Any of the ESPs will work as long as they have at least 1Mbit or more flashā€¦ some may be more challenging to program than others. The 12E comes in 512Kbit, 1Mbit and 4Mbit flavors depending on where you buy it from.

esp8266.com has a comparison chart with the different versions.

2 Likes

Kelly,

Question for youā€¦ Were you hoping to use the ESP-01 as a WiFi board attached to an Arduino? Or as a completely standalone controller?

I am using a NodeMCU v1.0 board which has an ESP8266-12E on it. This has significantly more I/O that an ESP-01.

Just curiousā€¦ :slight_smile:

Dan

Dan,

For the 12e, am I correct that it can only monitor up to 6 sensors then you add another board? Would I be able to use 8 boards to monitor everything with ST_Anything?

No problemā€¦ let me go back a little bit and explain how Iā€™ve integrated them with ST before. I had two devices that I wanted to integrate into ST ā€“ a water sensor in my water closet (I have a pressure tank, water heater, etc in a closet) and my existing hard-wired alarm system. Not so much the alarm, just the contact sensors.

To preface, I do realize there are sensors for the water closet but I was cheap at the time and it worked for the time I needed it. I later switched it out to a Z-wave sensor. Initially I was going to modify contact sensors for the alarm system but realized quickly to get 14 zones was going to be very expensive. At the present, I only have one Z-wave contact sensor in place.

So to make all of this work I had to setup an MQTT broker on a linux box that served as the communication bridge between my devices and ST. This broker would accept messages from the ESP devices and then relay it to ST and vice-versa. ST would have the broker registered as a device and communicate with it locally on the network.

I started out with the water closet sensor. This was intended to be a simple, single I/O headless device. To accomplish this I used an ESP-01 with 512Kbit of flash. I removed the NodeMCU firmware and flashed the Arduino firmware to it. It was fairly simple code that ran a simple web server (for debugging and stats) and an MQTT client that pointed to the broker over WiFi. When the sensor contact was closed, it would send a ā€˜1ā€™ to the MQTT broker at a specific address, ā€˜0ā€™ if it was open (default state). The sensor was connected to one of the I/O input pins across a modified soil moisture sensor. I ground down the bottom ā€˜pointsā€™ of the sensor so it met the concrete flat and would detect a small puddle about 3/4" in width. This was all put into a small project case and mounted on the wall with a power LED and a wall wart for power. Because of the small amount of flash on the ESP-01, OTA programming was not available so I had a few jumpers to put it into programming mode for reflashing.

The alarm system was originally a DSC 8-zone system that I completely tore out. I rewired the zones to create 14 zones for additional detail (splitting windows vs doors, for instance) in each room. Three ESP-12E boards with 4Mbit each were used with each having its own set of code based on the inputs/outputs of that particular board. The software was similar to the water sensor in that each was reflashed with Arduino and ran a web server, MQTT client and WiFi client. Because of the additional flash, these boards allowed OTA programming directly from the Arduino software which was great when updating code. One of the boards had an output programmed and would listen for MQTT messages for an external powered siren I have in the attic. When triggered, it would turn on the output which would trip a relay board and 12v would be applied to the siren. This was a bit finicky because of how the 12E handled its outputs during reboots and needed some massaging to work smoothly. The whole unit was powered by a 12V supply and then a 3.3v/5v regulator board was used to power the ESPs and relay board. Each alarm contact was tied to one of the I/O pins on one of the three boards and mapped to ST accordingly through MQTT.

All in all the system worked alright for the most part. Some logic was put in place to reboot the ESPs when WiFi was lost or the MQTT broker disconnected. Additional logic was put in place for debouncing, ST errors and stale sensors but ultimately it was never really a clean solution. One of the biggest problems is that the ESP is a single-threaded finicky beast. For instance, if youā€™re running a lightweight HTTP server on it and make a request, it will pause the entire CPU while it produces the output for the connection. Fine for monitoring a plant or watering your hermit crab tank but not good when you need near real-time sensor monitoring.

Now that Iā€™ve mentioned where Iā€™ve beenā€¦ with your info, here is where Iā€™d like to goā€¦

Through the first setup I learned that combining all of the contact sensors on two or three boards was a bad idea. These little boards just work better when given a single task. The water closet sensor was this way and quite frankly, I never had to touch it. While it will take additional IPs on the network, Iā€™m going to use ESP-01s because a) theyā€™re cheap at $1-2 each and b) they work great for single sensor usage and put one on each contact sensor. This will result in 14 ESP-01s in the closet and that should cover all of the zone inputs. While this seems like a lot of sensors, it should get around STā€™s lack of one-to-many sensor support as well. The siren output is being covered by existing Z-wave sirens that are now installed.

Some of this is still tumbling around in my head until I get things out and play around againā€¦ but hopefully it clears up some of my madness :slight_smile:

1 Like

Kelly,

Great information! Thank you for taking the time to share. I am very interested to hear if my new ā€œSmartThings v2.xā€ library will run on the ESP-01 boards. Keep me up dated on your progress. I like the tiny form factor of the ESP-01s, and the ā€œsingle purposeā€ idea as it definitely helps with the one-to-many ST limitation. My ā€œMultiplexerā€ SmartApps and Virtual Devices also resolve the one-to-many issue.

I will say that I am very impressed with the ESP8266-12E as well. So far, so good. I am contemplating replacing my current UNO R3/ThingShield which monitors 6 doors reed switches, 1 DHT22 for Temp/Humid, and controls 2-relays (garage doors) with a single ESP8266-12E board. It appears to have enough I/O to handle everything. I may even add a photoresitor for luminence using the single Analog Input channel on it. For about $10, thatā€™s quite a powerful little package!

My ā€œST_Anything v2.xā€ library (which uses my ā€œSmartThings v2.xā€ library) handles all of the pin monitoring/updates and bi-directional communications for you. For some, this removes too much control, as they want to code their own solution. For others, it provides a robust and quick way to get started. Both libraries are written C++ with the goal of being added to to support additional sensors (ST_Anything) and communications methods (SmartThings). Again, the ā€œSmartThingsā€ can be used as a standalone package. I have included example sketches for this purpose (in the examples folder of the Arduino library) as well as the corresponding groovy Device Handler code in the extras folder. The ReadMe for ā€œSmartThings v2.xā€ explains how to use this library independent of the ST_Anything library.

Have fun!

Dan

1 Like

@munsterlander

It is my understanding that the NodeMCU v1.0 ESP8266-12E boards have 11 usable Digital I/O pins, as well as 1 Analog Input pin (not sure if it can be used as a digital input pin or not.) I have not personally tried to use each of these pins as I just got this working over the past few days. I have used D0, D1, D3, D4 and A0 during my testing without any issues.

Here are the #define statements I include in my ESP8266 sketches to make it easy to refer to the pins on the NodeMCU board based on the printed text of the baord.

#define D0 16
#define D1  5
#define D2  4
#define D3  0
#define D4  2
#define D5 14
#define D6 12
#define D7 13
#define D8 15
#define D9  3
#define D10 1

And here is the image of the NodeMCU v1.0 ESP8266 board I am using (~$10 on Amazon.)