emonTH code for Jeenode micro

I threw together a version of the emonTH code that works with the Jeenode micro. I know others have used attiny84s to send to emon, but hadn't seen a version of the full emonTH code so thought I'd post it. Here are the highlights

- Added JCWs vcc read code for battery monitoring
- RFM sleep uses mode 3
- Misc. changes for JNu compatibility (pin numbers, turn on RFM module, etc.)
- Only DS18B20 enabled for attiny84 chips (DHT22 draws too much power for coin cell operation)
- Put DS18B20 power pin in INPUT mode during sleep (idea from Martin Harizanov's code for this on atmega)
- compile directives allow use of same code for both attiny84 and atmega328 chips (not actually tested w/atmega yet)

I used the standard JeeLib instead of RFu_JeeLib, which is a variation from the direction OEM has headed. However, I had to revert to a version from a few months back. When I tried to use the current JeeLib code, I got errors in the RF69 related code.

I'm running this on a JNu powered by a CR2032 coin cell. Hopefully the run time will be at least as good as what Martin got with a similar project with his Funky board.

In any case, the code is at https://github.com/pmscientist/energymonitor

glyn.hudson's picture

Re: emonTH code for Jeenode micro

Great work! Thanks a lot for posting. He jeenode micro is a tiny bit of hardware. We're a big fan of jcw and jeelabs. We have been made aware of the recent issue with the new version of jeelib, I've updated our examples to be compatible a couple of days ago 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.