How to make a RiverSpy2 monitoring system
Here is some idea of how to build a river level monitoring system, Daithí (last modified 25-9-06)
System Overview
The diagram below gives an overall picture of the system. At the river end, the system is broken into two parts. At the bottom of the river, bolted to an existing stick gauge (or some other convienient location) is a differential pressure sensor. This sensor measures the difference in pressure between the athmosphere and the bottom of the river. To make this differential measurement , one side of the sensor is connected to a breather tube and the other end is open to the surrounding water. The pressure difference P=ρgh , where ρ is density, g is 9.81m/s2 and h is the height between the sensor and the surface of the water. The small signal voltage is amplified by an instrumentation amplifier chip.
The sensor board is connected to the controller board via a 3-core cable. One wire carries a 10V supply to the sensor board. Another wire carries the analog pressure signal back to the controller. The third wire is a ground. The controller board is mounted somewhere on the river bank, in a weather-proof box along with a 12V battery and an old mobile phone. A solar panel is mounted above the box so the location should have an unobstructed view of the southern sky. If vandalism is a concern, the system should perhaps be mounted on top of a tree or a high pole.
Every 15 minutes, the controller board powers up the sensor board and reads the signal once per second for thirty seconds. The measurements are averaged so that the reading is not affected by surges in the water level. Once the reading has been taken, it is stored in memory and the system goes into a low power mode until it is time to take the next reading. Once a day at 09:00, the 96 measurements taken the previous day are collated into a single sms message and sent to an email gateway. The email generated is read by a server which updates the wap and web sites.
The phone that I used is an old Siemens M35, but I think that the command set is the same for all of the M,C and S 25 and 35 phones. The phone does not contain its own battery. (The batteries in those phones were fairly bad anyway) Instead it runs from a supply taken from the 12V battery via a dc-dc converter.
When the system receives a phone call, it examines the caller id to see if an administrator is calling. If it is an admin, the system allows the remote phone to ring once and then hangs up. An sms is sent to the administrator containing the most recent level, the level from 30min previous, the level from 60 min previous and the current state of the 12V battery. If the caller id is not that of an admin, the system will answer the call and give a series of beeps to indicate the most recent level.
The sensor board is connected to the controller board via a 3-core cable. One wire carries a 10V supply to the sensor board. Another wire carries the analog pressure signal back to the controller. The third wire is a ground. The controller board is mounted somewhere on the river bank, in a weather-proof box along with a 12V battery and an old mobile phone. A solar panel is mounted above the box so the location should have an unobstructed view of the southern sky. If vandalism is a concern, the system should perhaps be mounted on top of a tree or a high pole.
Every 15 minutes, the controller board powers up the sensor board and reads the signal once per second for thirty seconds. The measurements are averaged so that the reading is not affected by surges in the water level. Once the reading has been taken, it is stored in memory and the system goes into a low power mode until it is time to take the next reading. Once a day at 09:00, the 96 measurements taken the previous day are collated into a single sms message and sent to an email gateway. The email generated is read by a server which updates the wap and web sites.
The phone that I used is an old Siemens M35, but I think that the command set is the same for all of the M,C and S 25 and 35 phones. The phone does not contain its own battery. (The batteries in those phones were fairly bad anyway) Instead it runs from a supply taken from the 12V battery via a dc-dc converter.
When the system receives a phone call, it examines the caller id to see if an administrator is calling. If it is an admin, the system allows the remote phone to ring once and then hangs up. An sms is sent to the administrator containing the most recent level, the level from 30min previous, the level from 60 min previous and the current state of the 12V battery. If the caller id is not that of an admin, the system will answer the call and give a series of beeps to indicate the most recent level.
Controller board, phone, battery and solar panel mount
The photo below shows the original RiverSpy system with a controller prototyped on veroboard. RiverSpy 2 is laid out on a printed circuited board. The layout file is at the bottom of this page.
Administrator sms
When admins ring the phone, the system declines the call and sends back a text of the level now, 30mins ago and 1 hour ago. When others ring the phone, the system answers the call and gives a series of beeps to indicate the current level.
Hex file for programming PIC is here
Phone
So far, I have built systems using the Siemens M35 and the C45. Any old Siemens phone should do but the connectors on the later ones have gotten smaller so it won't be as easy to solder on the wires. The battery is removed from the phone and it is powered directly by the controller. The AT language used to talk to the internal modem is much the same for all Siemens phones. I have put some pictures of wiring an M35 here. The wire needs to be very fine. I used "wire-wrap" wire. It helps to put some solder on the wire before soldering to the phone. In the pictures shown, the red and black wires are soldered directly to the phone pcb. It is also possible (and easier) to solder them to the contacts that would normally press against the battery. Siemens also make a range of GSM modems such as the TC35. These are made for telemetry applications and would be easy to wire up but would cost you a lot more that an old phone.Phone connector pin-out here
Pictures of phone wiring here
Installation
A picture of an early RiverSpy rev 2.0 controller is shown below. The latest version is a bit larger and uses through hold components instead ofsurface mount to make it easier for an inexperienced person to assemble. I'll put up some pictures of the latest rev later.
- Terminal block for solar panel or external 12V supply
- Molex connector for battery (paralleled with connector 1)
- Debugging interface can be used to monitor phone communications using a pc serial port
- ICD2 interface for programming the PIC
- Molex connector to mobile phone
- Molex connector to underwater sensor
The controller, battery and phone should be mounted in a waterproof box. A plastic box allows optimum phone coverage but if vandalism concerns require the use of a metal box, then an external antenna for the phone may be required. A frame should be contructed to mount the solar panel and the box. To optimise solar energy in winter, the solar panel must face south, have a clear view of the sky and be inclined at 70 degrees to the horizontal. Once all of the components have been connected together, configure it as per the installation manual given below.
Send me an email if you need some help.
Installation manual is here
Debugging
I have also put up a schematic of a small circuit that I use for debugging here. All it does is convert a 5V-0V signal to a +12V-12V signal suitable for connecting to the serial port of a pc or laptop. It listens in on the communications between the control board and the phone. I normally connect it to the RX (receive) line of the PIC. RX and GND are at pins 5 and 6 of the connector J4. RX carries the data going from the phone to the PIC. The phone should echo the characters sent from the PIC to the phone so you should see both sides of the conversation. If this is not working, it can also be connected to the TX (transmit) line but this only shows the characters sent by the PIC. The characters can be displayed on the pc using hyperterminal set at COM1, 9600,N,8,1, no flow control. A similar circuit is included in a siemens pc data cable so if you have one of those, just disassemble the connector at the phone end and use that instead. The pinout of the phone connector is given here. Do not connect the TX of the data cable (pin6, RX of the phone) to the phone at the same time as connecting the TX from the PIC. (its like two people trying to talk using walkie talkies at the same time) Also note that pin 3 (Power) and pin 4 (Fbatt+) shown in the phone connector pinout are not the same as the positive terminal of the phone battery (BATT+).
0 comments:
Post a Comment