The TinyTX is my Open Source wireless IoT sensor node, designed to be compatible with OpenEnergyMonitor, Nanodes and Jeenodes. It uses the Atmel ATtiny84 microprocessor and a HopeRF RFM12B transceiver module and is coded using the Arduino IDE with the arduino-tiny core.
Initially devised with the DS18B20 digital temperature sensor in mind it can also easily be used with a dual temperature/humidity sensor such as the DHT22 or an analogue temperature sensor such as the TMP36 or many other kinds of sensors, some examples are included below.
To power it I use two AA or AAA batteries, a 3v coin cell can also be used but as they don’t have a lot of capacity I don’t think they really make a lot of sense unless size really is that critical. Another option would be to use a LiPo battery.
The maximum voltage is 3.8v and minimum for the RFM12B to work is around 2.2v although the operational minimum for a complete sensor will depend on the characteristics of the actual sensing device used, for example a DS18B20 worked down to around 2.3v in my real word tests (data sheet value 3v) but the DHT22 only worked down to 2.96v (data sheet value 3v).
New: TinyTX3 is here, that’s the red one on the right, it now has 6 available I/O and prototyping holes. I will update this page with more details soon.
Possible uses
- Temperature Sensor using a DS18B20 digital sensor and a 4K7 resistor (blog post, code)
- Temperature/Humidity Sensor using a DHT22 and a 10K resistor (blog post, code)
- Temperature Sensor using a TMP36 analogue sensor, fit the sensor in the reverse orientation compared to DS18B20 and don’t fit a resistor (blog post, code)
- Flood/water leak sensor using a 100K resistor and wire probes, also code to use a TinyTX as a receiver (tx code, rx code)
- Light sensor using an LDR (Light Dependant resistor) and a 10K resistor (code)
- Electricity consumption meter using an LDR and a 4K7 resistor (blog comment by Troels, code)
- Reed switch for door/window monitoring with pin change interrupt to wake from sleep (code)
- Hall effect sensor (magnetic field detector) using an A3214EUA-T or A3213EUA-T to monitor gas usage (code)
- Rain gauge using a tipping bucket rain gauge (code)
- BMP085 air pressure/temperature sensor (code)
- Or many other digital or analogue inputs or switch contacts.
I’ve also included code for receiving the transmitted data on a NanodeRF and relaying it to emoncms or Cosm (see bottom of page).
Some examples:
Open Source Hardware
The hardware design and software are completely open source, you can get the schematic, Eagle design files and Gerbers from the links at the bottom of the page or from SolderPad and the latest code is always available on GitHub here, you can also find a layout for the stripboard version of the TinyTx here.
It is all licenced under a Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) licence, see the link for the full details but basically you can copy or adapt it for your own use as long as you credit me and share the results under the same kind of licence. It’s not necessary but if you do use it, it would be nice to hear from you in the comments or by email, it’s always interesting to hear what others are doing with this stuff and sharing ideas is one of the key benefits that open source can bring.
Thanks must go to to JeeLabs, OpenEnergyMonitor and Nanode (in no particular order) for inspiration and for opening their designs as well as all the people who have commented in my blog posts on the development of the TinyTX and its predecessors. I’m pleased to see that my work has in turn inspired others such as Martin with his great TinySensor and Phil’s Multi purpose ATtiny84 PCB, this is what Open Source Hardware is all about.
Components, what to buy and where
I usually buy my ATtiny chips from RS Components, I use the picoPower version, the ATtiny84A-PU which works down to 1.8v but the older ATtiny84V-10PU would work just as well, both will be slightly out of spec at 8MHz once the voltage drops below 2.4v but this seems ok in practice, a DS18B20 starts dropping out below that anyway and the RFM12B will give up below 2.2v so we’ll never get too far from spec. Don’t get the ATtiny84-20PU as that only works down to 2.7v at 10MHz.
You can also get the RFM12B from RS Components but SK Pang can be a little cheaper if you are only ordering a few, most recently I have been getting them from JeeLabs who do a pack of 6 for €29.50 (433MHz and 868MHz). The RFM12B is available in three frequencies but bear in mind that some of them can only legally be used in certain countries. The antenna will need to be sized for the board you choose and you will also need to change the #define freq line in the code if using something other than the 433MHz that I’m using.
| Frequency | Can be used in | 1/4 Wave Antenna Length |
|---|---|---|
| 433MHz | Worldwide | 165mm |
| 868MHz | Europe | 82mm |
| 915MHz | USA & Australia | 78mm |
I chose 433MHz back when I first started playing with the OpenEnergyMonitor stuff as I wanted to retain compatibility with what they were using, I’ve heard anecdotal evidence that 433MHz passes through walls better but I don’t have any real evidence to back that up and it is a busy frequency so one of the others may be a better choice, you’ll have to make that decision yourself.
For DS18B20 and DHT22 sensors the cheapest I have found by far is eBay. Don’t be tempted by the cheaper DHT11 sensor, the humidity accuracy is poor, it will only return integer values and only covers 0-50°C compared to -40 to 125°C for the DHT22.
If you want to get PCBs made up I can recommend the Chinese site SeeedStudio, for 10 boards in green (other colours are more expensive) it costs 9.90 USD + shipping which worked out at £9.01 including UK delivery (90p each) and it will only take a couple of weeks. They don’t take Eagle files directly but Eagle can export the Gerber files that they need and they have an Eagle design rules file that makes it easy to check that your board fits with what they are capable of producing and a job file for the Gerber export to make sure everything is setup correctly for them. It’s still worth double checking the resulting Gerber files in a viewer such as Gerbv to make sure everything has come out as intended, I found that some of the silkscreen text that looked fine in Eagle had overflowed the board in the Gerber files. If you don’t want to get 10 boards made up you could always build the stripboard version or the guys at Circuits.io were also kind enough to import the Eagle files into their site for me so you can order boards in a pack of 3 from them for $14.67 plus $5 for international shipping. Unfortunately they don’t support adding text to the silkscreen so you will lose all the labelling with their boards. I’m not selling any boards myself at the moment but might have something in the pipeline soon.
Software prerequisites
You will need the Arduino IDE of course and to use it with the ATtiny84 also requires installing the arduino-tiny core. To install arduino-tiny you just need to create a directory under your Arduino sketchbook directory called hardware and unzip the latest arduino-tiny from here into it. Now restart the Arduino IDE and you should see the new ATtiny entries under the Tools > Board menu.
You will also need to put the necessary libraries in your Arduino libraries directory, for each variation (eg. DS18B20, DHT22 etc.) I have linked to the required libraries in the comments next to the includes near the top. All variations will require the JeeLib library for driving the RFM12B.
If using the DS18B20 you will need to make a small change to the OneWire library to enable it to work with the ATtiny84, just open OneWire.h and below the line:
#include “Arduino.h” // for delayMicroseconds, digitalPinToBitMask, etc
add:
#include “pins_arduino.h” // for digitalPinToBitMask, etc
Getting the code onto the ATtiny84
To get the code onto the ATtiny we need to use ICSP (In Circuit Serial Programming), you can use an ICSP programmer if you have one, otherwise a spare Arduino will do. I made up the little Arduino shield on the right using a scrap of stripboard and a ZIF socket to make it easier.
To use an Arduino as an ICSP programmer you need to load the ArduinoISP sketch on the Arduino and connect the SPI pins and reset between it and the ATtiny. A version of the ArduinoISP sketch is included in the examples directory with the Arduino IDE but it seems to be broken, if it doesn’t work download this one instead and load it onto the Arduino in the normal manner.
To wire it up on breadboard connect the Arduino to your ATtiny as follows:
| Arduino | ATtiny84 |
|---|---|
| D13 | Pin 9 |
| D12 | Pin 8 |
| D11 | Pin 7 |
| D10 | Pin 4 |
| 3.3/5V | Pin 1 |
| GND | Pin 14 |
| Programmer | ATtiny84 |
|---|---|
| SCK | Pin 9 |
| MISO | Pin 8 |
| MOSI | Pin 7 |
| RESET | Pin 4 |
| 3.3/5V | Pin 1 |
| GND | Pin 14 |
I’ve been using a cheap USB ASP programmer with an IC test clip which allows programming without removing the chip which also means that the chip can be soldered directly to the board without the need for an IC socket.
Once you’ve got the programmer sorted the first thing to do is set the ATtiny’s internal oscillator to 8MHz, to do this you need to go to Tools > board and select “ATtiny84 @ 8MHz (internal oscillator;BOD disabled)” and then use Tools > Burn Bootloader. Note that this isn’t actually burning a bootloader to the ATtiny (it doesn’t use one), it is just using this function to set the AVR fuses to configure the oscillator at 8MHz.
Now download the appropriate TinyTX code from Github, eg. TinyTX_DS18B20.ino if using a DS18B20 sensor and upload it using the Arduino IDE in the normal manner. If you are using an Arduino as the programmer the ArduinoISP sketch running on it will upload it on to the ATtiny transparently. You will probably get the following message twice:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
but this can be safely ignored, as long as it says “Done uploading” at the end then you are good to go.
If you get some errors about “expected identifier or ‘(‘ before ‘double’“ then you need to comment out the following line in ~/sketchbook/hardware/tiny/cores/tiny/wiring.h
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
If you get “not in sync” or “protocol error” then try reducing the baud rate in the ArduinoISP sketch and in hardware/arduino/programmers.txt (under your Arduino IDE directory) as mentioned here, I had to do this to get it to work.
On the receiving end
At the receiving end I am now using OSWIN, my own design for an ATmega1284P based Arduino compatible, prior to that I used a prototype MAX1284 gateway and prior to that I used a Nanode. This relays the data to my installation of OpenEnergyMonitor’s emoncms which gives me nice graphs and visualisations of temperature, humidity, air pressure and rainfall as well as electricity and gas usage. Code for both is available below along with a simple receive example and an example to upload data to Cosm (what used to be called Pachube). I have also built a number of wireless graphical LCD displays that display the data and have their own temperature sensors built in and I’ve also experimented with the Raspberry Pi as a base station and that is also a good option if you want an all in one receiver and server.
Downloads:
TinyTXV2 Design files:
Schematic (PNG format)
Eagle files
Gerbers
Layout for stripboard version
TinyTX3 Design files:
Schematic (PNG format)
Eagle files
Gerbers (one per board) or 2 panelised on one board (you will need to separate them yourself).
Code for transmitters:
DS18B20 Digital Temperature Sensor
TMP36 Analogue Temperature Sensor
DHT22 Digital Temperature/Humidity Sensor
Light Sensor using LDR
Electricity consumption meter using an LDR
Flood/Leak Sensor
Reed Switch for door/window monitoring
Hall effect sensor (magnetic field detector)
Tipping Bucket Rain Gauge
BMP085 I2C Air pressure/temperature sensor
Code for receivers:
Simple serial console receive example
NanodeRF multiple TX to emoncms relay
NanodeRF single TX to Cosm relay
MAX1284 multiple TX to emoncms relay
Flood/leak alarm receiver
Code for graphical displays



























This project is great.
I was looking at doing exactly the same thing with the same sensor and RF modules.
I have everything sitting on my workbench but due to work never got around to putting it all together.
I was also stuck on afew parts that you have now answered, Time to make an array of sensors around the house to control the central heating/cooling
Great project. What enclosures are you putting these in?
Regards
Dan
I’ve used a variety of boxes, some I just had around, all a little larger than I’d like, I’ve been struggling to find something that is a snug fit. For most of them I’ve just left it as the bare boards stuck to the battery holder with a double sided pad, they small enough that it’s easy to find somewhere unobtrusive to hide them.
salve dove posso aquistare la scheda TinyTX Wireless Sensor
hi where can I aquistare card TinyTX Wireless Sensor
Hi Renzo, I don’t have any for sale at the moment, you could get your own made up at SeeedStudio using the gerber files above or make one on stripboard.
Next time I get some PCBs made I will get a few extra for sale.
Cheers,
NAthan
sin but are not practical stripboard, I would be grateful if you show me where to find the card TinyTX
mi sai dire la dimensione (cm*cm) della strpboard per poter fare l’ordine??
grazie
can you tell me the size (cm * cm) of strpboard to make order?
thanks
You need 15 holes by 16 rows which is approx 40 x 45mm.
Cheers,
Nathan
Am pretty keen on using a Raspberry Pi as the receiver .. I know you are talking to open energy monitor about the RFM12 stuff .. is this something you are looking at long term?
Not sure yet, I’m pretty happy with the way things are set up at the moment but have got to have a play to way up the pros and cons.
Nathan – my order of 10 boards has just dispatched from seeedstudio
Thanks for the designs. Just re RFM12 modules, jeelabs are quite a lot cheaper at the mo, with 6 boards for 30euro.
Regards
Dan
Dan, That’s great, really good to see other people using this, I know elyob above received his boards from Seeed this week too. That’s a great deal on the RFM12 as well, think I’ll have to get some ordered.
Cheers,
Nathan
Yes, all arrived. Took a few weeks. Am trying now to write bootloader via both an arduino UNO and nanode. Not had any luck. Changed speed to 9600 but still get the errors mentioned. Not spent a lot of time so far, though.
Who can I sell 3-4 TinyTX board?
thanks
pay with PayPal
Thank you Nathan for good job.
My 2 tiny-tx with 2xAA and LTC3525 are working now, another 8 are waiting for soldering.
I found PP42WS boxes for room sensors.
Great project, thank you!
I have problems compiling the sketches (all of them) with an Arduino UNO.
What libraries did you use. I am using the very last ones from JeeLabs.,
Samples:
…/JeeLib/JeeLib.h:7,
from TinyTX_DS18B20.cpp:16:
or
../Ports.h:447: error: conflicting return type specified for ‘virtual void UartPlug::write(byte)’
and some more.
Any help is very welcome
Regards,
khs
Thank you sharing your Project
I have a similar error as khs !
I tried in v 1.0.1 and 1.0.2 and with different version of libraries and still the same error :
“In file included from …\jeelib/JeeLib.h:7, from TinyTX.ino:16:
…\jeelib/Ports.h:447: error: conflicting return type specified for ‘virtual void UartPlug::write(byte)’
…\hardware\tiny\cores\tiny/Print.h:73: error: overriding ‘virtual size_t Print::write(uint8_t)’ ”
What libraries did you use ?
Your help will be very usefull to us.
Regards
Pirik
Hi khs & Pirik,
I’m not able to test this right now (still at work) but it looks like this is being caused by a fix in the latest arduino-tiny core that was previously being worked around in JeeLib.
Try this:
Near the top of Ports.h find:
#if ARDUINO >= 100 && !defined(__AVR_ATtiny84__) && !defined(__AVR_ATtiny85__) \
&& !defined(__AVR_ATtiny44__) && !defined(__AVR_ATtiny45__)
and change to:
#if ARDUINO >= 100Cheers,
Nathan
Hi Nathan,
Thank You very much for your (very) fast reply
(sorry disturbing you @work)
Your trick solved previous error but …
ARgg !! I have another error now :
../avr/lib/avr25/crttn84.o: In function `__vector_default’:
(.vectors+0×2): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_1′ defined in .text.__vector_1 section in core.a(WInterrupts.c.o)
r:/arduino-1.0.2/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr25/crttn84.o: In function `__vector_default’:
(.vectors+0×16): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_11′ defined in .text.__vector_11 section in core.a(wiring.c.o)
…
googling now …
I find the solution :
https://github.com/damellis/attiny/issues/7
Ah, good news, looks like it isn’t a problem on Linux as it hasn’t affected me.
Ok, (I must reinstall my pc with Linux
Now, i try to debug the ATiny84 program with a serial console.
What ATTINY84 pin must be connected to the rx USB-BUB ?
Thanks
Hello,
I don’t know how to connect ATTINY84 to a Serial console (debug attiny like arduino).
I read this feature was integrated into the ATTINY84 (via Dwire).
I activate Debug Wire DWEN=0 fuse with AVRDUDE (fuse calculated with http://www.engbedded.com/fusecalc/) and send into attiny84 then i try to connect PB3 (Atinny84 pin 4) but nothing work …
Did you used the serial output to see how your attiny program works ?
thank you
Hi Nathan,
thanks for the hint with the tweak in the libraries, here Ports.h.
Found it at
http://harizanov.com/2012/08/setting-up-arduino-ide-for-working-with-attinys/ under #5.
There seems to be a second point to tweak in Ports.cpp, around in the middle of the file there is another :”#if ARDUINO >= 100 && !de…blah…”
Deleted there also everything after “#if ARDUINO >= 100″ and it worked fine for me.
Thank you
khs
@Pirik, I’ve not used Debug Wire before but you can use SoftwareSerial which is built into the Arduino IDE: http://arduino.cc/en/Reference/SoftwareSerial
@khs, Thanks, missed the one in Ports.cpp, not strictly necessary here as we’re not using the UartPlug function but good to know just in case.
Any hints how you’re going to implement the Hall Effect Sensor with the TinyTX? I was hoping to use it similar to this guy:
http://www.instructables.com/id/Monitoring-residential-water-usage-by-reading-muni/
Basically I want to track my water usage along with my electricity, etc.
My plan is to track my gas usage, my meter has a pulse magnet in it so was planning on using a switch type sensor rather than one with an analogue output and just counting the pulses. I need to get on to that now you mention it.
Hmm, I should see if my gas meter has anything for pulse counting. Might be able to use the pulse counter on the emonTX for that.
For the water meter since I can’t count pulses (looked into it) I’m thinking the hall effect is my only chance short of putting my own water meter in, which seems extreme. I found one I’m going to play with that supposedly amplifies the signal itself, but worst case I can run it through an op-amp to try to clean up the signal like the guy in that link did.
Still waiting on half my parts to arrive from overseas. My Tiny TX boards are in Singapore right now, and my emonTX is in the UK (I’m in the US). The Raspberry Pi is backordered but hoping to see that in the next few weeks. I’ll try to put something basic together once my hall effect sensors show up just to see if it’s even possible with my meter.
Thanks for the info and great site. I look forward to your next article!
This is exactly why open source and open hardware is so great, I now have wireless temperature feeding into my OpenEnergyMonitor page and I’ve learnt a little more about Arduino’s and AVR’s.
Great job, thanks for the info and more importantly the inspiration!
:O)
Thanks for the kind comments Tailzer. I’m really pleased this has been useful to people, I’ve had so much benefit from open source software and hardware over the years and it’s great to be able to give something back that other people find useful.
This is the perfect solution for what i am looking for.
But i am missing 1 thing…..is it possible to connect a moisture sensor to this board…so that i cn see the moisture of my plants and ad that ass whell to my openenergy monitor..
hope you can help me with this. I will start with the first sensor as soon as possible…
GREAT work…..really super.
many many thansk from The Netherlands
Hi Guys,
thanks for this great project! Just one question, is it possible to run this code on an attiny44 as well?
@iwan The water leak sensor is essentially a moisture sensor, eg. a 100K resistor fitted and probes on A0 (ATtiny pin 13) and ground. The code I wrote for that just sends a code of 999 if the reading was over 400 but it would be easy to adapt to send the reading instead.
@Can Some of the examples will fit on the 44 but not all of them, the DS18B20 code needs an 84 for example.
@ Nathan,
thanks for the info….i am going to build me a small network with these sensors…
hope this works…
great stuf..
Iwan
Hello
I would like to know if it’s possible to use attiny85 instead of attiny84?
Regards
Maurycy
Not with the same code but I know that Martin has had some success getting the 85 to work with RFM12B sending Jeelib compatible packets. See his post here:
http://harizanov.com/2012/06/sending-jeelib-compatible-packets-with-attiny85rfm12b/
and the sketch in Digispark examples might be of help:
https://github.com/digistump/DigisparkArduinoIntegration/blob/master/examples/Digispark/Rfm12b/Rfm12b.ino
I haven’t tried this yet but have got some Digisparks (ATtiny85 based) and RFM12B shields so will get round to it at some point.
Cheers,
Nathan
Thanks for information.
I will try to do it on attiny84 first, next will try 85.
It’s great project.
I will follow Yours Digisparks projects.
Regards
Maurycy
Thanks for this Information. So i will try Attiny84. Finally i found some and have already fleshed one with your code. Hopefully my RFM12B mosules will arrive soon.
Hello
Is it possible to use DS18S20 Sensors instead of DS18B20 Sensors with th Tinytx-Board??? I tried it and I always get 85 degrees from the sensor which is a default value for the case that something went wrong. Are changes in the Code from the tinytx neccesary??? Or is it the Library which does not support the DS18S20 Sensors?? (btw the DHT22 Sensor runs great on the same board with the other code).
Regards
Daniel
I’ve never tried the S20, it doesn’t look like you need to do anything different but I note on the page for the Dallas Temperature library it says there have been problems reported with it but no more than that: http://milesburton.com/Dallas_Temperature_Control_Library
Hello,
I finally managed to run emoncms with two temperature nodes. I would like to say big thank you…
https://cosm.com/users/pacaj2am
Hello Jan
Can I ask for a code for it?
I did some tests with DS1820 and for now I have one cosm stream: cosm.com/feeds/105356
I have some problems with multiple streams. Do You use uno on nanode?
regards
Maurycy
Hi… I use Raspberry PI with RFM12Pi end emoncms. You can see here… http://emoncms.paci.name/pacaj2am . Upload is done once per 5 minutes from mysql database. I had also problem with csv values. I had to use json. the main part is here:
#!/bin/bash
for i in feed_2 feed_3 feed_4 feed_5
do
php export.php $i > /tmp/${i}.dat
curl –request POST –data-binary @/tmp/${i}.dat \
–header “X-ApiKey: ****KEY****” \
http://api.cosm.com/v2/feeds/106475/datastreams/${i}/datapoints/
done
Hi Nathan,
really great Project! I’ve soldered three nodes already. But i’ve a question about the sending intervall. It should be 1min. in your sketch. But from time to time i get 5 times in row a temp value of one node. Is this behaviour normal?
@Maurycy/Jan That’s handy. I went with a slightly different method for feeding from emoncms to cosm, instead of pushing to cosm I use this bit of php to provide a .csv for cosm to pull from: https://github.com/nathanchantrell/emonextras/blob/master/csv.php
The downside of this method is it will only update cosm every 15 minutes.
@Can That will be the ACKs causing that, with the default settings if the TX doesn’t get an ACK back from the base then it will retry up to 5 times. If you are only seeing it occasionally then it is probably interference or contention causing it to miss the ACK.
You can adjust the number of retries and time to wait for a reply, or turn ACKs off altogether with these defines:
#define USE_ACK // Enable ACKs, comment out to disable
#define RETRY_PERIOD 5 // How soon to retry (in seconds) if ACK didn’t come in
#define RETRY_LIMIT 5 // Maximum number of times to retry
#define ACK_TIME 10 // Number of milliseconds to wait for an ack
Cheers,
Nathan
Thanks a lot for this absolutely fast reply. I think this will be the reason. I will test it.
I would like to put a led on the circuit that blinks when the rfm12 send a packet. But how do i manage this? I’ve tried something like if(rf12_send){ledPin = HIGH}
But rf12_send has no statement…
How about turning the LED on after rf12_sendStart and then off after waiting for an ACK, something like:
rf12_sendStart(RF12_HDR_ACK, &tinytx, sizeof tinytx);
digitalWrite(ledPin,HIGH); // Turn LED on
rf12_sendWait(2); // Wait for RF to finish sending while in standby mode
byte acked = waitForAck(); // Wait for ACK
digitalWrite(ledPin,LOW); // Turn LED off
rf12_sleep(0); // Put RF module to sleep
if (acked) { return; } // Return if ACK received
Will that do what you want?
I’m using RFM12B chips from here..
http://www.tme.eu/cz/katalog/?idp=1&search=RFM12B&cleanParameters=1
They cost 2,5eur piece… pretty cheap…
Jan
Pefect, thanks a lot! Now i’m running evveything the way i like it!
Hello,
I’ve seen very nice programmer. Where did you bought the white plactic pin?
Thank you
Jan
Hi Jan, I got the IC test clip for programming off ebay: http://www.ebay.co.uk/itm/1x-ITC-14A-14PIN-IC-TEST-CLIPS-/181075620466
Cheers,
Nathan
Thank you,
i bought one…
I was thinking whether to directly solder attinu84 or use socekts… now i soldered directly…
Thank you
Jan
Hi Nathan,
is possible to use the tinytx wireless sensor with two CT sensor or one CT sensor ?
Regards
Francesco.
I can burn the bootloader and upload the blink sketch to my ATtiny84 via an ISP-Programmer, but the LED won’t blink
If I use another fuse setting from Github, the blink sketch works without problems but I can’t use the JeeLib library… What’s wrong?
Hi Nathan,
if I want to connect BMP085 at the Tiny TXV2 is possible ?
Francesco.
You can try this code here, it has been working fine for me but I know a couple of other people have been having problems that we haven’t got to the bottom of yet:
https://github.com/nathanchantrell/TinyTX/blob/master/TinyTX_BMP085/TinyTX_BMP085.ino
On the TinyTXV2 connect the BMP085 SDA line to D10 and SCL to D9
See this picture for which is D10 & D9 on the V2: http://nathan.chantrell.net/blog/wp-content/uploads/2012/07/tinytx_pins.jpg
In the code you would need to comment out the line:
PortI2C i2c (2);
and uncomment:
// PortI2C i2c (1);
You won’t be able to connect the power via a pin on the V2 so connect it to Vcc and comment out the following in setup():
pinMode(BMP085_POWER, OUTPUT); // set power pin for BMP085 to output
digitalWrite(BMP085_POWER, HIGH); // turn BMP085 sensor on
This is the BMP085 breakout that I used: http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=110842501061
Hey Nathan,
What kind of range do you expect on this wireless sensor with the Raspberry Pi wireless base station? I’m thinking of making a water temperature buoy at my summer house and the buoy will be about 500ft away from the base station. Is that too far?
I’ve been working on a modification design for the TinyTX v3 board. A change that I’ve finished is converting to SMD components. The other change I’m half done with is making it easy to connect a Li-Ion battery.
I’m planning on placing TinyTX boards around a house that has an openenergymonitor project installed for recording room temps among other things, and I’m trying to come up with a way to get them portable.
I’ve run into a problem where the Li-Ion battery, when fully charged, has a voltage of about 4.1v but the RFM12 module can handle a maximum of 3.8v. I’d like to regulate the voltage to make sure it’s safe to connect a fully charged battery. After talking with a guy at work who does electronics design, he suggested looking into a low dropout regulator chip. I see output voltage ratings for 3.3v and 3.6v.
I’m wondering what voltage would be the best for output. If the battery starts at 4.1v and I regulate it down to 3.3v, wouldn’t it be wasting charge? I’m wondering if anyone knows if it would be more energy efficient to regulate to 3.3v or 3.6v? Also, what would be the best voltage for sensors? I’d like to be able to use as many types of sensors as possible (see examples above).
Also, I’m wondering what current rating the regulator should have? Does anyone have experience with how much the RFM12 module and a simple sensor or two draws? Would 50mA or 100mA be enough?
Thanks in advance!
@John Doe 500 feet might be a bit too far, I usually say 120 metres (~400 ft) with clear line of sight and around 20 to 30 metres indoors through a few walls although that really can vary depending on the construction of the building and interference/contention with other devices. The 433MHz version should in theory have slightly better penetration through walls but that’s all I’ve used so haven’t done a real world comparison to 868MHz.
@Chris Sounds good. You’re right that regulating down from 4.1V to 3.6V is going to be slightly more efficient but watch out for how quickly the battery voltage drops, I’ve not tracked one but as they have a nominal rating of 3.7V I imagine it will drop to a level below what the vreg requires pretty quickly so you might actually get longer out of a charge by regulating to 3.3V. Worth checking anyway. 50mA should be plenty.
As far as the sensors go, either voltage would be ok, all the sensors I have used range from at least 3.0 to 5.5V apart from the BMP085 pressure/temp sensor which tops out at 3.6V.
For what it’s worth I have run one with a DS18B20 directly from a LiPo battery without any regulation, yes 4.1V is slightly outside the recommended operating range for the RFM12B but it is still within the absolute max rating. I couldn’t say whether it effects the longevity but it has worked ok for me so far. YMMV of course.
Ok, The buoy is 130m away according to google earth. Do you know of a way to improve the wireless signal? Will a better antenna help?
That’s close enough that I would think you would probably be able to make it work with the right positioning and antenna, antenna theory gets complicated quickly though and it’s not something I’m well up on at all as the range has been fine for my needs.
This document from Hope (manufacturer of the RFM12B) is interesting and might be of help: http://www.hoperf.com/upload/rf/ANTENNAS_MODULE.pdf
Another option would be to use a different radio, the SRF from Ciseco is footprint compatible with the RFM12B and I’ve had one working with the TinyTX3, see pic here: http://www.flickr.com/photos/nathanchantrell/8634475735/ (the extra grey wire isn’t required for a transmit only node). It is a bit more expensive but is supposed to have a much higher range than the RFM12B (some claim as much as 3km!), I’ve not written any complete code for this yet but it would be easy enough to do as it is only working like a transparent serial connection in its default configuration. I was using their Xbee compatible XRF on the receive end when testing but they have other options like a Raspberry Pi board and USB stick. See http://shop.ciseco.co.uk/rf-module-range/
Here’s a useful post on JeeLabs about extending the RFM12B range.
Hi,
still playing with the TinyTxs, used a handful for hydronic balancing of our heating system using emoncms.
Now I want to use emoncms to look after power-, gas- and waterusage; we have all the meters in one room (max. 1 meter apart) and they all deliver pulses. My idea is to use the TinyTx as “frontend” to connect to the meters and my Nanode to connect via cable to the TinyTXs. The RF of the Nanode shall be used for additional equipment, the ethernet to emoncms.
So how to connect the TinyTX and the Nanode?
What is necessary for the SW?
Is the Nanode capable to fulfill such a job?
Any ideas, comments or help is very much appreciated:
Regards,
khs