Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first draft of emonTH gas analogue monitoring sketch. #2

Merged
merged 1 commit into from Jan 21, 2014
Merged

Add first draft of emonTH gas analogue monitoring sketch. #2

merged 1 commit into from Jan 21, 2014

Conversation

Dave-McCraw
Copy link
Contributor

Hi Glyn,

See attached for analogue pulse sketch using emonTH. I've just updated it to use ACKs and retries to be a little more robust, and roll the pulse counter on to the next monitoring 'session' if all the retries fail. This should significantly reduce pulse loss to network issues, although in fairness I've not tested the RFM12b ack/retry code (it works OK first time :-)

@glynhudson
Copy link
Member

Great, thanks Dave. Looking forward to testing this. How easily do you think it could be adapted to work with an optical sensor for optical pulse counting e.g TSL257 http://shop.openenergymonitor.com/tsl257-optical-pulse-sensing-kit/ ?

glynhudson added a commit that referenced this pull request Jan 21, 2014
Add first draft of emonTH gas analogue monitoring sketch.
@glynhudson glynhudson merged commit dd93ee9 into openenergymonitor:master Jan 21, 2014
@glynhudson
Copy link
Member

Actually I think for optical pulse counting using an interrupt method would be best to ensure no pulses was missed: https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTxV2/emonTx_Pulse/emonTx_Pulse.ino

The emonTH could go to sleep in-between readings (waking up on interrupt) if counting time was done on the base station at a slight loss of accuracy.

@Dave-McCraw
Copy link
Contributor Author

Hi Glyn,

Interrupt is clearly the best way for inputs that can be captured
digitally, just look at how much simpler your sketch is than mine!
Unfortunately battery power for my node seems too low to get FALLING (or
anything else) triggered - it only worked on my desk via USB power - is
this because the pull-up was hitting the full 5V instead of half that?

Incidentally, I'm having some trouble with the sketch, which I think
might just be low batteries, although it's reporting 2.8V: I'd be
interested in any thoughts you have on
http://openenergymonitor.org/emon/node/3689 ?

I'd be happy to come up with a sketch combining the emonTH firmware
power saving features with interrupt pulse counting. I've been
considering running my gas EmonTH (EmonGas?) with 3AA (or even 6AA with
3-series 2-parallel) to boost the IR to the point where I can get a
digital pin to work. If so that sketch would be the next natural step.

cheers,

Dave

On 2014-01-21 09:52, Glyn Hudson wrote:

Actually I think for optical pulse counting using an interrupt method would be best to ensure no pulses was missed: https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTxV2/emonTx_Pulse/emonTx_Pulse.ino [1]

The emonTH could go to sleep in-between readings (waking up on interrupt) if counting time was done on the base station at a slight loss of accuracy.

Reply to this email directly or view it on GitHub [2].

Links:

[1]
https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTxV2/emonTx_Pulse/emonTx_Pulse.ino
[2]
#2 (comment)

@Dave-McCraw
Copy link
Contributor Author

I realised after posting the above that the emonTH circuitry is boosting to 3.3V and so I can't up-rate it with extra batteries (and although I could put some more in parallel, it's still reading a healthy level).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants