Code and design files for my wireless sensor node project
C
Latest commit 68c5157 Jun 19, 2012 Shaun Crampton Add schematic to readme.
Permalink
Failed to load latest commit information.
.settings
assets Add schematic to readme. Jun 19, 2012
.cproject
.gitignore
.project
README.md
WirelessSensorNode.fuses
main.c Tri-state the transmit pin when not in use (just in case there's leak… Jun 12, 2012
sensor_node.h

README.md

Wireless Sensor Node

This repo contains the source code and assets for my wireless sensor node project.

Completed sensor module

Completed sensor module

Code

The root directory of the repository is an Eclipse CDT/AVR project targetting the ATTiny13, which is a miniscule microcontroller with only 1K of ROM and 64 bytes of RAM.

The code in main.c implements a main loop that:

  • reads a TMP36 temperature sensor on the defined pin
  • writes a Manchester-encoded signal on the defined transmit pin (which should be connected to something like this).
  • goes into deep sleep for about 4 minutes to preserve battery life

To reduce battery usage further, the TMP36 is driven directly via a microcontroller pin and only turned on when needed. Likewise, the transmitter is only turned on when needed; since it uses more power, I used a transistor attached to the "RADIO_POWER_PIN".

The code is released under the BSD license.

Schematic

Schematic drawing

The TMP36 is driven directly by the ATTiny so that it can be powered down when not in use. The 0.1uF capacitor smoothes the power to the TMP36, increasing its accuracy.

The transmitter is powered via a basic NPN switching transistor. The 10uF cap provides for the transient high current used for transmission. The 2k resistor prevents too much current from flowing through the base to the emitter of the transistor (it only takes a small current to saturate the transistor so any extra current isn't helpful and can be harmful).

Assets

The diagram for laser-cut box is in the assets directory. It works well when cut in 3mm MDF or plywood. I've tried birch and walnut ply from laserbits.com.

Creative Commons License
Laser cut box by Shaun Crampton is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

The box design is written up in an instructable.