Forum Replies Created
-
AuthorPosts
-
Hi Sara.
Nice to hear someone else using Modbus/RS485. Thanks for sharing the library.
The realtime serial processing is a challange and I have got it working on different systems. The first sign to look for is whether its supported in chips UART through DTR.
One issue with the automatic flow control is that it uses a couple of mA to maintain the line state.
I hope to share more as a I get some results.
NeilThanks for the link – I think I hadn’t figure out the right registers addresses to read, so very useful.
I’m assuming your include <ModbusMaster.h> pulls https://github.com/4-20ma/ModbusMasterThe direction I’m heading in is with the BeagleBone Green Wireless and generating Modbus 12V off 5V. Will post more when I have it tested.
Hi Calvin
Nice to see the pic of the 3G logger.
I was wondering if you got the link to the LT400 working.
I’ve been attempting to access the LT500 but not had any success decoding the LT500 protocol that runs on top of the modbus/RS485.
I have had packets as per the “Insitu Modbus_Communication_Protocol_5.10.pdf” but seems there is some initialization sequence that is needed before reading the sensors. I wonder how far you got with it.
I have got Keller Nano Level device that is very accurate in low water (capactive sensors) and water temperature change polling.
My hardware arrangement is prototype with a RS485 plugin using an Olimex STM32-H407 running off a 12V source. Pic enclosed. This is of the sensor in stable jar of water so the water depth isn’t varying except for evaporation. The sensor depth reading variation is from temperature variation.BTW – I would think that with the mayfly interfacing to an RS485 chip (sparkfun has them) – the 12V would be well isolated. But as Shannon said, the 12V will fry 3V mayfly logic should they ever meet.
One of the issues with any electronics is they often take a surge on power up. For 12V sensors this may be a problem with a boost circuit, switched the way it is on the Mayfly. Powering is always tradeoffs and it may take some characterization. https://github.com/EnviroDIY/EnviroDIY_Mayfly_Logger/issues/1Attachments:
Hi Sedhead, thanks for sharing. I’m just heading out the door for a weekend camping, and so a quick comment.
I’m not affiliated at all with the EnviroDiy – but I wonder if you’ve looked at the Mayfly. The benefit is that there is just the type of experience on this board for that device and software. I would think the key software you want to verify is the ability to store data on a SD card with accurate time. The SD card file system can be a challenge if not verified.
A place to start with a field deployable project, how do you plan on environmentally protecting it, powering it (solar, replaceable batteries), and then testing and updating it in the field?
Also you may want to discuss the depth range you want to measure. Unfortunately pressure sensors/depth readings can be temperature dependent – so from a teaching point of view its a good idea to teach measurement traceability. For using two absolute pressure sensors, Onset Hobo propose this scenario, but it doubles the error. A colleague who has used the approach has found burying the atmospheric reference sensor keeps it in a stable temperature environment.
PublicLabs has also done a discussion on some aspects of water measuring. They have a riffle device that may be worth looking at.https://publiclab.org/wiki/openhour-archive March 6
Back after camping.
regards
Neil2017-03-24 at 4:34 PM in reply to: Custom Arduino-based sensor, off-the-shelf SDI-12 datalogger #2110Wow fantastic to see the https://github.com/EnviroDIY/ModularSensors, and the https://github.com/EnviroDIY/Libraries.
So to query any piece of equipment over a protocol, there are two parts – the physical layer and the data link layer protocol.
https://en.wikipedia.org/wiki/OSI_model
For the nanolevel it specifies physical layer as RS485 (for other equipment it may be the customer SDI-12)
For Keller products the modbus binary “data link layer” there is a document “Keller comm_protocol_series 30 V3.4 2015Oct.pdf”
http://www.kelleramerica.com/manuals-and-software/manuals/series30%20comm_protocol_e.pdf
Every manufacturer that is claiming an open interface, or expects their equipment to network, should supply a description of their implementation of a protocol.
The modbus protocol concept is fairly simple one. IMHO the modbus language is fairly archaic and easier to think of it as a query /response protocol than to try and use the older language associated with register read/writes.
The manufacturers manual is the starting point for understanding what is needed to get data from the device, and there is no such thing as a standardization process for modbusm
<DevAddr> <FunctionCode> <n byte payload …> <KellerCrc16_H> <KellerCrc16_L>
For Keller a significant difference is that they switch the CRC-16 bytes around from standard modbus !!!
I process this with two functions
rs485crc16add(..) rs485crc16chk(..)
were CRC16calc() does all the magic work with a standard CRCTable
See
https://bitbucket.org/neilh20/nuttapps/src/5315c5ee8f8fcdb7d5dd69989b499194fc30a034/examples/ae/aelog/ae_mdm_phy.c?at=work_ensy1b&fileviewer=file-view-defaultNow the controlling requestor “master” tx
and the device “slave” responds (looks pretty similar – but the payload is the significant part.
For the first time testing of the protocol, the objective is just to ensure the mechanics are good.
Out 01 03 00 04 00 01 C5 CB – Read Address 4, 1 registers – which is read level
Resp 1 3 2 0 0 B8 44 – Std Crc – result is 0
(or use some of the examples in the manual, though its a bit confusing they don’t all apply to every instrument)Another example – read register 6 (temperature), 2words and interpret the two words as floating point IEEE754
Send 01 03 00 06 00 02 24 0A
Rx 01 03 04 41 88 7B 50 4C E9
Payload: 41 88 C9 48
h-schmidt.net/FloatConverter/IEEE754.html says 17.0 (and the units are C)A Saelig Logic Analyzer trace of this is
I received my dual relay board,
* AtomicMarket.com: 5V Two 2 Channel Relay Module With optocoupler
* SunFounder: 2 Channel DC 5V Relay Module with Optocoupler Low Level Trigger Expansion Board
and the code to drive the relays is pretty simple and is here:
https://bitbucket.org/neilh20/anuttx/commits/daf3e4199ec66c158a3ef20e0da64ec0bcb9f7dbThe purpose is to be able to switch +12V to a Nanolevel capacitance depth gauge and read it over RS485. I’ve been running some tests with the Nanolevel querying it over RS485, and the results have been pretty stable as temperature has varied. However in the solar powered, minimal power useage, the Nanolevel needs to be off most of the time, power switched to it when its going to be used, a pause to allow it to stabilize, and then read it over RS485.
Hi Marion,
I don’t have any experience, and it would be great if you share what you find here.This is a topic the EPA is sponsoring – with a target of unattended for 3 months –
http://www.act-us.info/nutrients-challenge/And they have a short list
http://www.act-us.info/nutrients-challenge/Participants.php
regardsWell my first post on this is to talk about the powering – not as sexy as the protocol, but a base requirement.
Since this is wired, each transducer is going to require power.
Getting powering right is ALWAYS a challenge for a circuit, especially solar powered, low power useage circuits. Its vital to understand the impedance of the power issues.
Wall power supplies are constant impedance and relatively low impedance sources – they can supply say 1 to 2Amps no problem.
Solar panels are variable impedance and relatively high impedance power sources – when its dark there is no power, when the sun is shining it has some power. Batteries and capacitors manage the impedance profile change between a solar panel and the dynamic power used.
In an experiment with a low cost Utopia ULB-I depth gauge – which requires 8-36VDC I recently hit some of the power issues.
It is an example of transducer, and the specification is missing one critical parameter, power used, and inrush current when power is applied.
For a standard wall connected power supply this isn’t a problem.
However I want to take samples every 15minutes and I want it to be off most of the time – so I need an electronic switch in there.
I started by experimenting with a simple boost circuit, and its tripped me up.
The core experiment was taking a “SUNKEE LM2577 DC-DC” I found on amazon – a 5V to 12V boost max@2.5A board (inputrange 4-34,output4-35V), and tying the input to USB +5V switch circuit on the Olimex-H407 board, and the output to the transducer power supply. The Olimex-H407 5V switcher device MP1482DS seemed to be pretty hefty at somewhere around 2A.
I soldered wires to the SUNKEE LM2577 to the H407 USB +5V, and soldered wires to an RJ11 male, and RJ11 female lead to the transducers power/data.
I put a volt meter on the output of the SUNKEE LM2577 adjusted the output to +12V, and left the meter monitoring its voltaage
The power supply supplying H407 was slightly above the minimium of +7V, initially taking about 40mAThen plugged the transducers RJ11s together.
It failed to work!.
As I poked around with a scope I was seeing some of the issues with power supply impedance.
On plugging in the +12V dropped to +7V, and then USB +5V dropped to +3V.I repeated, and monitored the wall supply which kept constant voltage but jumped from 40mA to about 160mA, however it fleeting showed +250mA.
Looking at the switching waveforms on the MP1482DS it wasn’t coping for some reason, so the output was dropping to +3V, which was probably causing the output SUNKEE to droop to +7V – but taking a lot of current in the process.It seems like the MP1482/inductor should have been able to supply at least 1A, but it wasn’t.
I modified the powering, connecting the SUNKEE directly to +5V wall supply, with a current meter.
Hey presto it worked. Watching the +5V wall powersupply, it showed +650mA pulse on plugging in.
While I don’t believe the powersupply’s has a reliable max pulse indication, I did guess that the +5V circuit source is a lower impedance- and so as this was a quick and dirty experiment. It took me less time to do it, than write it up here.
So back to the drawing board.
Generally, in the past for this type of boost powering, what I do is turn on the boost, allow it to power up and fill its output capacitor sufficiently, and then have an electronic switch that switches the steady boosted power directly into the transducer.
If I have an inrush current problem – generally a seat of the pants estimation – I can boost the output capacitor until I solve the problem.
So in this case, I’ve gone back to amazon to order “SunFounder 2 Channel DC 5V Relay Module” – something that I hope I can make work with 3.3V H407 outputs, and switch the +12Vs.For circuit designs I can use lower cost boosters and +12V MOSFET switcher.
Great. If you want cct comments I’d be happy to participate. I’ve used LM2623 +5V/1A, and also can do +12V
-
AuthorPosts