![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTgLnQCHdWPbLFad03o29IYOhKXoVc7DVrhfui0M86CuFM3bzIEBLSnlOk_n8sJLrxVyMeRqjAEf43OIfVA0FqcfeTaItrrHsf5DRViE1X0xXW1FwG_ljuJ9wzfTuWQB4r4sXnlNsde3fEeGxD/s480/IMG_20131122_010207.jpg)
And here's a diagram:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4ZQ95RlJpGOuvgvaNhyphenhyphen2g0mvoX_VftP8xhIT5jrbx5vJjCmaQzDp1998tUz8T0rq-bZMDlDPVLfoZCGtBQW0NoRJzIVf_YdUyjcICAn-uHlG4qqyTFQR8gEGELGwLhQiC3vVMjsLHckLKeU2P/s480/bluetooth_thermometer_bb_1.png)
The connections are pretty straightforward, I used three AA batteries for power, which was fine for the 3.3V Trinket and the Bluetooth module. I connected the DHT22 sensor to the regulated 3.3V output on the Trinket. I only connected the RX pin on the Bluetooth module, because I was only going to be sending data. The DHT22 sensor also has one data pin and there's a 10K pull up resistor between the data pin and VCC.
As far as software goes, I used this library to talk to the DHT22 sensor, because the one from Adafruit that I used previously with a real Arduino didn't want to work on a Trinket for some reason. I also used this SendOnlySoftwareSerial library because I was only sending data and with the regular SoftwareSerial library the sketch wouldn't fit in Trinket's limited memory. You can the sketch I used here, it's a simple modification of the example sketch that comes with the DHT22 library.
To read the temperature from this thermometer, you need a device (phone, tablet, computer) with Bluetooth and a terminal application. It prints the temperature and humidity every two seconds:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPpynMLLLsTm8Tc-beuA30hjRRy_XyhI5BYZlDkVg5g2zSbwNzllBr0MjDdLj0d-qil5wGS518W8qVCvZqlbJqSQxZoTkH26SRrJ1byGAC3WAelzxiVgQin0C-oEM7GQgkUTAynsTBw2OXLjJE/s480/IMG_20131122_005722.jpg)
Hi Jaced,
ReplyDeletegreat work!
May I have your sketch-coding?
I am trying to use a trinked as keyboard (#include )
The trinked should receive bluetooth-information.
So I need the #include
But with the two includes I get a compile error:
multiple definition of `__vector_2'
Thanks Regards
Mario
I forgot the "notify me"
ReplyDelete