Mechanical watches in the environment of a smart home
Good day! No, well, of course, not entirely mechanical. Electromechanical. One of the implementations of radio exchange of information within the so-called environment will be considered. "Smart home", namely the exchange of information about the exact time. Also, the idea of controlling an analog clock without the participation of a person is stated. In the last article, we talked about collecting information about the temperature in the street via a radio channel using a radio module based on the NRF24L01 +. Continuing the development of the infrastructure of the “smart home”, it was decided to implement the exchange of information about the exact time. Good people gave a secondary watch "Strela" - they are on KDPV. The solenoid with the drive was ruthlessly amputated, instead of them the stepper motor from the printer and the microcontroller msp430g2553 with the NRF24L01 + radio module were installed. The question of the initial determination of the position of the arrows was solved in the following way. Under the hands of the dial, 2 IR optocouplers were installed so that both sensors worked when the hands were at 6:00. One sensor is in the corner of the number two tw, the second above the quality mark. Sensors (circled in the picture) work on reflection, and the inside of the arrows is glossy: When initialization occurs, so-called. parking The microcontroller turns the arrows until both sensors are closed. After that, accepting the starting point as 6:00, the time request is made over the radio channel from the controller of the “smart home”, and when a response is received, the position of the arrows is adjusted according to the exact time. In the process of working, the watch with a certain periodicity makes a request for time (in my case, once a minute). In order to avoid collisions in the radio channel, if there are several such clocks in the house, each individual clock has a unique identifier, the value of which in seconds determines the delay in the request from the time the new minute arrives. Here is the wrong side of the watch: The hardware of the “smart home” has recently moved from the laptop + FreeBSD9 to TP-Link TL-WR703N + OpenWRT . It runs the ntpd internal time synchronization daemon. Communication with the “smart home” equipment takes place via the UART, to which the NRF24L01 + radio module is connected via the msp430g2553 microcontroller: The controller itself is written in PERL and communicates with the UART via the Device :: SerialPort module. The second connector on the controller board is planned for an additional NRF module designed to control actuators (lights, security sensors, blinds, and other automation). Exchange through it will take place on another frequency channel using encryption (if your hands reach).
Project sources for CCS5 and clock for ProfiCAD in picture (save and unpack winrar): UPD: Barley daemon code on the controller.
Installation video on power up - on monitor tail of control controller log.