My friend & I will be basing our submission for Lake Macquarie city council’s ‘Smart Liveable Neighbourhoods Challenge’ on this tutorial. We want to extend this tutorial as follows:
Attach a decibel detecting sensor to the node (a microphone).
Push decibel readings from the sensor to TTN
Attach a battery to the node
Configure the node to regularly (atm, unknown period between wake ups) wake up, report the decibel reading to TTN & then go to sleep.
Take TTN data and convert it into JSON
Create a simple website that displays the JSON in a table/graph (live view)
~~~~~~~~~ pending time extra items ~~~~~~~~~~~
Create an alert/notification that will send an email if the decibel data exceeds a threshold
Adapt the table/graph to set a time frame or window, by which you want to observe data. (historic view)
Add multiple nodes/sensors to TTN & read data from multiple nodes.
Display data from multiple sensors on the table/graph.
Aggregate or average the reading from multiple datasets into a general dataset
My friend and I are familiar with web development, but the hardware is not our strength. As such we would love any assistance regarding:
Q: What microphone (decibel reading device) should we use?
Q: What battery should we use?
Q: How should we consider battery consumption VS regular wake periods? (assuming, something about watts per hour?)
Q: What weather proof case should we use?
Obviously because we’re asking for collaborative assistance & we’re basing our node/sensor on a tutorial; we would like to continue this moving forward and express/disclose how we converted our TTN data to JSON & any other new steps. Perhaps we can also talk about how we pulled that JSON into a web app etc. Simply, we would like to continue the love and share our development in the form of tutorials as well. But that said…
Q: Would it be better if we simply provided our working, yet someone for core electronics (Chris) released the final edit of the tutorial? That would maintain continuity between the existing tutorial & this extension(s) of that tutorial. How do we also approach the disclosure of our solution?
If you are using Pycom LoPy, then the Pycom LoRa Antenna Kit you have linked is very well suited for that project.
Given the moving parts, I’d lean to Adafruit Electret Microphone Amplifier. You could do this yourself with a microphone and some other parts, though the module is ready-to-use and provides an analogue output that represents amplitude. Converting that to dB could be done with some quick side-by-side calibration tests with a decent Sound Level Meter (which are commonly used for measuring sound).
If you are using the Pycom Expansion Board for programming your LoPy, then you could use any of the single cell LiPo’s. You could take two approaches; measure the power draw and calculate what you need. Or, just grab something that has lots of head room (2000mAh would be plenty for evaluation) and fine tune it afterwards with some observation tests.
In deepsleep, LoPy4 uses around ~5 to ~15uA. That’s over 100,000 hours on a 2000mAh battery in perfect conditions. With that said, upon awake it will use energy as needed, although not much. You could perhaps use a MOSFET to isolate power to external modules/hardware during deepsleep mode (it can behave like a switch for the ground circuit).
Any IP67 case would be fine. IP68 would be overkill! Altronics have a good range of cases; I personally would 3D Print and acetone bath to close off microholes. Between that and a rubber seal, it’d be good enough for some weather
Perhaps even better would be to share the build in our community project section. That’s where finished builds end up, and they are easy to edit/maintain in the future.
There are a lot of moving parts to this project, though that’s half the fun. My advice would be start small; connect to the TTN, celebrate that win. Build upon and let the features roll in, one by one.
Hi Andrew,
How did you go with this project, is it published? I’ve got a similar project in mind - sound pressure nodes. I’m not getting far with getting off the ground. Still can’t get my Lopy4 to connect to TTN. I’m not a code person, so a bit behind on the learning curve. but I’d be really interested to lean how it works for you?
My friend Alistair and I had a lot of fun with this project.
I’ve been meaning to convert our notes into a community project and it seems as though your message has triggered my guilt mechanic. As such I suppose I’m finally motivated enough to get it done.
The main take aways I got was:
It’s moderately easy to build a sensor, get that data onto TTN, get that data out of TTN using Node Red & get that data out of Node Red in a JSON structure.
It’s very difficult to built a highly accurate sound level sensor. Turns out sound engineering is kind of a big deal.
The future I have my project is to make the sensor device more modular. So I can more simply connect microphones via an aux connector. This would mean that I could more simply connect omni-direction mics or directional mics to the sensor.
Give me a few hours & I should be able to share a link to the project.
puts headphones on & waves good bye to going to sleep before midnight
Disregard that, turns out the submission process means that the Core Electronics team will make it live. I’ll clean up my notes so that it’s in a more accessible format.
These tutorials currently walk you through connecting a Lopy4 to TTN, decoding payloads, forwarding your data and sending downlinks. We have more on the horizon too! There is a complete example code that you can use to get connected in no time!
Hi Stephen,
I’ve been following this tut (https://core-electronics.com.au/tutorials/getting-started-on-the-things-network-tutorial.html) … you pointed me towards. My local gateway is at Brokers nose - “UoW - Meshed - Brokers Nose, Placement: outdoor, Brand: MultiTech, Model: Conduit AEP, Antenna model: unknown” I’m assuming it runs AU915 - which I’ve changed in the code.
If you have your Device ID, and App Key etc entered into the code, you should be connecting. If you cannot connect then the first thing I would expect is that you don’t have coverage at your location.
LoRa coverage is essentially line of sight. The map may seem to indicate that you have coverage but the coverage may be unreachable high overhead.
Thanks Stephen,
I’m in sight, but it’s quite some distance and high up on the escarpment (approx 600m AMSL). I’ll go for a drive try and connect closer as you suggest.
My notes are complete & the guys at Core are checking them out. A post could become available pretty soon
Regarding AS915 vs AS923 it is a bit of a thing. My gateway that I’m running up in Metford (Maitland Area, near Newcastle/Lake Macquarie) is AS923. But there’s a lot of other TTN communities around Australia that are sticking to AS915. (*edit - Or there was talk of them sticking to AS915, perhaps they’re migrating over to AS923)
Hi Andrew,
Excellent, your right - AS923 it is! Reset everything from scratch and now successfully sending packets to TTN. Now onto the next stage. I look forward to looking at your project notes.