Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
livebox:hah_hahnode [2012/07/01 15:54] – [Flashing from the HAH] minerva9 | livebox:hah_hahnode [2014/02/15 11:52] (current) – [Building your own] minerva9 | ||
---|---|---|---|
Line 9: | Line 9: | ||
Block diagram of how the JeeNodes are integrated into the [[HAH]] [[livebox]] | Block diagram of how the JeeNodes are integrated into the [[HAH]] [[livebox]] | ||
- | You will need a minimum of TWO nodes, one is tethered to the LIVEBOX and acts as the RF/Serial gateway (HAHcentral). | + | You will need a minimum of TWO nodes, one is tethered to the LIVEBOX |
===== Architecture ===== | ===== Architecture ===== | ||
Line 64: | Line 64: | ||
* HAHnode PCB | * HAHnode PCB | ||
* ATMega328P chip (pre-programmed) | * ATMega328P chip (pre-programmed) | ||
- | * RFM12B - RF Transceiver module | + | * {{: |
* Voltage regulator IC | * Voltage regulator IC | ||
* 16MHz ceramic resonator | * 16MHz ceramic resonator | ||
Line 74: | Line 74: | ||
* 1x6 Male pin header (for our attach/ | * 1x6 Male pin header (for our attach/ | ||
===== Flashing from the HAH ===== | ===== Flashing from the HAH ===== | ||
+ | |||
+ | Firmware images are available from : http:// | ||
The first thing to do is to connect the PCB to your HAH. To do this you will need the [[http:// | The first thing to do is to connect the PCB to your HAH. To do this you will need the [[http:// | ||
Line 111: | Line 113: | ||
</ | </ | ||
- | Hit the return key a acouple | + | Hit the return key a couple |
< | < | ||
Line 148: | Line 150: | ||
- | < | + | < |
===== From scratch ===== | ===== From scratch ===== | ||
Line 195: | Line 197: | ||
-- Keyed by NODE ID | -- Keyed by NODE ID | ||
local nodes = { | local nodes = { | ||
- | [3] = RoomNode{base="dbzoo.livebox.jeenode: | + | [3] = RoomNode{instance |
- | [4] = OutputNode{base="dbzoo.wombat.jeenode: | + | [4] = OutputNode{instance |
} | } | ||
Line 210: | Line 212: | ||
These settings are used internally to send a message to xap-serial to initialise the port. | These settings are used internally to send a message to xap-serial to initialise the port. | ||
- | By default the target used for xap-serial will be '' | + | By default the target used for xap-serial will be '' |
- | In this example we have assumed you have called your instance | + | In this example we have assumed you have set the hostname to '' |
< | < | ||
local jeemon={ | local jeemon={ | ||
- | target=" | + | target=" |
port="/ | port="/ | ||
baud=57600, | baud=57600, | ||
Line 229: | Line 231: | ||
< | < | ||
-- [ID] = NodeType | -- [ID] = NodeType | ||
- | [2] = RoomNode{base="dbzoo.livebox.jeenode: | + | [2] = RoomNode{instance=" |
</ | </ | ||
Line 251: | Line 253: | ||
{{: | {{: | ||
+ | |||
+ | < | ||
**Example configuration** | **Example configuration** | ||
Line 256: | Line 260: | ||
If a Node defines multiple endpoints these will be appended to this base SOURCE description. | If a Node defines multiple endpoints these will be appended to this base SOURCE description. | ||
< | < | ||
- | [ID] = RoomNode{base="dbzoo.livebox.jeenode: | + | [ID] = RoomNode{instance=" |
</ | </ | ||
{{ : | {{ : | ||
Line 265: | Line 269: | ||
dbzoo.livebox.jeenode: | dbzoo.livebox.jeenode: | ||
</ | </ | ||
+ | |||
+ | See [[livebox/ | ||
===== Disabling / Renaming endpoints ===== | ===== Disabling / Renaming endpoints ===== | ||
Line 275: | Line 281: | ||
<code lua> | <code lua> | ||
[ID] = RoomNode | [ID] = RoomNode | ||
- | { base = "dbzoo.livebox.jeenode: | + | { instance= " |
endpoints = {temp=1, | endpoints = {temp=1, | ||
} | } | ||
Line 285: | Line 291: | ||
<code lua> | <code lua> | ||
[ID] = RoomNode | [ID] = RoomNode | ||
- | { base = "dbzoo.livebox.jeenode: | + | { instance |
endpoints = {temp=1, | endpoints = {temp=1, | ||
} | } | ||
Line 299: | Line 305: | ||
<code lua> | <code lua> | ||
[ID] = RoomNode | [ID] = RoomNode | ||
- | { base = "dbzoo.livebox.jeenode: | + | { instance |
endpoints = {temp=" | endpoints = {temp=" | ||
} | } | ||
Line 320: | Line 326: | ||
<code lua> | <code lua> | ||
[ID] = RoomNode | [ID] = RoomNode | ||
- | { base = "dbzoo.livebox.jeenode: | + | { instance=" |
endpoints = {temp=" | endpoints = {temp=" | ||
ttl=300 } | ttl=300 } | ||
Line 343: | Line 349: | ||
So 120 is too small... 180 is fine - Personally I would make the TTL at least 2x the reporting cycle, this way you can miss ONE event and it won't time out as the 2nd one will reset things. | So 120 is too small... 180 is fine - Personally I would make the TTL at least 2x the reporting cycle, this way you can miss ONE event and it won't time out as the 2nd one will reset things. | ||
- | ====== The Nodules ====== | ||
- | ===== Room Node Twin ===== | ||
- | Identical to Room Node but has an additional 1wire sensor for Temperature on JeePort2 (PD.5) See [[# | ||
- | |||
- | Exposes the additional endpoint | ||
- | * temp2 - Temperature | ||
- | |||
- | < | ||
- | RoomNodeTwin = require(" | ||
- | |||
- | [3] = RoomNodeTwin{base=" | ||
- | </ | ||
- | |||
- | This Decoder and Sketch is handy if you have Node in a room with temp sensor on an extension cable and want to monitor another room, an heating/air conditioning duct output for the room or simple a sensor outside the window. | ||
- | |||
- | {{: | ||
- | |||
- | ===== Room Node ===== | ||
- | |||
- | {{ : | ||
- | The room node is a sensor unit that can monitor the following environmental conditions. | ||
- | * temp - Temperature | ||
- | * humi - Humidity (Note; available with a jeenode and the SHT11 sensor board) | ||
- | * moved - PIR - for movement detection | ||
- | * light - Light | ||
- | * lobat - Low Battery | ||
- | |||
- | <note tip>For something that looks really slick you can put this inside an [[/ | ||
- | |||
- | The Arduino sketch has been designed for low power. It's ideal for running from batteries\\ | ||
- | A precompiled sketch ready for flashing can be found on the [[http:// | ||
- | Or if you feel up to it you can download the [[http:// | ||
- | |||
- | For example we have a battery powered unit configured as a RoomNode to monitor temperature using a DS18B20 1wire device. | ||
- | |||
- | {{: | ||
- | |||
- | This unit would be minimally configured to expose the following xAP endpoints; | ||
- | <code lua> | ||
- | [ID] = RoomNode{base=" | ||
- | </ | ||
- | |||
- | <note tip> | ||
- | </ | ||
- | |||
- | In this configuration we have fitted a board with light sensor and temperature sensor but it will be powered from a 5v USB power supply using its programming cable. | ||
- | |||
- | {{: | ||
- | |||
- | The DS18B20 temperature sensor must be plugged into Port 1 - Legend P1 on the PCB and it uses the following connection ' | ||
- | |||
- | <note important> | ||
- | </ | ||
- | |||
- | The LDR light sensor fits onto Port 4, legend P4 on the PCB. One leg of the LDR goes to pin ' | ||
- | |||
- | If the above board was configured as ID 2 - we could use the following configuration setting to enable just the Temperature and Light endpoints, there is no point in reporting on Low Battery as this unit would be permanently powered. | ||
- | <code lua> | ||
- | [ID] = RoomNode{ base = " | ||
- | </ | ||
- | ===== Output Node ===== | ||
- | |||
- | The OutputNode sketch, and matching Lua class, exposes the digital ports 1-4 as I/O controllable xAPBSC endpoints. | ||
- | |||
- | Snippet of configuration information needed in the jeenodeApplet.lua source. | ||
- | < | ||
- | OutputNode = require(" | ||
- | |||
- | local nodes = { | ||
- | [ID]=OutputNode{base=" | ||
- | } | ||
- | </ | ||
- | |||
- | So now we can simply use a xAPBSC.cmd class message to control these newly created endpoints. | ||
- | < | ||
- | xap-header | ||
- | { | ||
- | v=12 | ||
- | hop=1 | ||
- | uid=FF000F00 | ||
- | class=xAPBSC.cmd | ||
- | source=dbzoo.livebox.demo | ||
- | target=dbzoo.livebox.jeenode: | ||
- | } | ||
- | output.state.1 | ||
- | { | ||
- | id=* | ||
- | state=on | ||
- | } | ||
- | </ | ||
- | |||
- | Controlling an OutputNode from the Joggler in this video we simply toggle 4x LEDs on/off. | ||
- | |||
- | [[http:// | ||
- | |||
- | This node provides the following endpoints (p1, | ||
- | < | ||
- | dbzoo.livebox.jeenode: | ||
- | dbzoo.livebox.jeenode: | ||
- | dbzoo.livebox.jeenode: | ||
- | dbzoo.livebox.jeenode: | ||
- | </ | ||
- | |||
- | We can rename them like this to produce '' | ||
- | < | ||
- | local nodes = { | ||
- | [ID]=OutputNode{base=" | ||
- | } | ||
- | </ | ||
- | |||
- | ===== Infrared Receiver node ===== | ||
- | |||
- | Block diagram of how the IRnode fits into the system | ||
- | |||
- | {{: | ||
- | |||
- | {{ : | ||
- | |||
- | Typical configuration in the JeeNodeApplet.lua | ||
- | < | ||
- | IRNode = require(" | ||
- | ... | ||
- | local nodes = { | ||
- | [2] = IRNode{base=" | ||
- | } | ||
- | </ | ||
- | |||
- | This configures the JeeNode with ID of 5 and with an attached IR sensor to relay messages, via RF, to the HAH unit. | ||
- | |||
- | The IR sensor data pin is connected to | ||
- | ^^ Port ^^ Type ^^ Arduino ^^ Signal ^^ Chip ^^ | ||
- | || Port 2 || DIO || Digital 5 || PD5 || pin 11 || | ||
- | |||
- | Once the IRnode.pde sketch is loaded onto your jeenode and the HAH is correctly configured, pressing a button on your remote control should produce a message like this. | ||
- | |||
- | < | ||
- | xap-header | ||
- | { | ||
- | uid=FF08DBFE | ||
- | source=dbzoo.livebox.jeenode: | ||
- | hop=1 | ||
- | class=IR.Comms | ||
- | v=12 | ||
- | } | ||
- | ir.received | ||
- | { | ||
- | value=550717623 | ||
- | type=1 | ||
- | bits=32 | ||
- | } | ||
- | </ | ||
- | Note that this configuration is better suited to a JeeNode that is not battery powered. | ||
====== Nodule I/O pins ====== | ====== Nodule I/O pins ====== | ||
Line 508: | Line 362: | ||
- Remote LCD head and a PCB with the IDC connector that allows the existing LCD from the HAH to be removed and placed into this remote head unit. All messages to the INTERNAL LCD could now be displayed remotely!\\ Larger LCD panels for heads up displays. | - Remote LCD head and a PCB with the IDC connector that allows the existing LCD from the HAH to be removed and placed into this remote head unit. All messages to the INTERNAL LCD could now be displayed remotely!\\ Larger LCD panels for heads up displays. | ||
- | - Using the I2C expansion board to allow multiple inputs/ | + | - Using the I2C expansion board to allow multiple inputs/ |
- Controlling a Stepper motor linked to a remote rotator this would make an interesting demo, not sure of the practical purpose of it. | - Controlling a Stepper motor linked to a remote rotator this would make an interesting demo, not sure of the practical purpose of it. | ||
- GAS monitoring by counting the pulses. | - GAS monitoring by counting the pulses. | ||
+ | - Extended range nodes via use of external antenna. See the [[http:// |