Front facing railway camera
Transcription
Front facing railway camera
Lebanese University FACULTY OF ENGINEERING BRANCHE 1 Order no. 39/875/G1-EE/2013 Final Project Realized by Mohamad Azmi CHAHAL To obtain an Engineering Diploma in Electricity and Electronics Option Control and Industrial Computing Front facing railway camera Directed by: Prof. Cédric Bornand Argued before the jury: Dr. Haissam Ziade Dr. Bachar El-Hassan Dr. Khaled Mechref Session July 2013 Acknowledgment First, I want to thank Prof. Bornand and Dr. Ziade for proposing this project and giving me this wonderful opportunity. Thanks to Mr.Medwed for giving me valuable advices and directing me to the right choices, to Mr.Perrin for preparing the materials and helping me with the tests. Thanks to Mr.David and his crew for building and helping with the mechanical designs. Also, thanks to Dr.Falou for helping me with the socket programing part and sending me the code examples. Finally, a big thanks to all the professors at the Lebanese university and the direction of the faculty, to my friends and family…I wouldn’t be here without you. Institute society The eMbedded Information Systems (MIS) Institute, HEIG-VD, around the axes of acquisition, communication and signal processing, designs and implements embedded systems, by taking into account the cost, the power consumption and the system’s behavior in real time applications. Since September 2003, MIS was certified by the Swiss association for “Quality System management”, by following the criteria’s of the norm ISO 9001:2000. This certification is related to three major activities of MIS: Applied research and development Services In-service training MIS has an area of expertise in the field of electronics, vision, acoustic, embedded systems, algorithms… Along this, MIS takes on tasks related to industrial system designs, like a front facing train camera, a power management system… Abstract The project, codenamed Eyesrail_Dig, is for a recycling company (Tridel; LausanneSwitzerland). This company uses a train to transport the garbage that needs recycling, on a private railway road. The SBB-CFF-FSS (Swiss Federal Railways) train system used pushes the cargos containing the garbage to the factory, where they are emptied, and then pull them back on the same track to refill them. The problem is that when going toward the factory, the driver is completely blind. To solve this, Tridel, as well as all other Swiss companies that use the SBB cargo trains, uses two employees: one is in the driving chamber, and the other standing at the tip of the last cargo wagon, guiding the driver by radio. This method of driving is very dangerous. The solution is to replace the person standing at the tip of the train with a camera that sends the video stream wirelessly to the driver’s chamber. The system must be designed with EN50155 norm (Railway applications - Electronic equipment used on rolling stock) approved parts. The main task was to make complete mechanical and electrical designs, along with a Bill of Materials (BOM). A complete concept of an improved system, powered by a dual axis motorized solar panel, with the corresponding charger circuit, has been put in place. Key words: SBB cargo (Swiss Federal Railways) – IP camera – Antenna – Access pointEN50155 (Railway applications - Electronic equipment used on rolling stock) – Motorized solar panel Résumé Ce projet est pour une compagnie de recyclage (Tridel; Lausanne-Suisse). Cette compagnie utilise un train pour transporter les déchets à recycler, sur une route ferroviaire privée. Le système de train SBB-CFF-FSS (Chemins de fer fédéraux suisses) utilisé pousse les wagons contenant les déchets vers l’usine, où ils seront vidés, et puis les tire sur le même chemin. Le problème est que quand il a comme destination l’usine, le conducteur est complètement aveugle de ce qui est en avant. Pour résoudre ce problème, Tridel, comme toutes les autres compagnies qui utilisent les trains SBB cargo, ont besoin de deux employés: un pour conduire le train, et l’autre debout sur l’extrémité du dernier wagon, guidant le conducteur par radio. Cette méthode de conduction est très dangereuse. La solution est de remplacer le deuxième employé par une caméra qui envoie le flux vidéo par un moyen sans fil vers la chambre du conducteur. Le système doit être conçu en respectant la norme EN50155 (Les applications de chemin de fer - L'équipement électronique utilisé sur les matériels roulant ferroviaire). Le but principal est de concevoir un système complet avec les schémas électrique et mécanique correspondantes, les listes des matériaux choisis (BOM). Une conception complète d’un système amélioré, alimenté par un panneau solaire motorisé sur deux axes, avec le circuit de charge correspondant, a été finis. Mots clés: SBB cargo – caméra IP – Antenne – Access point - EN50155 – Panneau solaire motorisé Table of contents General introduction ............................................................................................................... 6 Chapter I-Presented solutions ................................................................................................ 8 I.1. Problem description ......................................................................................................... 8 I.2. Old system description ..................................................................................................... 8 I.3. Points to improve the system ........................................................................................... 9 I.3.1. Frequency band ......................................................................................................... 9 I.3.2. Modulation technique................................................................................................ 9 I.4. M12 vs RJ45 .................................................................................................................... 9 I.5. Power over Ethernet ....................................................................................................... 10 I.6. Other analogue system ................................................................................................... 10 I.6.1. Solution 2.4 GHz .................................................................................................... 10 I.6.2. Solution 5 GHz ........................................................................................................ 11 I.7. Digital solutions ............................................................................................................. 11 I.7.1. Industrial system (PoE-M12) .................................................................................. 11 I.7.2. Industrial system (PoE-RJ45) ................................................................................. 12 I.7.3. Industrial system (non PoE) .................................................................................... 12 I.7.4. Current LCD screen (PoE camera/antenna) ............................................................ 13 I.8. Power over Ethernet ....................................................................................................... 14 I.9. Power over Ethernet ....................................................................................................... 14 Chapter II-Camera side design............................................................................................. 15 II.1. Chosen components ...................................................................................................... 15 II.1.1. SNB-1001P ............................................................................................................ 15 II.1.2. TP-Link TLWA7510N .......................................................................................... 16 II.1.3. OCH2 enclosure .................................................................................................... 16 II.1.4. Battery ................................................................................................................... 16 II.2. OCH2 fixation .............................................................................................................. 17 II.3. Configuration ................................................................................................................ 18 II.3.1. TL-WA7510N ........................................................................................................ 18 II.3.2. IP camera ............................................................................................................... 18 II.4. Conclusion .................................................................................................................... 18 Chapter III-Locomotive side design ..................................................................................... 19 III.1. Design overview ......................................................................................................... 19 1 III.2. Smart LCD .................................................................................................................. 19 III.2.1. TEN 40-4812WIR ............................................................................................... 20 III.2.2. TEN 5-1211 .......................................................................................................... 20 III.2.3. Interior design ....................................................................................................... 21 III.3. Configuration .............................................................................................................. 22 III.3.1. TL-WA7510N ...................................................................................................... 22 III.3.2. Raspberry PI ......................................................................................................... 22 III.4. Conclusion ................................................................................................................... 22 Chapter IV-Solar panel design ............................................................................................. 23 IV.1. Introduction ................................................................................................................ 23 IV.1.1. Single axis ........................................................................................................... 23 IV.1.2. Dual axis ............................................................................................................... 23 IV.1.3. Energy generation comparison ............................................................................. 24 IV.2. Solar tracker ............................................................................................................... 24 IV.2.1. Description .......................................................................................................... 24 IV.2.2. Tracker components ............................................................................................. 25 IV.3. Microcontroller choice - Arduino nano ...................................................................... 25 IV.3.1. Description .......................................................................................................... 25 IV.3.2. Power .................................................................................................................... 26 IV.4. Sensor design ............................................................................................................. 26 IV.5. Stepper motor ............................................................................................................. 27 IV.5.1. Types of steppers ................................................................................................. 27 IV.5.2. Bipolar motor control-SN754410......................................................................... 29 IV.5.3. Motor and microcontroller interface .................................................................... 29 IV.5.4. Motor ratings and fixation .................................................................................... 30 IV.6. Tracker algorithm and block diagram ........................................................................ 30 IV.6.1. Algorithm ............................................................................................................ 30 IV.6.2. Block diagram ...................................................................................................... 31 IV.7. Voltage regulator design ............................................................................................ 32 IV.7.1. Solar panel’s specifications ................................................................................. 32 IV.7.2. Maximum Power Point......................................................................................... 32 IV.7.3. Circuit design ...................................................................................................... 33 IV.7.4. BQ24650 .............................................................................................................. 34 2 IV.7.5. TPS55340 ............................................................................................................ 34 IV.7.6. TPS84620 ............................................................................................................ 34 IV.8. Conclusion ................................................................................................................. 34 Chapter V-System test ........................................................................................................... 35 V.1. Test 1 ........................................................................................................................... 35 V.2. Test 2 ........................................................................................................................... 35 V.3. Test conclusion ............................................................................................................ 36 Conclusion .............................................................................................................................. 37 Annex A-Materials comparison ............................................................................................ 38 Annex B-Mechanical and electrical design .......................................................................... 54 Annex C-Configurations ....................................................................................................... 70 Annex D-Capacitor choice .................................................................................................... 76 Annex E-Raspberry PI configuration .................................................................................. 78 Annex F-Electronic circuit .................................................................................................... 81 Annex G-BOMs ...................................................................................................................... 97 Annex H-Overo gumstix ...................................................................................................... 103 References ............................................................................................................................. 113 3 Figures and tables list Figure I.1. Problem presentation ............................................................................................ 7 Figure I.2. Solution presentation ............................................................................................ 8 Figure I.3. View of the analogue system ................................................................................ 8 Figure I.4. RJ45-M12 connectors ......................................................................................... 10 Figure I.5. Solution 2.4 GHz block diagram ........................................................................ 10 Figure I.6. Solution 5 GHz block diagram........................................................................... 11 Figure I.7. Industrial system M12 solution block diagram ................................................ 11 Figure I.8. Industrial system RJ45 solution block diagram ............................................... 12 Figure I.9. Industrial system non PoE solution block diagram ........................................ 12 Figure I.10. Block diagram of the solution based on using the current LCD .................. 13 Figure I.11. Chosen solution block diagram........................................................................ 14 Figure II.1. Design schematic-camera side .......................................................................... 15 Figure II.2. Samsung SNB-1001P ......................................................................................... 15 Figure II.3. TP-Link TL-WA7510N ..................................................................................... 16 Figure II.4. OCH2 enclosure ................................................................................................. 16 Figure II.5. Yellow hook on SBB cargo trains..................................................................... 17 Figure II.6. On/Off magnet ................................................................................................... 17 Figure II.7. Magnet fixation .................................................................................................. 18 Figure III.1. Design schematic-locomotive side ................................................................... 19 Figure III.2. LCD screen ....................................................................................................... 19 Figure III.3. Black box content ............................................................................................. 20 Figure III.4. Black box interior design................................................................................. 21 Figure IV.1. Rotation axes of solar panel ............................................................................ 23 Figure IV.2. Power efficiency chart...................................................................................... 24 Figure IV.3. Solar tracker block diagram ........................................................................... 24 Figure IV.4. Arduino pins ..................................................................................................... 25 Figure IV.5. Sensor circuit design ........................................................................................ 26 Figure IV.6. Sensor fixation and protection ........................................................................ 27 Figure IV.7. Sun rays hitting the solar panel ...................................................................... 27 Table IV.1. Comparison between stepper motors............................................................... 28 Figure IV.8. Speed vs. torque chart...................................................................................... 28 Figure IV.9. H-bridge used to control bipolar motors ....................................................... 29 Figure IV.10. SN754410 interface with the motor and the Arduino ................................. 29 4 Figure IV.11. Gears on a mechanical dish ........................................................................... 30 Figure IV.12. Tracker algorithm chart ................................................................................ 30 Figure IV.13. Solar tracker block diagram ......................................................................... 31 Figure IV.14. Used solar panel.............................................................................................. 32 Figure IV.15. Solar cell I-V curve in varying sunlight ....................................................... 33 Figure IV.16. Charger circuit overview ............................................................................... 33 Figure V.1. Box fixed on the yellow hook during test ......................................................... 35 Figure V.2. Tunnel used by Tridel ....................................................................................... 36 5 General introduction The project, Eyesrail_Dig, is for a recycling company (Tridel; Lausanne-Switzerland). This company uses a train to transport the garbage that needs recycling, on a private railway road. The SBB-CFF-FSS (Swiss Federal Railways) train system used pushes the cargos containing the garbage to the factory, where they are emptied, and then pull them back on the same track to refill them. The problem is that when going toward the factory, the driver is completely blind. To solve this, Tridel, as well as all other Swiss companies that use the SBB cargo trains, uses two employees: one is in the driving chamber (locomotive side), he is completely blind of what is in front of the train, and the other employee standing at the tip of the last cargo wagon, guides the driver by radio. It is a very dangerous method, especially during the winter because the guiding person must stay out in minus zero degrees for a long period of time, with cold winds hitting him all along the way because of the train speed. MIS suggested to replace the guiding person with a camera system that will send the video signal to the driving chamber wirelessly. A system has already been designed, it is an analogue 2.4 GHz system. The track which TRIDEL uses is made of two parts, one in open air and the other inside a tunnel. In the tunnel part, the system worked very well, but once in open air, the video signal was cut off, and when it arrived, it was very noisy and not viewable. This is due to the noise coming from the commutation of the rail tracks, and from other trains passing by. The first part of the project was to present solutions to improve the current system, then once a solution has been chosen, to design and implement a “camera-transmitter/receiver-screen” outdoor system to transmit the image from the end of the train to the driver’s chamber. The system must be designed with EN50155 norm (Railway applications - Electronic equipment used on rolling stock) approved parts. The main task was to make complete mechanical and electrical designs, along with a list of the chosen materials (BOM). The second part is to design a motorized solar panel to recharge the battery feeding the camera, transmitter and antenna part, along with electrical and mechanical schemes, a list of the chosen materials, the algorithm used to follow the sun rays and the design of the charging circuit. The third part was a programming task. MIS has designed a Linux based camera equipped with Wi-Fi capability. The idea is to develop a truly autonomous camera, fed by a solar panel, which records images as long as there is motion and sends them via Wi-Fi to a remote PC. The solar panel and the motion detection part were already done by previous students, my task was to develop a program to send the images via Wi-Fi. In this report, I will first present the reasons why I have designed the system in a certain manner, detailing the technical causes and the electrical and mechanical schemes, then I will present a concept of a motorized solar panel to be implemented on the system, along with the sun tracking algorithm, and finally I will present the algorithm used to send the images from the camera via Wi-Fi. 6 Chapter I – System overview I.1.Problem description Fig.I.1. Problem presentation As you can see from the above picture, the track used by Tridel is comprised of 2 parts, one in open air where the train yard is, and the other inside the tunnel. The problem is that when going toward the factory, the driver can’t see in front of him and needs the second employee to guide him. 7 Fig.I.2. Solution presentation We can see from figure I.2. the solution to this problem. It is to replace the second employee with a camera facing the railway track, which sends the video stream to the driver’s chamber. I.2. Old system description The already designed system was made by two engineers that previously worked at the institute. It was based on the AWV365 analogue transmitter/receiver system, working on 2.4 GHz, coupled with D-link ANT24-0801 antennas. Fig.I.3. View of the analogue system As you can see from figure I.1, the old system was fixed at the end of the last cargo wagon, on the part that connects to other cargos to push them forward. The fixture was not very robust 8 since it is a simple metallic band that wraps around the metallic cylinder. It was very heavy (approximately 7 Kg) since it is made completely out of metal. The main problems with the old system were first that it took a long time to be fixed and unfixed, and Tridel needed to move the camera from one wagon to the other in the shortest time possible. The second problem was that the system cut off all the time when it functioned in open air, and sometimes inside the tunnel, when the antennas were not facing each other. I.3. Points to improve the system I.3.1. Frequency band The biggest advantage of 5 GHz over 2.4 GHz is that the former’s not susceptible to interference from the myriad wireless devices that uses 2.4 GHz, which are almost all of the devices we find everywhere such as Bluetooth devices, microwave ovens, alarm systems, wireless speakers… The 5 GHz has a wider wireless spectrum available compared to the 2.4 GHz[1], which leads to significantly better performance as the 5 GHz is commonly used for usage that requires uninterrupted throughput. That is why it is recommended for media streaming, or to transfer music, pictures, and video throughout, which is our case. As for the other band, which is 800 MHz, it was forbidden by law to use it in our system because it would interfere with other transmissions (digital terrestrial television, mobile broadband). I.3.2. Modulation technique The major advantage that digital modulation has over analog transmission is how it achieves greater fidelity. With analog modulation, any noise or interference that falls in the given frequency bandwidth gets mixed with the actual signal. Although there are a number of ways to mitigate noise, it will still cause some amount of degradation. Because digital modulation only recognizes 0’s and 1’s, any noise is virtually eliminated once the receiver discerns whether a “0” or a “1” was transmitted. Unless the signal is very badly distorted, the output signal will be literally identical to what was transmitted. So, a system based on digital modulation is a good choice to avoid losing the image. I.4. M12 vs. RJ45 Industrial Ethernet cabling requires connection solutions that are sturdy and reliable. The network plugs and sockets used so effectively and cheaply in the office are often not suitable in industrial systems where the connections are frequently subjected to humidity, drastic temperature changes, vibration and shock. 9 Fig.I.4. RJ45-M12 connectors As you can see in figure I.4, the M12 connectors are fixed via a thread to the plug, so they hold very firmly to it unlike the RJ45 connectors. The M12 4-pin plug connector with D-coding has already been defined as an Industrial Ethernet standard according to IEC 61067–2–101 Amendment 1. But due to the fact that the access points equipped with M12 connectors are much more expensive (more than 10 times) than the ones with RJ45, and the fact that the cables are also much more expensive, we were obligated to use an RJ45 access point with embedded antennas. I.5. Power over Ethernet Power over Ethernet technology describes a system to pass electrical power over Ethernet cabling, along with data. This means that a network device can be powered and operated using the same cable. [2] There are two standards for POE: The original IEEE 802.3af-2003 PoE standard provides up to 15.4 W of DC power (minimum 44 V DC and 350 mA) to each device. Only 12.95 W is assured to be available at the powered device as some power is dissipated in the cable. The updated IEEE 802.3at-2009 PoE standard also known as PoE+ or PoE plus, provides up to 25.5 W of power. I.6. Other analogue solutions I.6.1. Solution 2.4 GHz Fig.I.5. Solution 2.4 GHz block diagram We see in figure I.5. the block diagram of the solution based on a 2.4 GHz analogue system. It consists of using the same camera, LCD screen and the antennas but change the 10 transmitter/receiver couple to another one with a higher emission power, digital modulation and a better sensibility at the reception. Several manufacturer propose products that are more powerful than the Tx/Rx couple that the old system used for a price ranging from 45 to 430 CHF. It’s the most cost effective solution I.6.2. Solution 5 GHz Fig.I.6. Solution 5 GHz block diagram We see in figure I.6. the block diagram of the solution based on a 5 GHz analogue system. It consists of keeping the same camera, the same LCD screen but change the antennas to a 5 GHz ones, transmitter/receiver couple to another one that works on 5 GHz band, with a higher emission power, digital modulation and a better sensibility at the reception. Several manufacturer propose products that are more robust than the Tx/Rx couple currently used and that functions at 5 GHz for a price ranging from 57 to 260 CHF. The advantage of this solution is that the 5 GHz band is less noisy in comparison with 2.4 GHz. I.7. Digital solutions All of the following solutions can be used for both 2.4GHz and 5 GHz frequency. I.7.1. Industrial system (PoE-M12) Fig.I.7: Industrial system M12 solution block diagram We see in figure I.7. the block diagram of the solution based on a complete industrial system, powered by an M12 PoE switch, that displays on a rugged industrial screen. Advantages: -Low power consumption -Rugged industrial system 11 -Highly immune to vibrations and noises -100% compatible with the EN50155 norm Disadvantages: -High cost (~5000$) I.7.2. Industrial system (PoE-RJ45) Fig.I.8. Industrial system RJ45 solution block diagram We can see in figure I.8. the block diagram of the solution based on an industrial system powered by an RJ45 PoE switch, with a rugged industrial screen. RJ45 switches have lower immunity to vibrations but are much cheaper. (~500$ difference per switch). Advantages: -Low power consumption -Rugged industrial system Disadvantages: -High cost (~4000$) -Lower immunity to vibrations (compared to M12 switches) I.7.3. Industrial system (non PoE) Fig.I.9. Industrial system non PoE solution block diagram 12 We can see in figure I.9. the block diagram of a system powered by a non-PoE switch, that uses PoE injectors to provide power. We will use RJ45 because there are not any M12 injectors. Advantages: -Lower cost (compared to previous solutions) Disadvantages: -Higher power consumption (due to the addition of 2 injectors) -More complexity to the system (several DC-DC/AC-DC converters will be used to feed the injectors and the switches) I.7.4. Current LCD Screen (PoE camera/antenna) Fig.I.10. Block diagram of the solution based on using the current LCD screen We can see in figure I.10. the block diagram of a solution based on using the current LCD screen, with PoE enabled camera and antenna. In this solution we will use a PoE RJ45 switch with splitters to obtain power and Ethernet separately. The power will be used to feed the LCD screen and the Small Board Computer (SBC) and the Ethernet to provide data to it. Advantages: -Equilibrium between number of components and cost -Usage of the current LCD screen Disadvantages: -Not 100% immune to vibrations, noise and temperature variations 13 I.8. Chosen solution Fig.I.11: Chosen solution block diagram In figure I.11, we can see the block diagram of the chosen solution, based on using the current LCD screen, with a camera and an access point with embedded antenna that works on 12 VDC. The reason we need 12 VDC is the fact that almost all IP cameras work on that voltage, and that way we can feed the camera side part of the system directly from a battery, without dissipating any power in DC to DC converters. On the locomotive side, we will use a small board computer to decode the signal and feed it to the LCD screen that was used in the analogue system. I.9. Conclusion After we decided to design the system according to the above solution, we need to choose the appropriate materials, for the camera side, and detail the electrical and mechanical designs along with the configurations of the parts. Note: -Refer to Annex A to view the comparison lists between available products -In all of the report, camera side refers to the box where the camera will be put, and locomotive side refers to the train driver’s chamber -The blocks in white are the products that needs to be bought and in black are the ones we already have. 14 Chapter II – Camera side design II.1. Chosen components Fig.II.1. Design Schematic-camera side In figure II.1. we see the block diagram of the camera side. A battery will power the IP camera and the PoE injector of the antenna. The PoE injector will provide data and power to the antenna on a single Ethernet cable. II.1.1. SNB-1001P Fig.II.2. Samsung SNB-1001P The Samsung’s SNB-1001P seen in figure II.2 is a discreet general purpose VGA network box camera. The chosen camera must be of compact size to fit inside the OCH2 box, does not consume a lot of power and has the day/night mode feature, this was essential since there is a part of the train track that goes inside a tunnel. The chosen camera was a low cost one, having a dimension of 74.3x54.5x114.4mm, consumes a maximum of 3.4 Watts at 12 VDC and has the day/night mode feature. For our application, going up to HD resolution is not 15 beneficial since the driver only needs to see the track, and VGA resolution is more than enough for this purpose. II.1.2. TP-Link TL-WA7510N Fig.II.3. TP-Link TL-WA7510N In figure II.3, we see TP-Link TL-WA7510N, an access point with embedded antennas. As we previously said, the access point/antenna must be a 5 GHz one that is powered by 12 VDC. The TP-Link TL-WA7510N is powered by a passive 12 VDC Power over Ethernet injector. It has a high output transmission power and its reception sensitivity is optimized. It uses an embedded directional antenna, which was essential to limit the amount of noise produced by the system. With its weatherproof enclosure and lightning protection, its operating temperature of -30°C -> 70°C, it is suitable for outdoor applications. II.1.3. OCH2 enclosure Fig.II.4. OCH2 enclosure Figure II.4 shows the enclosure in which the camera side system will be held. It’s a weatherproof, lockable enclosure used for cameras. It does not weight a lot since it’s made out of heavy-duty aluminum. With its dimensions of 33x13.2x10.4cm, we can easily fit the camera with a high capacity battery inside it. II.1.4. Battery We need a battery that is enough to power the system during the work hours. When the work hours are finished, the employees will put the camera box to charge during the night. The work hours are usually 9 hours. During them, there are a lot of times where the camera is turned off, which is when waiting for the train to be fixed on the wagons and when going from the 16 factory toward the yard. We need a battery with enough capacity to power the system during the work hours. The chosen battery is a 12VDC 9800mAh lithium ion one. It has a protection circuit against overcharging, over discharging and over-current. Due to its internal charging circuit, it can be charged directly using a normal 220VAC to 12 VDC adapter. The maximum power consumed by the access point is 8 Watts, and by the camera is 3.4 Watts. So in theory, the system should run at least 10.3 straight hours. II.2. OCH2 fixation Fig.II.5. Yellow hook on SBB cargo trains Figure II.5. shows a standard yellow hook on the sides of all the cargo wagons in Western Europe. The OCH2 will be fixed on this hook, but a major criteria was to design a certain fast way to hook and unhook this box, because it needs to be moved from one wagon to the other all day long. After a discussion with the mechanical technician of HEIG-VD, we were able to design a fixation based on a switchable magnet. Fig.II.6. ON/OFF magnet The magnet seen in figure II.6 will stick the box to the yellow hook. Two small aluminum supports, as seen in figure II.7 will help to easily center the magnet, and forbid the box from falling on the rail track in case the magnet malfunctions. 17 Fig.II.7. Magnet fixation II.3. Configurations II.3.1. TL-WA7510N To access the TL-WA7510N configuration (out of the box), we must give the PC’s network adapter a static IP, 192.168.1.100 / 255.255.255.0 is a good choice because the access point is on the network 192.168.1.0. Now we can access the configuration page by entering 192.168.1.254 in the browser. The TL-WA7510N must be configured as an access point on the camera side with DHCP capability, so the small board computer can easily join the network, without having to configure its network interface. II.3.2. IP camera Since the driver shouldn’t check the camera’s IP every time he runs the system, the camera should be given a static IP, this way we can write a script to be run on the small board computer immediately after boot, to show the camera’s video throughput. II.4. Conclusion After we finished the design of the camera side, we need to put a complete concept for the locomotive side, with the electrical and mechanical designs along with the configurations of the parts. Notes: -refer to Annex B for details on the mechanical and electrical designs -refer to Annex C for details on the configuration procedure 18 Chapter III – Locomotive side design III.1. Design overview Fig.III.1. Design schematic-locomotive side As seen in figure III.1, we will use an AC to DC converter that respects the EN50155 norm, which is the European standard for “Railway applications - Electronic equipment used on rolling stock”, to provide 12 VDC to feed the access point’s PoE injector, the LCD screen and the 12 to 5 VDC converter which will feed the Raspberry PI, the chosen small board computer. III.2. Smart LCD Fig.III.2. LCD screen 19 The LCD screen seen in figure III.2, which was used in the analogue system, is powered by 12 VDC. Its frame is made of metal and it is fixed in the locomotive using magnets. We wanted to use the same LCD for this system. Fig.III.3. Black box content The idea is to make a sort of smart LCD, by adding a black box to it, which content can be seen in figure III.3, where the user will only have to feed it power and connect the right cables to get the video throughput on the screen, without having to configure anything. Since the LCD screen had only a composite input, the chosen SBC must have an adapted output. Raspberry PI model B was the best choice due to its low price, its capability to output on both composite and HDMI connectors and to decode HD videos. III.2.1. TEN 40-4812WIR The voltage supply from the locomotive is a 36VAC - 16⅔ Hz. According to the EN50155 norm [4], the voltage supply will vary from 70% to 125% the value of the nominal voltage (36VAC in our case), that means from 25.2 V to 45 V. Using a full wave diode bridge with a 10000µF smoothing capacitor, we will obtain an appropriate DC voltage for the Traco power TEN 40-4812WIR DC-DC converter, which has an input of 18 to 75VDC, an output of 12VDC – 3.3A and it has an EN50155 approval. III.2.2. TEN 5-1211 The TEN 5-1211 from Traco Power is a 12 to 5 VDC converter. It has an input marge of 9 to 18 VDC and an output of 5 VDC-1A, enough to power the Raspberry PI which consumes 700mA at maximum. We will use a NC push button to cut the power off the Raspberry PI in case it froze. 20 III.2.3. Interior design Fig.III.4. Black box interior design From figure III.4, we can see that the 12 VDC output of the Traco Power will feed the PoE injector via a DC jack. From it we will take 2 Ethernet cables: one connected to the LAN port of the PoE injector, this will go to the Raspberry PI, and one connected to the PoE port, this will go to the mounted connector. We will also provide power from the 36 to 12 VDC converter to the 12 to 5 VDC converter. From it we will power the Raspberry PI via a micro USB cable. Both the composite and the HDMI output of it will be provided outside the plastic box via the appropriate connectors. To make some sort of control over the components of the circuit, we will use a led on each of the outputs to monitor the states of the converters. An illuminated switch will prove that the box is provided with power, a red light will prove that 12 VDC is available and a green one will prove that a 5 VDC is available. The reason we are using different n-way connectors each time is so the user does not get confused and plugs a false input into a connector, for example, this way we can prevent the user from charging the battery of the OCH2 via the 36 VAC power provided from the locomotive. 21 III.3. Configurations III.3.1. TL-WA7510N The access point should be configured in bridge mode on this side. This way, the video signal data sent via Wi-Fi from the OCH2 box will be transferred to the Ethernet interface, and then we can decode it using the Raspberry PI. III.3.2. Raspberry PI We used Omxplayer to decode the video stream. It is a video player specifically made for the Raspberry PI’s hardware. The first stream test with the default settings gave a delay of 1 minute. By lowering the buffer size to 1MB, we obtained a delay of 20 seconds. This was due to the fact that the player was decoding both audio and video streams, even though the audio was muted from the camera’s configuration. After an upgrade to the camera’s firmware, this issue was fixed. The camera stopped sending audio stream, it was a bug in the old firmware. The delay became of 10 seconds. The only solution was to lower the buffer size even more. The smallest value was 0.05 MB, with it we obtained a delay of 1 second. By changing the configuration of the camera (different frame rate, bit rate, video type), we were able to arrive to approximately a delay of 0.3 seconds. Since the trains of Tridel do not transport the cargo at high speed, 0.3 seconds are acceptable for this application. For the final product, we might need to change the SBC to a more powerful one, like Intel nuc for example, to obtain a lower delay and approach real time video stream. III.4. Conclusion Now that we finished the design of the system, we will put the concept of an improved one where the battery of the camera box will be powered by a motorized solar panel. Notes: -refer to Annex B for the mechanical design - refer to Annex C for details on the TL-WA7510N configuration - refer to Annex D for details on the capacitor choice - refer to Annex E for details on the Raspberry PI configuration 22 Chapter IV – Solar panel design IV.1. Introduction Solar trackers are devices used to orient photovoltaic panels, reflectors, lenses or other optical devices toward the sun. Since the sun’s position in the sky changes with the seasons and the time of day, trackers are used to align the collection system to maximize energy production. Several factors must be considered when determining the use of trackers. Some of these include: the solar technology being used, the amount of direct solar irradiation, and the cost to install and maintain the trackers. There are many types of solar trackers, of varying costs, sophistication, and performance. The two basic categories of trackers, which can be seen in figure IV.1, are single axis and dual axis. Fig.IV.1. Rotation axes of solar panels IV.1.1. Single axis Solar trackers can either have a horizontal or a vertical axis. The horizontal type is used in tropical regions where the sun gets very high at noon, but the days are short. The vertical type is used in high latitudes where the sun does not get very high, but summer days can be very long. IV.1.2. Dual axis Solar trackers have both a horizontal and a vertical axis and thus they can track the sun's apparent motion virtually anywhere. Many traditional solar PV applications employ two axis trackers to position the solar panels perpendicular to the sun’s rays. This maximizes the total power output by keeping the panels in direct sunlight for the maximum number of hours per day. 23 IV.1.3. Energy generation comparison Fig.IV.2. Power efficiency chart As you can see from figure IV.2, the solar panels with dual axis trackers are much more efficient than fixed ones. The single axis tracker is not very logical for our system because the train can change its orientation in any moment, so the panel can’t be fixed along the east/west axis all the time. IV.2. Solar tracker IV.2.1. Description The system tracks the sun by relying on a set of sensors with a limited field of view. As the sun moves, it begins to shade one or more sensors, which the system detects and activates motors to move the device back into a position where all sensors are once again equally illuminated. Fig.IV.3. Solar tracker block diagram 24 Figure IV.3 shows the block diagram of the system, where the microcontroller will react on the 2 stepper motors according to the input of the sensing circuits. IV.2.2. Tracker Components The main elements of a tracking system are as follows: • Sun tracking algorithm: Some algorithms are purely mathematical based on astronomical references while others utilize real-time light-intensity readings. • Control unit: The control unit executes the sun tracking algorithm and coordinates the movement of the positioning system. • Positioning system: The positioning system moves the panel or reflector to face the sun at the optimum angles. Some positioning systems are electrical and some are hydraulic. • Drive mechanism/transmission: The drive mechanisms include linear actuators, linear drives, hydraulic cylinders, swivel drives, worm gears, planetary gears, and threaded spindles. • Sensing devices: For trackers that use light intensity in the tracking algorithm. IV.3. Microcontroller choice- Arduino Nano IV.3.1. Description Fig.IV.4. Arduino pins The Arduino Nano, seen in figure IV.7, is a small, complete, and breadboard-friendly board based on the ATmega328 (Arduino Nano 3.0) orATmega168 (Arduino Nano 2.x). There are many Arduino variations but this is the smallest in size and the cheapest in price. The reason this microcontroller is the best choice is because it has a built in library for the stepper motors, 25 so it is very easy to control precisely the position of the solar panel, and it is cheap compared to other solutions that offer the same capabilities. IV.3.2. Power The Arduino Nano can be powered via the Mini-B USB connection. In this conception, we will use the Arduino breadboard just for design purposes. In the final product, an ATmega328 should be used with the appropriate components as this lowers the power consumption to as much as a factor of 1/9 [5]. The ATmega328 is also powered via a 5V source. There are several ways to use the Arduino software to program the ATmega328 microcontroller [6] [7] . This is very helpful because it will make the control of the stepper motors much easier. IV.4. Sensor design The sensor is based on a photodiode. Its current output will arrive to approximately 1000 µA at a 10^4 luminance. By using the circuit seen in figure IV.4 which is a current to voltage converter, we will translate the luminance to a voltage output between 0 and 5V, typical for the Arduino’s ADC. Fig.IV.5. Sensor circuit design By using four of these sensors on each side of the panel, we can control its position on a 2 axis level. 26 Fig.IV.6. Sensor fixation and protection As seen in figure IV.5, these sensors will be put inside a PVC tube so we can limit their angle of view. A glass cover should be used to make them weatherproof. Because the sun rays are parallel, the sensors have to be fixed on each side of the panel in an inclined way. Fig.IV.7. Sun rays hitting the solar panel As an example, in figure IV.6, the output voltage of the left sensor will be higher than the right one, and the microcontroller will know from the difference that it has to lower the panel’s left side until the output of the two sensors become the same. IV.5. Stepper motor IV.5.1. Types of steppers There are two basic types of steppers, bipolar and unipolar. The bipolar stepper has 4 wires. Unipolar steppers have 5, 6 or 8 wires. The Unipolar Stepper motor has 2 coils, simple lengths of wound wire. The coils are identical and are not electrically connected. Each coil has 27 a center tap - a wire coming out from the coil that is midway in length between its two terminals. The reason for this is to reverse the current. The Bipolar Stepper motor is very similar except that the motor coils lack center taps. Because of this, the bipolar motor requires a different type of controller, one that reverses the current flow through the coils by alternating polarity of the terminals, giving us the name Bipolar. A Bipolar motor is capable of higher torque as we can see from table IV.1 and figure IV.8, since entire coils may be energized, not just half-coils, which is beneficial in our case (more torque with the same motor weight). Where 4-wire steppers are strictly 'Bipolar', 5 and 6 wire motors with center-taps can be used with the bipolar controller as parallel or series bipolar motors, depending on the way the coils are joined. Connections Resistance (Ohms) Inductance (mH) Current (A) Voltage (V) Holding Torque (oz-in) Unipolar Same as NamePlate Same as NamePlate Same as NamePlate Same as Same as NamePlate NamePlate Bipolar Series NamePlate X 2 NamePlate X 0.707 NamePlate NamePlate X 1.414 X 1.414 Bipolar Half Coil Same as NamePlate Same as NamePlate Same as NamePlate Same as Same as NamePlate NamePlate Bipolar Parallel NamePlate X 0.5 NamePlate X 4 Same as NamePlate NamePlate X 1.414 NamePlate NamePlate X 1.414 X 0.707 Table.IV.1. Comparison between stepper motors types Fig.IV.8. Speed vs. torque chart The H-bridge seen in figure IV.9, is used to reverse the current through the coil by closing the appropriate switches - AD to flow one direction then BC to flow the opposite. 28 Fig.IV.9. H-Bridge used to control bipolar motors IV.5.2. Bipolar motor control-SN754410 The SN754410 is a quadruple high-current half-H driver designed to provide bidirectional drive currents up to 1 A at voltages from 4.5 V to 36 V. Drivers are enabled in pairs with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. A separate supply voltage (VCC1) is provided for the logic input circuits to minimize device power dissipation. Supply voltage VCC2 is used for the output circuits. The SN754410 is designed for operation from −40°C to 85°C. IV.5.3. Motor and microcontroller interface Fig.IV.10. SN754410 interface with the motor and the Arduino In figure IV.10, we can see the connections between the H-bridge, the Arduino and the motor. The connector at the OCH2 box is a 4-way one capable of providing up to 5A. To recharge the 12V battery, we are only using 2 pins. We can use the other 2 to take power from the battery to the motors and the microcontroller. This is essential to be able to catch the sun in case the solar charger is not working anymore due to not enough power being produced (sun was lost, rain,…). 29 IV.5.4. Motor ratings and fixation Depending on the chosen gears that will rotate the panel around the two axis, the torque of the motors must be chosen. The voltage rating of the motors must be of 12 V, in accordance with the lithium battery. The mechanical fixation of the motors with the gears could be similar to the one used with satellite dishes, as seen in figure IV.11. Fig.IV.11. Gears on a mechanical dish IV.6. Tracker algorithm and block diagram IV.6.1. Algorithm Fig.IV.12. Tracker algorithm chart 30 The algorithm chart seen in figure IV.12 is as follows: the output of the four light sensors, fixed at each side of the solar panel, will be connected to the Arduino’s analogue input. The Arduino will then calculate the difference between them and move the solar panel accordingly. For example if the north sensor has a higher voltage than the south one, this means that the sun’s rays are coming from the north of the panel but are not perpendicular to it. We then need to operate the motor connected to the north/south axis a number of steps proportional to the difference in voltages between the sensors, to rotate the panel towards the north. If the output of all the sensors is small, this means that the sun went down and that it’s time to return to the initial position, where the panel is perpendicular to the solar rays at sun rise. The sun moves one degree east to west every 4 minutes. An error of 5 degrees in “x” or “y” represents a loss of 0.4% from the panels. But in our application, the train could change its direction at any given moment. So the value of “y” should be made according to the train track (straight, curvy,…). To be able to track the sun in case of clouds, the value of the voltages to be considered zero must be studied very carefully, because even if there are clouds in the sky, there is always a bright point (the brightest cloud in this case), and voltages read during a cloudy day must be differentiated from those read when the night comes. IV.6.2. Block diagram Fig.IV.13. Solar tracker block diagram As seen in figure IV.13, the photodiode based sensors will be connected to the analogue input of the microcontroller. The digital output of that last one will be used to control the Hbridge drivers of the bipolar stepper motors, which will move the panel either around the north/south axis or the east/west one. 31 IV.7. Voltage regulator design IV.7.1. Solar panel’s specifications Product Name Lux.Pro DSP 20M Dimensions (H x W x D) mm 468 x 350 x 25 Weight in kg 2.34 Cell type Mono Cells per module 18 pcs. Power max. 20W Voltage max. 9.12 V Current max. 2.25A Open circuit voltage 10.94 V Short circuit current 2.71 A The solar panel is equipped with an aluminum frame and hail-resistant safety glass, as seen in figure IV.14. On the back there is a waterproof junction box. Fig.IV.14. Used solar panel IV.7.2. Maximum Power Point The solar cell V-I characteristic is nonlinear and varies with irradiation and temperature, as seen if figure IV.15. In general, there is a unique point on the V-I or V-P curve, called the Maximum Power Point (MPP), at which the entire PV system operates with maximum efficiency and produces its maximum output power. The location of the MPP is not known, but can be located, either through calculation models or by search algorithms. Therefore Maximum Power Point Tracking (MPPT) techniques are needed to maintain the PV array’s operating point at its MPP. 32 Fig.IV.15. Solar cell I-V curve in varying sunlight The line that intersects the knee of the curves is where the maximum power point is located. A device should be used to find this point in order to harvest the maximum power. IV.7.3. Circuit design Fig.IV.16. Charger circuit overview The maximum power point tracker is bq24650, an IC from Texas instruments that is based on a buck converter. The battery we used for the OCH2 is a 12 VDC one that charges at 12.6 VDC, so we need a boost converter to supply the right voltage to it. The bq24650 provides,as seen in figure IV.16, via 2 connected LEDs to its output, a kind of a control signal over the status of the charger (charge complete, charge in progress,…). From the battery we will use a 33 buck converter to provide a 5V supply to the Arduino. The reason we need this architecture is because 5V batteries do not exist. IV.7.4. BQ24650 The bq24650 is a highly integrated switch-mode battery charge controller. It provides input voltage regulation, which reduces charge current when input voltage falls below a programmed level. When the input is powered by a solar panel, the input regulation loop lowers the charge current so that the solar panel can provide maximum power output. The bq24650 supports a battery from 2.1V to 26V with VFB set to a 2.1V feedback reference. The charge current is programmed by selecting an appropriate sense resistor. The input of this IC will be 9.12V-2.25A, those are the specifications of the solar panel. The output will be 5V-4A. IV.7.5. TPS55340 The TPS55340 is a monolithic non-synchronous switching regulator with integrated 5A, 40V power switch. It can be configured in several standard switching-regulator topologies, including boost, SEPIC and isolated flyback. The device has a wide input voltage range (2.9V to 32V). The use of this device in our solar charger will be to boost the 6V output of the bq24650 to a 12.6V, the ideal voltage to charge the battery. IV.7.6. TPS84620 The TPS84620RUQ is an easy-to-use integrated power solution that combines a 6-A DC/DC converter with power MOSFETs, an inductor, and passives into a low profile, BQFN package. This total power solution allows as few as 3 external components and eliminates the loop compensation and magnetics part selection process. With its efficiencies of up to 96%, its wide-output voltage adjust of 1.2 V to 5.5 V, and its operating temperature range of –40°C to 85°C, it is a good choice to convert the 12VDC output of the battery to a 5VDC one to power the Arduino. IV.8. Conclusion The design of the whole system is finished. Now we should run some tests to see if the new system has ameliorated over the last one, and see which points in the current design need to be further improved. Note:-refer to Annex F for the electronic circuits of the solar design and their calculations 34 Chapter V – System test V.1. Test 1 In this test, we tried to compare the range between the old analogue system and the new digital system. The test went in the garage of the firm with the antennas facing each other directly. The analogue system was able to transmit the image without any problems for approximately 100 meters, but after that the signal was cut off. The digital one on the other hand ran for a distance of approximately 400 meters, so there was a 4 times improvement over the last system. V.2. Test 2 This test went on the train used by Tridel. We did several tries with different antennas positions. On the first try, the antennas were fixed as previewed in the design. The system ran very well, the signal got cut off for less than 1 second, 2 times during the whole trip from the yard to the factory. This trip takes approximately 11 minutes, so the performance of the system is very acceptable. The magnet we bought was not efficient to hold the box to the yellow hook so for the test, we used a silk band to fix it, as you can see from figure V.1. Fig.V.1. Box fixed on the yellow hook during test 35 On the second try, we fixed the antenna under the yellow hook. The signal got cut off several times due to the fact that the antennas are not facing each other’s directly this way, because of the curvy route of the train. V.3. Test conclusion To fix the antennas the best possible way, they should be extended to the maximum, away from the yellow hook on the camera side and the SBB cargo wagon on the locomotive side. This way the antennas will have the best possibility to view each other. In the tunnel, we don’t have this problem because of the strong reflection of the 5 GHz band on the walls. For the camera configuration, the SSDR should be turned to a high level to obtain a clear picture in the tunnel, because the lights in the tunnel, seen in figure V.2. will make the picture blurry in night mode. Fig.V.2. Tunnel used by Tridel For the tests, the raspberry pi’s box was not finished so we used VLC player on a laptop to decode the video stream. By changing the configurations of the camera, we clearly saw that the mpeg configuration gave a lower delay than the h.264 one. It was almost without any delay when the VLC player was configured with a low buffer size of 200ms. 36 Conclusion During these 4 months, I was able to finish the complete design of the railway camera system and to put the concept of a motorized solar panel to feed it. This project, Eyesrail_DIG, will continue to develop with other students and technicians until it becomes a product ready to be sold to the Swiss companies using SBB cargo wagons. Since the test ran smoothly when the antennas were fixed as previewed, further development of the product should be based on this report, especially since all the electrical and mechanical designs, BOMs and configurations are detailed. This project was a bit challenging but very interesting. It was a real engineering project that gave me a lot of expertise in the field of systems design, both on the electrical and mechanical level. I was also able to learn more about the solar panels and how they are controlled, and the basics of socket programming. In these 4 months, I have used a bit of all the things I have learned from my university, from telecommunications to improve on the analogue system, to sensors design to use them on the solar panel, to microcontroller architecture to choose the right microcontroller to control the motors, to power electronics to choose the right converters,… As for the Overo gumstix, it still needs a lot of work. The configurations of the program that registers the images in case of motion needs to be changed, and the Wi-Fi needs to be fixed so it can become a true autonomous camera. Note:-refer to Annex I for the Overo gumstix part 37 Annex A- Materials comparison A.1. Analogue Solution Tx/Rx products TX Power 1w 1.5w 0.5w na na na 2w 2.5w 3W 3w 0.1w RX Power Na Na Na Na Na Na Na Na Na Na -86dBm Price 45 45 49 50 62 64 65 74 153 255 179 Description 2.4ghz 1w 4-ch 2.4GHz 1.5W 4-CH 2.4GHz 0.5W 2.4GHz 4-CH 2.4 GHz Wireless 2.4Ghz Wireless 2.4GHz Wireless Audio and Video 2.4GHz 2.5W 6-CH 2.4GHz 3W 6-CH 8CH Video Audio 2.4GHz 3W 1000 Foot Digital Manufacturer Bada na Bada Pakite Terk Technologies Na Na bada bada SaferGuard Na Reference number 19828 20507 19761 E17762 LF-30S AG29269 25582 19829 961019830 SPB0196G PD24-D100 189 Compact Digital Na KW2400 429 LONG RANGE 3 MILE WEATHERPROOF 2.4 GHz Wireless Digital Video Sender 2.4GHz Digital Wireless 5.8GHz Wireless A/V STB 5.8GHz 1W Wireless Transmitter 5.8GHz Wireless A/V 5.8GHz Wireless AV Sender Wireless 8-Channel Indoor 5.8GHz 400mw AV Wireless 5.8GHz Wireless 8-Channel Indoor Na PD24-RSPL RF-link DAV-2450 -85dBm -90dBm Na Na Na Na -90dBm -25-> -84dBm Modulation 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz16QAM/QPSK/BPSK 2.4GHz16QAM/QPSK/BPSK 2.4GHz16QAM/QPSK/BPSK 2.4GHz-BPSK, QPSK, 16QAM 2.4GHz-QPSK 5.8GHz 5.8GHz 5.8GHz 5.8GHz 5.8GHz 5.8GHz 5.8GHz-FM 0.1w -81dbm 0.2w -85dBm 18dBm(0.06w) -80dBm 0.01w na 1w na na na 0.4w na Rhinoco Pakite Na Na RF-link RF-link Na RF-link AVTXRX2.4 PAT-530 155954 AG29270 AVS-5811 AVS-5808-RX RC305+TX5400 AVS-5808 0.5w 0.8w 1.5w Na Na Na 900Mhz 900MHz 900MHz 149 189 219 900 MHZ 500MW 800MW 900 MHZ Long Range 900 MHz 1.5 Watt Na Na Na PD9-500 PD9-800 PD9-1500 142 na 57 77 81 104 148 100 260 38 A.2. Digital solution Tx/Rx products TX Power - RX Power - Modulation - Price 100->450 27dBm 25dBm 27dBm 29dBm 27dBm 26 dBm 17dBm 18dBm 29dBm 27dBm -73->-95dBm -75->-95dBm Na -73->-97dBm Na -67->-88dBm -68->-87dBm Na -73->-97dBm -74->-89dBm 2.4-5GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHZ 2.4GHz 2.4GHz 2.4GHz 2.4GHz 2.4GHz 455 63 85 88 91 110 206 240 247 251 22-26dBm 15-20dBm -74 -> -94 dBm -72->-94dBm 2.4GHZ 2.4GHz 430 880 28dBm 27dBm Na Na 5GHZ 5GHZ 89 233 23-28dBm 21dBm -73 -> -95dBm -97dBm 5GHZ 900MHz 350 1400 Description Cisco Small Business Wireless-G Exterior Access Point Dual Radio 802.11n Wireless Outdoor Access Point Long-Range Wireless 2.4GHz Outdoor Bridge Wireless-N Long Range AP(omni directional) Long-Range Multiple Client Bridge/AP Wireless-N Outdoor Client/Bridge/AP(directional) N150 Wireless Outdoor PoE Access Point Wireless 300N Outdoor PoE Access Point Hi-Gain Outdoor Multifunction Access Point Wireless-N Outdoor Access Point 14dBi High Power Wireless Outdoor PoE Access Poin Outdoor, Weatherproof, 3 Mile Cisco Aironet 1300 Series Outdoor Access Point/Bridge Long Range 802.11n Outdoor Bridge AP 12dBi N300 Wireless 5GHz Outdoor PoE Access Point Outdoor,weather proof Video Surveillance Transmitter, 900Mhz Manufatrurer Cisco Reference number WAP series(see PDF) EnGenius EnGenius EnGenius EnGenius EnGenius Trendnet Intellinet network solutions Hawking technology EnGenius Trendnet ENH700EXT ENS200 ENH200EXT ENH202 ENH200 TEW-715APO 524711 HOWABN1 ENH210EXT TEW-455APBO cctvcamerapros Cisco EnGenius Trendnet WIFI-NAN72B AIR-BR1310G-AK9-R ENH500 TEW-676APBO cctvcamerapros cctvcamerapros WIFI-EH9500 WIFI-900XTRP 39 A.3. IP Cameras Resolution (max) 640 x 480 Frame rate (max) Dimensions(mm) 100 640 x 480 1280 x 800 1280 x 1024 1280 x 1024 Power consumption 12 VDC Max 3.3W 12 VDC Max 5W 12 VDC Max 6W 12 VDC Max 3.7 W 12 VDC Max 5.6W 12 VDC 8.6W 12 VDC Max 4W 12 VDC 3.3W 12 VDC Max 4W 1600 x 1200 12 VDC 8w max 640 x 480 640 x 480 640 x 480 640 x 480 Price Manufacturer 109.7 x 44 x 29 Operating temperature(°C) -10 -> 50 800 Basler Reference number BIP2-640c-dn 30 25 30 85 (φ) x 265 155 x 82 x 80 74.3 x 54.5 x 114.4 -30 -> 50 -5 -> 45 -10°C ~ +50°C 350 71 325 Zavio TENVIS Samsung F731E IP602W SNB-1001P 30 Ø86.8 x 304.6 -10 -> 50 400 Samsung SNO-1080R 30 30 30 30 188.5 x 91.6 x 85.2 Ø: 60 x 170 67 x 55 x 129.5 80 x 166.8 x 62 -20 -> 50 -20 -> 50 0 -> 50 0 -> 40 340 250 420 350 Ganzg Vivotek ACTI D-link ZN-B1A IP8332 ACM-5611 DCS-3110 30 72x 154 x 62 0 -> 50 400 Vivotek IP7161 40 A.4. LCD Size (inches) 17 Power Input Price Description Manufacturer Ref. number VGA Dimensions (cm) 36.6x30.2x5.8 100-240V 43 Samsung LS17HALJBY AC 100-240V VGA 37.8x14.2x27.9 60 Hannspree HL161ABB 20 19 26W 16.5W VGA-DVI VGA Na Na 90 92 HP Acer W2072a ET.CV3WP.E05 17 100V-240V13.9W VGA 36.8x37.5x16 125 Acer V173DJb 21.5 20 36W 30W HDMI-DVI HDMI-VGA Na 47.5x30x5.3 145 160 Asus Samsung VS229H-P S20B350H 17 100 - 240v-20 W VGA-DVI 37x31.4x6.8 160 Samsung B1740R 15 VGA 33.4x6x29.6 180 Planar PL-PL1500M 21.5 AC 100240V;25W 30w HDMI-VGA 50.8x32x5.3 190 Samsung S22B350H 17 17 Na Na HDMI-VGA HDMI-VGA Na 38.5x6.5x33.5 200 226 Samsung SyncMaster 740N LCD Monitor (Refurbished) HannsG 16" Wide 1366x768 LED Monitor, VGA LED-Backlit LCD Monitor, Black 50,000:1 5ms VGA LCD Monitor (Black) ET.CV3WP.E05 LCD Monitor (EPEAT) with 1280x1024 Resolution, 20,000:1 Dynamic Contrast Ratio, 250cd/m2 Brightness Widescreen LED Backlit LCD Display Widescreen LED Backlit Monitor - 1600 x 900, 16:9, LCD Monitor - 5ms - 1280 x 1024 - 16.7 Million Colors - 250Nit - 1000:1 15 inch 700:1 8ms VGA LCD Monitor, w/ Speaker (Black) - 997-5905-00 Class Widescreen LED Backlit Monitor 1920 Eversun SH17 CCTV LCD Monitor 1280X1024, SXGA, 4:3, 250CD, 15.6 Eversun Everfocus E159-1014 EN7517HDMIA 41 A.5. M12 PoE Switch Number of POE ports 4 Total number of ports 8 Max Power (per port) 15 Power supply Dimensions (cm) Price Description Manufacturer Ref. number 24-48VDC 9.2 x 18 x 4.2 735 Advantech EKI-6528TPI-AE 4 8 15 48 VDC/1.6A na 899 moxa TN-5308-4PoE-48T 8 8 30 24VDC 19.2x14.5x12 1700 Korenix JetNet 6810G-M12 8 12 30.8(61.6 W ±7% distributed on all PoE ports) 14.2x10x11 2628 Westermo Viper-212-P8 ordered Ordered Ordered 48 to 110 VDC 1.7 A @ 48 V, Max 0.74 A @ 110 V Ordered EN50155 8xM12 Unmanaged Switch w/ PoE Unmanaged Ethernet switch with 4 10/100BaseT(X) ports and 4 PoE ports 8+2G Managed PoE Switch managed EN 50155 PoE Routing Switch na na Kyland SICOM5208R 2 8 Na 24/110 VDC 22x13x7 na men 06RS02 8 10 15 48VDC 21.7x14x6.6 na Ordered with respect to need (port number, poe ports, unmanaged, …) RS2 - IP67 Industrial Ethernet Managed Industrial Switch w/8 PoE Injectors Lantech IPES-2208-M12-65 42 A.6. RJ45 PoE Switch Number of POE ports 4 Total number of ports 8 Max Power (per port) Power supply Dimensions (cm) Price Description Manufacturer Ref. number 15 7.5V DC/1A 23.5 x 10 x 2.7 54 NETGEAR FS108P 4 8 15 18.2x26x4 56 ZyXEL ES1100-8P 4 8 15 100240VAC/1.5A 48V/0.8A 17.1 x 9.8 x 2.9 60 TRENDnet TPE-S44 4 8 15 48V DC/1.45A 17x10x2.8 86 D-Link DES-1008PA 4 4 8 8 15 15 12VDC/1.0A 48VAC/1.875A 16x12.8x3 12x19x3.8 100 116 Cisco Fortinet SG100D-08P-NA FS-80-POE-US 4 4 8 5 35 35 21x10.4x2.8 15.9 x 11.8 x 4 140 170 Zyxel Tycon GS1100-8HP TP-SW5G-24 8 8 35 26.4x16x4.3 221 TPE-T80 5 8 15 35 9.7x3.8x9 28x18.5x4.3 279 316 TPE T80 PoE+ Switch Switch - 8 ports Industrial PoE Ethernet 8-port Gigabit Poe Plus Switch TRENDnet 4 8 120-230 VAC 1036VDC/90W 120-230 VAC/250W 48VDC/2A 110-220 VAC 8 Port 10/100 Desktop Switch with 4 Port PoE Switch 8-Port ES1100-8P 10/100 PoE Switch 8-Port 10/100Mbps PoE Switch 8-Port Metal Desktop Switch with 4 PoE Ports Unmanaged Switch SF FortiSwitch 80-POE Gigabit Ethernet Switch - 8 ports - unmanaged 802.3af PoE Gigabit Switch N-tron Cp tech 105TX-POE GEP0822 43 A.7. Rugged industrial displays Size(inch) 10.1 OS Windows 7 Pro Dimensions(cm) 26.3x17.1x3.7 Power supply 12~24V DC - 25W Connector RJ-45 Price na 10.4 10.4 Windows 7 Pro Windows XP Embedded 28.5x24x7 22x31x9 12V DC/24V DC-10W 24VDC/ 110VDC-20W na M12-RJ45 2295 na 10.4 Windows XP Embedded 22x31x9 24VDC/ 110VDC-20W M12-RJ45 na 10.4 10.4 12.1 Windows 7 Pro na Windows 7 Pro 28.6x25.4x8.4 33.9x25.6x7.2 33x25.4x8.4 50W typ-80W max 9 to 36 V DC-26 W 50W typ-80W max na RJ45 na na na na Description 10.1" Panel PC-touch screen-POE Waterproof LCD-PC Human Machine Interface Intel® Atom based with 32 Hardkeys Human Machine Interface Intel® Atom based with Touch 10" smart display 10.4" Marine Panel PC 12" smart display Manufacturer Winmate Small PC Kontron Ref. number W10ID3S-PCH1PoE SDC100 HMITR-104-AKT1-24 Kontron HMITR-104-ATT1-24 Barco Winmate Barco SV-126 R10A83S-MRM2 SV-231 44 A.8. SBC (Single Board Computer) 45 46 47 48 49 50 51 52 53 Annex B-Mechanical and electrical design B.1. Antenna fixation - camera side This mount will be fixed on the OCH2 in a sandwich way, to prevent the user from opening the camera enclosure. The two U-supports are fixed together using two 18.5 bars. On top of one of the U- supports, the antenna support will be fixed to which the antenna holder is screwed. The access point has two holes specially made so it can easily be fixed with the plastic straps that came with it. On the bottom of the U-shaped support, two small U-supports will be screwed. Fig.B.1. 3D view of the antenna Cutting the edge of the access point holder where the plastic straps will take place, will make it hard for the access point to move around. Fig.B.2. Access point fixation with plastic straps 54 B.2. Camera fixation The standard camera mount is a ¼-20 screw. Samsung’s SNB-1001P comes with a thread for this screw on its lower end. Fig.B.3. Camera lower view Fig.B.4. ¼-20 screw The OCH2 camera housing comes with a plastic plate specially made to fix cameras on it. By screwing the camera with a ¼-20 screw and fixing it with 2 plastic straps, the camera will be fixed on the plate robustly. Fig.B.5. Plastic plate 55 B.3. Battery and PoE INJECTOR fixation B.3.1. Description The available space in OCH2 is 30x10x8 cm. The camera with the objective will take a space of 16.04 cm so 13.96 cm are available. By designing a metallic plate of 13.3x8 cm with the appropriate fixation, we can put the battery and PoE on top of each other: 0.3(metallic plate) +4(battery) +0.3(U-support) +2.1(PoE injector) =6.7 < 8 cm This plate will be used to hold the battery and the PoE. It has 8x0.3cm holes where M3 screws will be used to fix the U-supports on the plate, and the plate on the OCH2, 2 long holes to regulate the position of the battery. The battery will be fixed in place due to the M4 hexagon nuts. Fig.B.6. 3D view of the battery and PoE fixation B.3.2. Battery’s dimensions 56 B.3.3. PoE injector’s dimensions B.3.4. Battery plate This plate will be used to hold the battery and the PoE. It has 8x0.3cm holes where M3 screws will be used to fix the U-supports on the plate, and the plate on the OCH2, 2 long holes to regulate the position of the battery. The battery will be fixed in place due to the M4 hexagon nuts. Fig.B.7. Metallic plate dimensions 57 Fig.B.8. Metallic plate 3D view B.3.5. Battery holder Fig.B.9. Battery holder 3D view 58 Fig.B.10. Battery holder top view B.3.6. Battery and PoE injector assembly Here we see the complete design with the battery (blue box) and Poe injector (green box). We need one metallic plate and 2 U-supports. Fig.B.11. System assembly method 59 1. Place the battery on the plate 2. Fix the battery holder with 4 M3 screws 3. Regulate the battery position and fix it with 2 M4 screws and nuts 4. Fix the PoE injector with 2 M3 screws Quantity 2 2 2 4 2 1 Description M4 nut M4 6mm screws M3 4mm screws M3 6mm screws Battery holder Battery plate Table B.1. Material quantities needed for the battery and PoE support B.4. Antenna fixation B.4.1. 18.5 bar This bar will be used to hold the 2 U-supports and the 2 small U-supports together. For this purpose, two 3 mm holes will be cut on each side. Fig.B.12. Side view Fig.B.13. Top view 60 Fig.B.14. 3D view B.4.2. U-support This support will be used to fix the system on the OCH2 and to hold the access point support. For this purpose, three 3 mm holes will be cut on each side. Fig.B.15. Side view Fig.B.16. Top view 61 Fig.B.17. 3D view B.4.3. Small U-support This support will be used to fix the mount on the OCH2. Fig.B.18. Holes type Fig.B.19. Top view 62 Fig.B.20. Side view B.4.4. Antenna support The part will be used to hold the antenna holder to the U-support with a 3 mm screw and nut. Between these 2 parts we will use a metallic circle to prevent the deformation of the parts. Fig.B.21. 3D view B.4.5. Antenna holder On this part, the access point will be fixed with the plastic straps. The 135 angle will allow the antenna to be held vertically for maximum signal (since the antennas are directional). 63 Fig.B.22. Lower part Fig.B.23. Upper part Fig.B.24. 3D view 64 Quantity 8 1 1 1 1 4 2 2 2 Description M3 8mm M3 16mm M3 nut Antenna holder Antenna support 18.5 bar U-support Small U-support Plastic straps Table B.2. Material quantities needed for the antenna support B.5. Mechanical design-locomotive side B.5.1. Box design Fig.B.25. Black box On side 1 we will fix the RJ45 feedthrough connector, the illuminated switch and the 5-way plug. Fig.B.26. Representation of side 1 On side 2 we will fix the composite and the HDMI connectors to connect the Raspberry PI’s video output to the LCD display. A 2-way connector connected to the 12 VDC power supply will be 65 used to feed the LCD display. In case the Raspberry PI froze, the NC push button will fix this problem by cutting off the 5 VDC power from the USB cable. Fig.B.27. Representation of side 2 On side 3 we will fix 2 led lights connected to the 5VDC and 12 VDC output to provide power a control signal in case the converters broke. Fig.B.28. Representation of side 3 B.5.2. Box fixation The LCD screen currently used has a magnet on its back, fixed to it via an M5 screw and a nut. By cutting a 5mm hole on the plastic box and using this screw, and by adding two 3mm ones, the box will be fixed robustly on the metallic support of the LCD screen. 66 Fig.B.29. Box interior view Fig.B.30. Top view Using the above dimensions, we will get a 9.75 cm space between the LCD screen and the plastic box, enough to connect the cables and press the push button in case the Raspberry PI froze. B.5.3. TL-WA7510N fixation The antenna will be fixed on the SBB cargo wagon using a strong magnet. The antenna has to be straight, directly facing the one of the camera. Like on the camera side, we will use plastic bands to fix it on the aluminum bar, which has holes to forbid it from slipping. Fig.B.31. TL-WA7510N fixation on the locomotive side 67 B.6. Electrical design – Camera side B.6.1. Cable section calculation The max current that will be drawn from the battery on a single cable is 2A, it is the current used to charge the battery from the 2A DC charger. Using a DC cable section calculator [3], for a 12VDC-2A, with an acceptable loss of 1%, at a distance of 20 cm, 0.5 mm2 cables can be used. So inside the camera box, 0.5mm2 cables will be used to feed the PoE injector, the camera, and to charge the battery. B.6.2. Electrical wires connection Fig.B.32. Wires design overview The switch, 4-way connector and fuse housing must be IP67 protected, which means against dust and water, because they are exposed to open air. The 4-way connector, with a protection cover, is an industrial one capable of resisting shocks and vibrations. The reason we need a 4-way connector and not a 2-way is to implement a motorized solar panel in a future design (refer to chapter IV). The chosen switch is IP67 protected due to a protection cap. On one end of it, we will solder the 2 cables coming from the battery, on the other end, we will have 4 separate cables, 2 for the PoE injector with a DC jack at the end, and 2 for the camera. The PCB between the battery and the connector is formed of a diode bridge rectifier IC with a 10A slow time fuse. The fuse will protect the battery in case of a short circuit, and the diode bridge will protect it in case the polarization got inversed. 68 To protect the parts in case of a short circuit, we will use a fuse housing where a 5A time delayed fuse will be used, and connect the positive cable to it. On the other end, we will solder 2 cables, one to feed the PoE injector and the other to feed the camera. B.6.3. Ethernet wires connection OCH2 has a hole on its floor to take the cables outside. The PoE cable that must be led to the antenna will be taken through this hole. A small LAN cable will connect the camera to the LAN port of the PoE injector. Fig.B.33. Interior Ethernet interface Fig.B.34. Outdoor Ethernet interface 69 Annex C-Configurations C.1. TL-WA7510N configurations C.1.1. Static IP To access the TL-WA7510N configuration (out of the box), we must give the PC’s network adapter a static IP. Connect one end of an Ethernet cable to the POE port of the provided Power Injector and the other end of the Ethernet cable to the LAN port of the TL-WA7510N. Then, connect the LAN port of the Power Injector to a PC using another Ethernet cable. Finally, plug the provided power adapter into the DC jack on the Power Injector, and the other end to a standard electrical wall socket. For Windows 7 OS 1. 2. 3. 4. 5. 6. Go to Start > Settings > Control Panel Click View network status and tasks Click Change adapter settings Right-click Local Area Connection Click Properties Double-click Internet Protocol Version 4 (TCP/IPv4) 7. Select Use the following IP address 8. Enter 192.168.1.100 into the IP address field, 255.255.255.0 into the Subnet mask field, leave the DNS field empty 70 9. Click OK Now we can access the configuration page by entering 192.168.1.254 in the browser The login and password are both “admin” C.1.2. TL-WA7510N camera side configuration The TL-WA7510N must be configured as an access point with DHCP capability on this side: 1. Select quick setup 2. Click Next 3. Select Standard AP 4. Enter a unique and easy-to-remember name for your wireless network. 71 5. Select Switzerland from the drop-down list 6. Click Next and then finish 7. Select DHCP > DHCP Settings and switch DHCP Server to enable 72 C.1.3. TL-WA7510N locomotive side configuration The TL-WA7510N must be configured as an access point with DHCP capability on this side: 1. Connect your computer to a AP with the hard wired connection, and then log into the Web-based Interface by entering the IP address 192.168.1.254 into the Web Browser. 2. Change the LAN IP address of the access point to avoid IP conflict. After changing the IP address of your access point, you need re-log into it by using the new IP address. 3. Configure your Access Point to Point to Point Bridge mode. 3. a. Click on Wireless ->Basic Settings on the left menu, change the channel to a fixed one. 3. b. Click Wireless -> Wireless Mode on the left, select Bridge (Point to Point). w w 3. c. Press Survey or Search button on the bottom, then an AP list will be displayed. Locate the BSSID (MAC address) of the other access point, remember the Channel-> Click Connect. 73 3. d. Then you will see the MAC addresses of the other access point displayed in the w MAC of AP boxes. 3. e. Click on save button to save the settings. 4. Go to System Tools-Reboot to reboot the device. C.2. Camera’s static IP configuration Run <IP Installer_v2.XX.exe> to display the camera search list. At the initial startup, both [Auto Set] and [Manual Set] will be grayed out. 1. Select a camera in the search list. Check the MAC address of the camera on the camera’s label. 74 Both the [Auto Set] and [Manual Set] buttons will be activated. 2. Click [Manual Set]. The Manual Setting dialog appears. The default values of <IP Address>, <Subnet Mask>, <Gateway>, <HTTP Port> and <VNP Port> of the camera will be displayed. 3. In the <Address> pane, provide the necessary information. MAC (Ethernet) Address: The MAC address imprinted on the camera label is automatically displayed and requires no user setting. 4. In the <Port> pane, provide necessary information. HTTP Port: Used to access the camera using the Internet browser, defaulted to 80. VNP Port: Used to control the video signal transfer, defaulted to 4520. 5. Enter the password of “admin” account, which was used to access the camera. The default password is “4321”. 6. Click [OK]. Manual network setup will be completed. 75 Annex D-Capacitor choice As there will always be some ripple on the output of a rectifier using a smoothing capacitor circuit , it is necessary to be able to estimate the approximate value. Over-specifying a capacitor too much will add extra cost, size and weight - under-specifying it will lead to poor performance. [9] Fig.D.1. Peak to peak ripple for smoothed diode rectifier circuit The diagram above shows the ripple for a full wave rectifier with capacitor smoothing. If a half wave rectifier was used, then half the peaks would be missing and the ripple would be approximately twice the voltage. For cases where the ripple is small compared to the supply voltage - which is almost always the case - it is possible to calculate the ripple from a knowledge of the circuit conditions: Full wave rectifier ∆𝑉 = 𝑰𝑙𝑜𝑎𝑑 𝟐∗𝒇∗𝑪 Half wave rectifier ∆𝑉 = 𝑰𝑙𝑜𝑎𝑑 𝒇∗𝑪 These equations provide more than sufficient accuracy. Although the capacitor discharge for a purely resistive load is exponential, the inaccuracy introduced by the linear approximation is very small for low values of ripple. It is also worth remembering that the input to a voltage regulator is not a purely resistive load but a constant current load. Finally, the tolerances of electrolytic capacitors used for rectifier smoothing circuits are large - ±20% at the very best, and this will mask any inaccuracies introduced by the assumptions in the equations. The parts that will be fed from the 12 VDC converter are raspberry PI and TP-link antenna’s PoE injector. The raspberry PI consumes maximum 700 mA at 5 VDC and the antenna consumes 670 mA at 12 VDC. So the maximum current that will be taken from the converter at 12 VDC will be: 76 670 + 700 ∗ 5 = 670 + 292 = 962 𝑚𝐴 12 At the input of the Traco power converter, at 36VDC, the current drained from the source will be: 12 ∗ 962 = 321𝑚𝐴 36 Assuming a 10% error margin, the approximate value of Iload will be 321 ∗ 110% = 353𝑚𝐴 With a ripple voltage of 1V at 36 VDC, with a full wave rectifier, the appropriate capacitance value will be: 𝐶= 𝐼𝑙𝑜𝑎𝑑 0.353 = = 0.01𝐹 2 ∗ 𝑓 ∗ ∆𝑉 2 ∗ 16.7 ∗ 1 So a 10 000 µF capacitor will be enough to smooth the rectifier’s output. 77 Annex E-Raspberry PI configuration E.1. OS Installation [10] 1. Download Raspbian “wheezy” from http://www.raspberrypi.org/downloads 2. Extract the image file of wheezy from the downloaded .zip file. 3. Insert the SD card into your SD card reader and check what drive letter it was assigned. You can easily see the drive letter (for example G:) by looking in the left column of Windows Explorer. If the card is not new, you should format it and make sure there is only one partition (FAT32 is a good choice). 4. Download the Win32DiskImager utility from https://launchpad.net/win32-image-writer 5. Extract the executable from the zip file and run the Win32DiskImager utility. You should run the utility as Administrator. 6. Select the wheezy image file you extracted earlier 7. Select the drive letter of the SD card in the device box. 8. Click Write and wait for the write to complete. 9. Exit the imager and eject the SD card. 78 10. Insert the card in the Raspberry Pi, power it on, and it should boot up. The first time you boot the Raspberry Pi you'll see a configuration tool called "raspi-config." (If you ever need to revisit this configuration screen again, you can always call the "raspi-config" command from the terminal of your Pi.). You'll need to change a few options. First off, we need to select "expand_rootfs". What this does is expand the installed image to use the maximum available size of your SD card. If you are using a larger card (16GB for example), you'll definitely want to make sure you can use the full capacity, since the install image is only about 2GB. Highlight that "expand_rootfs" option and press Enter. You'll then see the confirmation below, at which point pressing Enter will take you back to the main raspi-config screen. 79 Back at the main setup, you can safely ignore the remaining options for now and select "Finish." You'll be prompted to reboot to make changes, do so. Once your system is back online, you'll get a login prompt like so: Your login is "pi" and the password will be “raspberry” Now that you've logged in to Raspberry Pi, the first thing you want to do is type "startx" to get your GUI environment loaded. E.2. Streaming from the Samsung camera URLs for Samsung SNB-1001 need to have credentials (the IP camera login name and password) passed through in the URL like: rtsp://USERNAME:PASSWORD@IPADDRESS:PORT/ The default login and password are “admin” and “4321” respectively. The port used by the IP camera for RTSP streams is 3000. So to stream using Omxplayer, we should execute the following command: omxplayer rtsp:// admin:4321@IPADDRESS:3000/ where IPADDRESS is replaced with the camera’s IP. 80 Annex F-Electronic circuits F.1. Solar tracker 81 F.2. Solar charger F.2.1. BQ24650 Battery voltage regulation The bq24650 uses a high accuracy voltage regulator for the charging voltage. The charge voltage is programmed via a resistor divider from the battery to ground, with the midpoint tied to the VFB pin. The voltage at the VFB pin is regulated to 2.1V, giving the following equation for the regulation voltage: 𝑅2 𝑉𝐵𝐴𝑇 = 2.1𝑉 ∗ [1 + ](1) 𝑅1 Where R2 is connected from VFB to the battery and R1 is connected from VFB to GND. By choosing R2=100kΩ, we can calculate the value of R1 100 (1) 5𝑉 = 2.1𝑉 ∗ [1 + 𝑅 ] → 𝑅1 = 72.4𝑘Ω 1 The closest standard value [11] is 71.5kΩ. Battery current regulation Battery current is sensed by resistor RSR connected between SRP and SRN. The full-scale differential voltage between SRP and SRN is fixed at 40mV. The value of RSR is calculated using eq.2. 40 𝑚𝑉 𝐼𝐶𝐻𝐴𝑅𝐺𝐸 = (2) 𝑅𝑆𝑅 The charging current we want is 4A, so RSR should be 10mΩ. Converter operation The synchronous buck PWM converter uses a fixed frequency voltage mode with feedforward control scheme. A type III compensation network allows using ceramic capacitors at the output of the converter. The compensation input stage is connected internally between the feedback output (FBO) and the error amplifier input (EAI). The feedback compensation stage is connected between the error amplifier input (EAI) and error amplifier output (EAO). The LC output filter must be selected to give a resonant frequency of 12 kHz – 17 kHz for the bq24650, where resonant frequency, fo, is given by: 1 𝑓0 = 2𝜋√𝐿0 𝐶0 By using the below table, we can find that Lo=6.8µH and Co=20µF are the best values for the design. We will use two 10µF capacitors in parallel which will give an equivalent 20µf capacitance, because 20µf is not a standard value [12]. 82 Charge Current Output Inductor Lo Output Capacitor Co Sense Resistor 1A 15µH 2A 10µH 4A 6.8µH 8A 3.3µH 10µF 15µF 20µF 40µF 40mΩ 20mΩ 10mΩ 5mΩ Table F.1. Typical Inductor, Capacitor, and Sense Resistor Values as a function of charge current Inductor selection The bq24650 has a 600-kHz switching frequency to allow the use of small inductor and capacitor values. Inductor saturation current should be higher than the charging current (ICHG) plus half the ripple current (IRIPPLE) 𝐼 𝐼𝑆𝐴𝑇 ≥ 𝐼𝐶𝐻𝐺 + 𝑅𝐼𝑃𝑃𝐿𝐸 (4) 2 Inductor ripple current depends on input voltage (VIN), duty cycle (D = VOUT/VIN), switching frequency (fs), and inductance (L) according to eq.5. 𝑉𝐼𝑁 ∗ 𝐷 ∗ (1 − 𝐷) 𝐼𝑅𝐼𝑃𝑃𝐿𝐸 = (5) 𝑓𝑠 ∗ 𝐿 9.12∗0.55∗(1−0.55) (5) 𝐼𝑅𝐼𝑃𝑃𝐿𝐸 = 600 000∗6.8∗10−6 = 0.55𝐴 0.55 (4) 𝐼𝑆𝐴𝑇 ≥ 4 + 2 = 4.275𝐴 So we should choose a 6.8µH inductor [13] having a saturation current rating higher than 4.275A and supports a current of 4A. Input over-voltage protection (acov) ACOV provides protection to prevent system damage due to high input voltage. Once the adapter voltage reaches the ACOV threshold, charge is disabled. Input under-voltage lock out (uvlo) The system must have a minimum VCC voltage to allow proper operation. This VCC voltage could come from either input adapter or battery, since a conduction path exists from the battery to VCC through the high-side NMOS body diode. When VCC is below the UVLO threshold, all circuits on the IC, including VREF LDO, are disabled. Battery over-voltage protection The converter does not allow the high-side FET to turn on until the BAT voltage goes below 102% of the regulation voltage. This allows one-cycle response to an over-voltage condition – such as occurs when the load is removed or the battery is disconnected. A current sink from SRP to GND is on to discharge the stored energy on the output capacitors. 83 Thermal shutdown protection The QFN package has low thermal impedance, which provides good thermal conduction from the silicon to the ambient, to keep junction temperatures low. As an added level of protection, the charger converter turns off and self-protects whenever the junction temperature exceeds the TSHUT threshold of 145°C. The charger stays off until the junction temperature falls below 130°C. Temperature qualification The controller continuously monitors battery temperature by measuring the voltage between the TS pin and GND. A negative temperature coefficient thermistor (NTC) and an external voltage divider typically develop this voltage. The controller compares this voltage against its internal thresholds to determine if charging is allowed. To initiate a charge cycle, the battery temperature must be within the VLTF to VHTF thresholds. If battery temperature is outside of this range, the controller suspends charge and waits until the battery temperature is within the VLTF to VHTF range. During the charge cycle the battery temperature must be within the VLTF to VTCO thresholds. If battery temperature is outside of this range, the controller suspends charge and waits until the battery temperature is within the VLTF to VHTF range. The controller suspends charge by turning off the PWM charge FETs. Texas instruments suggests to use a 103AT NTC on the battery pack for this purpose. The values of RT1 and RT2 can be found using the spreadsheet found at ti.com. Charge status outputs The open-drain STAT1 and STAT2 outputs indicate various charger operations as listed in the table below. These status pins can be used to drive LEDs or communicate with the host processor. Note that OFF indicates that the open-drain transistor is turned off. 84 Table F.2. Charge status in function of LEDs on stat pins Input capacitor A low ESR ceramic capacitor such as X7R or X5R is preferred for the input decoupling capacitor and should be placed as close as possible to the drain of the high-side MOSFET and source of the low-side MOSFET. The voltage rating of the capacitor must be higher than the normal input voltage level, which is 9,12V in our case. Input filter design During adapter hot plug-in, the parasitic inductance and the input capacitor from the adapter cable form a second order system. The voltage spike at the VCC pin may be beyond the IC maximum voltage rating and damage the IC. A cost effective and small size solution is shown in the figure below. R1 and C1 are composed of a damping RC network to damp the hot plug-in oscillation. As a result, the over-voltage spike is limited to a safe level. D1 is used for reverse voltage protection for the VCC pin. C2 is the VCC pin decoupling capacitor and it should be placed as close as possible to the VCC pin. R2 and C2 form a damping RC network to further protect the IC from high voltage spike. The C2 value should be less than the C1 value so R1 can dominant the equivalent ESR value to get enough damping effect for hot plug-in. Values chosen for this design are R1=2Ω R2=20Ω C1=2.2µF and C2=0.47µF. MPPT temperature compensation A typical solar panel comprises of a lot of cells in a series connection, and each cell is a forward-biased p-n junction. So, the open-circuit voltage (VOC) of a solar cell has a temperature coefficient that is similar to a common p-n diode, or about –2mV/°C. A crystalline solar panel specification always provides both open-circuit voltage VOC and peak power point voltage VMP. The bq24650 employs a feedback network to the MPPSET pin to program the input regulation voltage. Because the temperature characteristic for a typical solar panel VMP voltage is almost linear, a simple solution for tracking this characteristic can be implemented by using an LM234 3- 85 terminal current source, which can create an easily programmable, linear temperature dependent current to compensate the negative temperature coefficient of the solar panel output voltage. From the solar panel specifications, we can find that VMP(25ºC)=9.12V and that this panel is made of 18 cells. By choosing RSET=1kΩ, we can calculate the values of R3 and R4 using the following equations: 2𝑚𝑉 ∗ 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑜𝑙𝑎𝑟 𝑐𝑒𝑙𝑙𝑠 𝑖𝑛 𝑠𝑒𝑟𝑖𝑒𝑠 𝑅3 = (6) 227µ𝑉 𝑉𝑀𝑃𝑃𝑆𝐸𝑇 ∗𝑅3 𝑅4 = (7) 0.0677𝑉 (𝑉MP(25ºC) +𝑅3 ∗ (6) 𝑅3 = (7) 𝑅4 = 2𝑚𝑉∗18 227µ𝑉 𝑅𝑆𝐸𝑇 )−𝑉𝑀𝑃𝑃𝑆𝐸𝑇 = 158.6𝑘Ω 1.2∗158600 0.0677𝑉 )−1.2 1000 (9.12+158 600∗ = 10.2𝑘Ω 86 Design Schematic Proving calculated values with the ti spreadsheet 87 F.2.2. TPS55340 Design Using the step by step guide provided by Texas instrument in the TPS55340 datasheet, we can calculate the values of the components of the boost circuit. A few parameters must be known in order to start the design process. These parameters are typically determined at the system level. Even though the bq24650 has a 0.5% charge voltage regulation, we should give a wider range of input for protection purposes. By posing a 10% voltage variation at the output of the bq24650, the input voltage range becomes 4.5 to 5.5V. Parameter Output Voltage Input Voltage Maximum Output Current Transient Response 50% load step (ΔVOUT = 3%) Output Voltage Ripple (0.5% of VOUT) Value 12.6V 4.5 to 5.5V 1.5A 378mV 63mV 88 Selecting the switching frequency (R4) The first step is to decide on a switching frequency for the regulator. There are tradeoffs to consider for a higher or lower switching frequency. A higher switching frequency allows for lower valued inductor and smaller output capacitors leading to the smallest solution size. A lower switching frequency will result in a larger solution size but better efficiency. The switching frequency is set by a resistor (RFREQ) connected to the FREQ pin of the TPS55340. The resistor value required for a desired frequency can be calculated using eq.1. 𝑅𝐹𝑅𝐸𝑄 = 57500 ∗ 𝑓𝑠𝑤 (𝑘𝐻𝑧)−1.03 (1) By choosing a switching frequency of 300 kHz, we can calculate the value of the resistor: 𝑅𝐹𝑅𝐸𝑄 = 57500 ∗ 300−1.03 = 161.52 𝐾Ω The closest standard value is 162 KΩ Determining the duty cycle The input to output voltage conversion ratio of the TPS55340 is limited by the worst case maximum duty cycle of 89% and the minimum duty cycle which is determined by the minimum on-time of 77 ns and the switching frequency. The duty cycle at which the converter operates is dependent on the mode in which the converter is running. If the converter is running in discontinuous conduction mode (DCM), where the inductor current ramps to zero at the end of each cycle, the duty cycle varies with changes of the load much more than it does when running in continuous conduction mode (CCM). In continuous conduction mode, where the inductor maintains a minimum dc current, the duty cycle is related primarily to the input and output voltages as computed below. Assuming a 0.5 V drop across the Schottky rectifier, we can calculate the duty cycle range using eq.2. 𝐷= 𝑉𝑂𝑈𝑇 + 𝑉𝐷 − 𝑉𝐼𝑁 (2) 𝑉𝑂𝑈𝑇 + 𝑉𝐷 • VOUT is the output voltage of the converter in Volts • VD is the forward conduction voltage drop across the rectifier or catch diode in Volts • VIN is the input voltage to the converter in Volts At 4.5V, 𝐷 = 12.6+0.5−4.5 At 5.5V, 𝐷 = 12.6+0.5−6.03 12.6+0.5 = 66% 12.6+0.5 = 58% Selecting the inductor (L1) The selection of the inductor affects steady state operation as well as transient behavior and loop stability. These factors make it the most important component in power regulator design. There are three important inductor specifications: inductor value, DC resistance and saturation current. The minimum value of the inductor should be able to meet inductor current ripple (ΔIL) requirement at worst case. KIND is a coefficient that represents the amount of inductor ripple current relative to the maximum input current (IINDC = ILavg). The maximum input current can be 89 estimated with eq.3, with an estimated efficiency based on similar applications (ηEST). For CCM operation, it is recommended by Texas instruments to use KIND values in the range of 0.2 to 0.4. For this design, we will choose KIND = 0.3 and a conservative efficiency estimate of 85% with the minimum input voltage and maximum output current. 𝐼𝐼𝑁 𝐷𝐶 = 𝑉𝑂𝑈𝑇 ∗ 𝐼𝑂𝑈𝑇 (3) ɳ𝐸𝑆𝑇 ∗ 𝑉𝐼𝑁 𝑚𝑖𝑛 𝐿𝑜 𝑚𝑖𝑛 ≥ 𝑉𝐼𝑁 𝐷 ∗ , D ≠ 50%, 𝑉𝐼𝑁 with D closest to 50% (4) 𝐼𝐼𝑁 𝐷𝐶 ∗ 𝐾𝐼𝑁𝐷 𝑓𝑆𝑊 12.6∗1.5 (3)𝐼𝐼𝑁 𝐷𝐶 = 0.85∗4.5 = 4.94𝐴 4.5 0.66 (4) 𝐿𝑜 𝑚𝑖𝑛 ≥ 4.94∗0.3 ∗ 300 000 = 6.68µH A standard 7.5 µH inductor can be chosen. After choosing the inductance, the required current ratings can be calculated. The inductor will be closest to its ratings with the minimum input voltage. The ripple with the chosen inductance is calculated with eq.5. The RMS and peak inductor current can be found with eq.6 and eq.7. It is generally recommended for the peak inductor current rating of the selected inductor be 20% higher to account for transients during power up, faults or transient load conditions. 𝑉𝐼𝑁 𝑚𝑖𝑛 𝐷𝑚𝑎𝑥 ∆𝐼𝐿 = ∗ (5) 𝐿𝑂 𝑓𝑆𝑊 ∆𝐼𝐿 2 2 √ 𝐼𝐿 𝑟𝑚𝑠 = (𝐼𝐼𝑁 𝐷𝐶) + ( ) (6) 12 𝐼𝐿 𝑝𝑒𝑎𝑘 = 𝐼𝐼𝑁 𝐷𝐶 + ∆𝐼𝐿 (7) 12 4.5 0.66 (5)∆𝐼𝐿 = 7.5∗10−6 ∗ 300 000 = 1.32𝐴 1.32 2 (6)𝐼𝐿 𝑟𝑚𝑠 = √(4.94)2 + ( 12 ) = 4.94𝐴 (7)𝐼𝐿 𝑝𝑒𝑎𝑘 = 4.94 + 1.32 12 = 5.05𝐴 𝐼𝐿 𝑝𝑒𝑎𝑘(+20%) = 6.06𝐴 So the final value of the inductor will be 7.5µH with a peak current higher than 6.06A. Selecting the output capacitor (C8-C10) 90 The minimum capacitance needed for a given ripple can be calculated by eq.8. If high ESR capacitors are used it will contribute additional ripple. ESR ripple can be neglected for ceramic capacitors but must be considered if tantalum or electrolytic capacitors are used. It is very hard to find a high capacitance with a high voltage ceramic capacitor so we will use an electrolytic one. By taking into account the ripple voltage coming from the equivalent resistance of the capacitor, which is of 0.05V, we can find the optimal capacitor value. 𝐶𝑂𝑈𝑇 ≥ 𝐷𝑚𝑎𝑥 ∗ 𝐼𝑂𝑈𝑇 (8) 𝑓𝑠𝑤 ∗ 𝑉𝑅𝐼𝑃𝑃𝐿𝐸 𝐶𝑂𝑈𝑇 ≥ ∆𝐼𝑇𝑅𝐴𝑁 (9) 2 ∗ 𝜋 ∗ 𝑓𝐵𝑊 ∗ ∆𝑉𝑇𝑅𝐴𝑁 𝐷𝑚𝑎𝑥 I𝐶𝑂 𝑟𝑚𝑠 = 𝐼𝑂𝑈𝑇 √ (10) (1 − 𝐷𝑚𝑎𝑥 0.66∗1.6 (8) 𝐶𝑂𝑈𝑇 ≥ 300 000∗(0.063+0.06) = 28.62µ𝐹 0.8 (9) 𝐶𝑂𝑈𝑇 ≥ 2∗𝜋∗300 000∗0.378 = 1.12 µ𝐹 0.66 (10)I𝐶𝑂 𝑟𝑚𝑠 = 1.6 ∗ √(1−0.66) = 2.23𝐴 The most stringent criteria is the 28.62μF for the required load transient. Eq.10 gives a 2.23 A RMS current in the output capacitor. The capacitor should also be properly rated for the desired output voltage. So a capacitor of 39µF, of a voltage rating of 50V will be enough. Selecting the input capacitors (C2, C7) At least 4.7μF of ceramic input capacitance is recommended. Additional input capacitance may be required to meet ripple and/or transient requirements. High quality ceramic, type X5R or X7R are recommended to minimize capacitance variations over temperature. The capacitor must also have an RMS current rating greater than the maximum RMS input current of the TPS55340 calculated with eq.11. The input capacitor must also be rated greater than the maximum input voltage. The input voltage ripple can be calculated with eq.12. 𝐼𝐶𝐼 𝑟𝑚𝑠 = ∆𝐼𝐿 √12 𝑉𝐼 𝑟𝑖𝑝𝑝𝑙𝑒 = (11) ∆𝐼𝐿 + ∆𝐼𝐿 ∗ 𝑅𝐶𝐼𝑁 (12) 4 ∗ 𝑓𝑆𝑊 ∗ 𝐶𝐼𝑁 91 (11)𝐼𝐶𝐼 𝑟𝑚𝑠 = 1.32 12 = 110𝑚𝐴 By choosing a 22µF capacitor, we will a obtain a ripple voltage of 1.3 (12)𝑉𝐼 𝑟𝑖𝑝𝑝𝑙𝑒 = 4∗300 000∗22∗10−6 + 1.3 ∗ 3 ∗ 10−2 = 0.044 + 0.0035 = 88.2𝑚𝑉 The chosen capacitor should have a voltage higher than 10V, even though the maximum voltage input is 5.5V, to limit the effects of dc bias. An additional 0.1μF, 50V is located close to the VIN and GND pins for extra decoupling. Setting output voltage (R1, R2) To set the output voltage, the values of R1 and R2 must be chosen according to the following equations: 𝑅1 𝑉𝑂𝑈𝑇 = 1.229𝑉 ∗ ( + 1) (13) 𝑅2 𝑉𝑂𝑈𝑇 𝑅1 = 𝑅2 ∗ ( − 1) (14) 1.229 Considering the leakage current through the resistor divider and noise decoupling into FB pin, an optimum value for R2 is around 10kΩ (as suggested by ti in the datasheet). The output voltage tolerance depends on the VFB accuracy and the tolerance of R1 and R2. 12.6 (14) 𝑅1 = 10 ∗ (1.229 − 1) = 92.5𝑘Ω The closest standard value is 93.1kΩ. Setting the soft-start time (C3) This capacitor will be used to set soft-start time and avoid overshoot. Increasing the softstart time reduces the overshoot during start-up. A 0.047μF ceramic capacitor is used in this design (as in the ti example). Selecting the Schottky diode (D1) The high switching frequency of the TPS55340 demands high-speed rectification for optimum efficiency. The diode’s average and peak current rating must exceed the average output current and peak inductor current. In addition, the diode’s reverse breakdown voltage must exceed the regulated output voltage. So a Schottky diode of forward voltage 0.5V, an average current higher than 1.6A, a peak current higher than 6.06A and a reverse breakdown voltage higher than 12.6 V. Compensating the control loop (R3, C4, C5) The TPS55340 requires external compensation which allows the loop response to be optimized for each application. The COMP pin is the output of the internal error amplifier. An external resistor R3 and ceramic capacitor C4 are connected to the COMP pin to provide a pole and a zero. This pole and zero, along with the inherent pole and zero of a boost converter, determine 92 the closed loop frequency response. This is important for converter stability and transient response. Loop compensation should be designed for the minimum operating voltage. By using the spreadsheet tool located in the TPS55340 product folder at www.ti.com, we found that the values R3=3.74kΩ, C4=0.068µF and C5=270pF are a good choice to compensate the control loop. Proving calculated values with the ti spreadsheet By using the spreadsheet provided by Texas instrument, we can prove that the calculated values are optimal. The input capacitors are higher than the value suggested by the spreadsheet (10µF) to limit the voltage ripple. There is also a difference in the output capacitors because we didn’t use ceramic ones. Final design 93 F.2.3. TPS84620 Adjusting the output voltage The VADJ control sets the output voltage of the TPS84620. The output voltage adjustment range is from 1.2V to 5.5V. The adjustment method requires the addition of RSET, which sets the output voltage, the connection of SENSE+ to VOUT, and in some cases RRT which sets the switching frequency. The RSET resistor must be connected directly between the VADJ (pin 43) and AGND (pin 45). The SENSE+ pin (pin 44) must be connected to VOUT either at the load for improved regulation or at VOUT of the device. The RRT resistor must be connected directly between the RT/CLK (pin 35) and AGND (pin 34). The table below gives the standard external RSET resistor for a number of common bus voltages, along with the required RRT resistor for that output voltage. Table F.3.Standard RSET Resistor Values for Common Output Voltages So we should use RSET=0.267 kΩ and RRT=165 kΩ. Input Capacitor The TPS84620 requires a minimum input capacitance of 100 μF of ceramic and/or polymer-tantalum capacitors. The ripple current rating of the capacitor must be at least 450 mArms. Output Capacitor The required output capacitance is determined by the output voltage of the TPS84620. The required output capacitance can be comprised of either all ceramic capacitors, or a combination of ceramic and bulk capacitors. The required output capacitance must include at least 1x 47 μF ceramic capacitor. When adding additional non-ceramic bulk capacitors, low-ESR devices are required. The required capacitance above the minimum is determined by actual transient deviation requirements. The table below shows the typical transient response values for several output voltage, input voltage and capacitance combinations. 94 Table F.4. Output Voltage Transient Response So we should use 2 capacitors, a 47µF ceramic one and a 100µF bulk one. 95 Circuit design 96 Annex G-BOMs G.1. Camera side Quantity Name Ref. number Power supply 1 1 1 1 1 1 1801.2106-01 203.089.011 2CT3002-W04300 2CT3004-W04300 2CT3000-W0000W 3071-2 1 1 1 1 1 Switch Switch Protection cap Male 4 way connector Female 4 way cable Panel Waterproof Cap 1m Cable - black 22 AWG(0.5mm2) 1m Cable - red 22 AWG(0.5mm2) BRIDGE RECTIFIER Fuse-cartridge-time delay 5A Fuse-PCB-time delay 10A IP67 Fuse holder PCB-PAD hole 1 1 1 1 Access point + antenna Li-ion battery AC power adapter IP camera 1 Manufacturer Distributor Max 10A-250VAC max 5A max 5A - Price (CHF) 2.25 1.9 5.95 15.65 1.9 1.05 MARQUARDT MARQUARDT MULTICOMP MULTICOMP MULTICOMP Alpha wire Farnell Farnell Farnell Farnell Farnell Distrelec 3071-3 - 1.05 Alpha wire Distrelec KBL005 0477005.MXP 34.6925 3101.011 8015-1 If average=4A 250V-5A 250V-10A 250V-16A - 3.2 3.05 0.851 2.7 24.8 Farnell Farnell Farnell Farnell Farnell TL-WA7510N T-1298A SM-0555 SNB-5001P 12VDC-8W max 12V-9800 mAh 12VDC-2A 12VDC-3.7W max 58 40 6 280 Vishay Schurter Schurter SCHURTER Vector electronics TP-Link na na Samsung Tech mania Dealextreme Dealextreme Amazon 97 G.2. Locomotive side Quantity Name Ref. number Power supply 1 Raspberry PI Mod.B Mod.B 1 1 1 8 GB SD Card Access point + Antenna Diode bridge-single phase-full wave 63V-10 000uF capacitor Plastic box 12 to 5 DC to DC converter 36 to 12 DC to DC converter Push Button NC AC connector Feed Through HDMI connector Hdmi male to male cable 126cm RCA connector DC Jack DC Plug SDSDB-8192 TL-WA7510N NTE5322 5V-700 mA(micro USB) 12VDC - 8W max 140V-25A B41231B8109M000 RS5705 TEN 5-1211 TEN 40-4812WIR CCTPR00RD JR-101 NAHDMI-W-B PSG01512 SPC21366 1636 04 9-18 VDC 18-75 VDC - 1 1 1 1 1 1 1 1 1 1 1 Price Manufacturer (CHF) 59 Raspberry PI Distributor 10 58 7.45 SanDisk TP-LINK NTE K55 Tech mania Distrelec 13.3 41.15 27.1 267.25 8.95 3.05 28.7 5.28 3.95 2.5 3.55 Epcos Hammond Traco power Traco power Camdenboss Multicomp Neutrik Pro signal Multicomp Lumberg Farnell Farnell Farnell Farnell Farnell Farnell Farnell DX Farnell Farnell Farnell Digitec 98 G.3. Solar panel BOMs G.3.1. BQ24650 Quantity Description Manufacturer 1 1 1 1 NTC high presision thermistor R1-71.5K,1%,250mW resistor R2-100K,1%,250mW resistor R3-158K,1%,250mW resistor 1 1 R4-10.2K,1%,250mW resistor R5-2 ,1%,250mW resistor 1 2 R6-20 ,1%,250mW resistor R7,R8-10K,1%,250mW resistor 1 R9-5.23K,1%,250mW resistor 1 R10-30.1K,1%,250mW resistor 1 RSET-1K,1%,125mW resistor 1 1 1 2 3 RSR-10m,1%,0.33W resistor C1-2.2uF,10%,X7R capacitor C2-0.47uF,10%,X7R capacitor C3,C4-1uF,10%,X7R capacitor C5,C7,C11-0.1uF,10%,X7R capacitor 1 C6-10uF,10%,X7R capacitor Semitec Vishay Dale Vishay Dale Vishay BC components Vishay Dale Stackpole Electronics Inc Vishay Dale Stackpole Electronics Inc Stackpole Electronics Inc Stackpole Electronics Inc Stackpole Electronics Inc Vishay Dale Kemet AVX Kemet Vishay BC components TDK Corporation Manufacturer's Ref. number 103AT-2 CMF5071K500FHEB CMF50100K00FHEB HVR2500001583FR500 Distributor Ebay Digikey Digikey Digikey Price per unit (CHF) 1.9 1 1 0.6 CMF5510K200FHEB RNF14FTD2R00 Digikey Digikey 0.7 0.3 CMF5020R000FHEB RNF18FTD10K0 Digikey Digikey 1 0.2 RNF14FTD5K23 Digikey 0.2 RNF14FTD30K1 Digikey 0.2 RNF18FTD1K00 Digikey 0.2 CMF5010R000FHEB C340C225K5R5TA CK06BX474K C330C105J5R5TA A104K15X7RF5TAA Digikey Farnell Farnell Farnell Farnell 1 4.15 2.9 1.4 0.323 FK16X7R1E106K Digikey 0.7 99 1 C8,C9-10uF,10%,X7R capacitor 1 1 1 C10-22pF,10%,X7R capacitor D1,Diode schottky 40V 3A D2,Diode schottky 30V 200MA 2 1 1 D3-D4,LED green clear 0603 SMD Q1-Q2,Dual N-Channel 40-V (D-S) MOSFET L,6.8uH 6.2A 1 IC current source 1 IC Battery charger TDK Corporation AVX AVX Fairchild Semiconductor Lite-On Inc Vishay Siliconix MURATA POWER SOLUTIONS Texas Instruments Texas Instruments FK26X7R1C106K Digikey 1.5 CK05BX220K SD2010S040S3R0 BAT54C Farnell Digikey Digikey 0.4 0.6 0.3 LTST-C190GKT SI7288DP-T1-GE3 Digikey Digikey 0.3 1.7 496R8SC Digikey 1.75 LM234Z-6/NOPB Digikey 1.2 bq24650 Farnell 7.05 100 G.3.2. TPS55340 Quantity Description Manufacturer 1 R4-162K,0.1%,250mW resistor 1 R1-93.1K,0.1%,250mW resistor 1 R2-10K,0.1%,125mW resistor TE CONNECTIVITY / NEOHM TE CONNECTIVITY / HOLSWORTHY VISHAY DALE 1 1 1 R3-3.74K,0.1%,250mW resistor L1-7.5uH,20% inductor C7-0.1uF,10%,X7R capacitor 1 1 C3-0.047uF,10%,X7R capacitor C4-0.068uF,10%,X7R capacitor 1 C5-270pF,10%,X7R capacitor 3 C8,9,10-Capacitor 39UF 35V CORNELL DUBILIER NICHICON 1 1 1 22uF,20%,X7R capacitor Diode schottky 40V 3A DC/DC converter 2.9-32V 5A 2.9-38V TDK Corporation AVX Texas instrument HOLSWORTHY COILCRAFT VISHAY BC COMPONENTS KEMET KEMET Manufacturer's Ref. number YR1B162KCC Distributor Farnell Price per unit (CHF) 0.516 H893K1BYA Farnell 0.531 PTF5610K000BY EB H83K74BYA SPT38L-752MLB A104K15X7RF5T AA CK05BX473K C412C683K5R5T A CK05BX271K Farnell 0.81 Farnell Farnell Farnell 0.79 2.85 0.323 Farnell Farnell 0.671 0.251 Farnell 1.7 RNU1H390MDN1 KX FK20X7R1C226M SD2010S040S3R0 TPS55340PWP Farnell 3.25 Digikey Digikey Farnell 0.7 0.6 12 101 G.3.3. TPS55340 Quantity Description Manufacturer 1 CAPACITOR CIN1, 25V 47UF CAPACITOR CIN2, 16V 68UF CAPACITOR COUT1, 10V 47UF CAPACITOR COUT2, 10V 68UF Resistor RRT, 165K 250mW Resistor RSET, 267 250mW BUCK SYNC 6A Kemet 1 1 1 1 1 1 Manufacturer's Ref. number C2220C476M3R2CT U 16TQC68MYF Distributor Price per unit (CHF) Farnell 4.9 Digikey 2.3 Farnell 1.1 Digikey 1.3 Welwyn GRM32ER61A476K E20L T520V107M010ASE 025 RC55Y-165KBI Farnell 2 TE CONNECTIVITY CPF0402B267RE1 Farnell 0.79 Texas instruments TPS84620RUQR Farnell 13.2 Panasonic Murata Kemet 102 Annex H – Overo gumstix H.1. Description The lab MIS has designed a camera based on the gumstix board. The lab has two versions of this camera: one built around the gumstix overo water board, which does not have Wi-Fi capability, and the other around gumstix overo fire board, which comes with a built in Wi-Fi module. A previous student has developed a program that saves the images only in case of motion, and another student has developed a charger circuit for the camera so it can be fed by a solar panel. My task was to write a program to send the images via Wi-Fi. The idea behind this is to develop a truly autonomous-intelligent camera. H.2. UTP vs. TCP There are two types of Internet Protocol (IP) traffic [8]. They are TCP or Transmission Control Protocol and UDP or User Datagram Protocol. TCP is connection oriented – once a connection is established, data can be sent bidirectional. UDP is a simpler, connectionless Internet protocol. Multiple messages are sent as packets in chunks using UDP. Since UDP is connectionless, there is no guarantee that the data will arrive in order to the client, or even arrive at all. That’s why we need to send the images via a TCP socket so we can be sure that the data will arrive, and in order. H.3. Ad-hoc network H.3.1. Description On wireless computer networks, ad-hoc mode is a method for wireless devices to directly communicate with each other. Operating in ad-hoc mode allows all wireless devices within range of each other to discover and communicate in peer-to-peer fashion without involving central access points. An ad-hoc network tends to feature a small group of devices all in very close proximity to each other. Performance suffers as the number of devices grows, and a large ad-hoc network quickly becomes difficult to manage, but this does not concern us since only one remote PC will be connected to the network. On the gumstix, we can easily program an ad-hoc wireless network with DHCP server capability. The ad-hoc acts the same as an access point with the difference that in ad-hoc mode, the power is not managed, so the emitter will always transmit at maximum power. This is a drawback, especially since the camera will be powerd by solar energy but there still isn’t a clear way to program the gumstix as an access point. 103 H.3.2. Steps to create ad-hoc network Open a terminal and type the following commands: nano /etc/network/interfaces Change the wlan0 configuration inside the file, by adding the following lines and commenting or deleting any previous configurations: o auto wlan0 o iface wlan0 inet static o address 192.168.2.2 o netmask 255.255.255.0 o wireless-mode ad-hoc o wireless-essid gumstixnet Save and reboot Now the gumstix will create an ad-hoc network named “gumstixnet”, its IP will be 192.168.2.2. H.4. System architecture Fig.VI.1. System architecture diagram The remote PC should be given a static IP address, because it needs to act as a server, always waiting for the client (gumstix) to connect to it to accept a file transfer. In our case, the gumstix is given the address 192.168.2.2 and the server 192.168.2.4. 104 H.5. Algorithms H.5.1. Server (remote PC) Fig.VI.2. Server code chart After the creation of the TCP socket and assigning a port and an IP address to it, the program will run in loop, waiting for requests from the client. When one is received, the program will create a new .raw file and save the data received in it, then when finished gets back to the start and wait for a new connection. 105 H.5.2. Client (gumstix) Fig.VI.3. Client code chart After the creation of the TCP socket and assigning a port and an IP address to it, the program will run in loop, reading the .raw file and filling a 512 bytes buffer with the data, then sending it to the server until the file ends. H.6. Problems The first problem is that the code written by the old student to register the images in case of motion, was written for the camera based on the gumstix overo water, so it did not work on the camera equipped with Wi-Fi, some parameters needs to be changed. The second problem is that even though the code works perfectly between two computers running Ubuntu, and to transfer a small file from the gumstix to the remote PC, but it does not work once the file is larger than 2KB. Due to a certain error (probably from the compiler), the file transfer is dropped and only 2KB are saved. 106 The third problem is that by changing the interfaces configuration file, so that the Wi-Fi interface runs as an Ad-Hoc with IP 192.168.2.2, the settings takes place for 3 seconds after the boot and then it’s dropped, the signal disappears. This is probably due to a bug in the system. To solve this problem, we need to manually configure it each time after boot using the following procedure (but this contradicts the purpose to design an autonomous camera). Open a terminal and type the following commands: ifconfig wlan0 down ifconfig wlan0 address 192.168.2.2 netmask 255.255.255.0 iwconfig wlan0 mode ad-hoc essid gumstix-network ifconfig wlan0 up H.7. Solutions To solve these problems, we probably need either to update the OS or change it to a more stable Linux based one, that way we can change the compiler all together. As for the Wi-Fi, many people on the internet are complaining about its instability. H.8. Improvements The developed client code should be added to the part of the code done by the old student, where the file gets saved on the disk, by changing the path of the file to be send (in client.c) according to where the images are saved. This process takes a certain time during which the fps of the camera is dropped dramatically to less than 1 frame. To solve this problem, we need to send the data immediately via the socket to the server instead of saving it in a file. H.9. Codes H.9.1. Client.c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/wait.h> #include <sys/socket.h> #include <signal.h> #include <ctype.h> #include <arpa/inet.h> #include <netdb.h> #define PORT 20000 107 #define LENGTH 512 void error(const char *msg) { perror(msg); exit(1); } int main(int argc, char *argv[]) { /* Variable Definition */ int sockfd; int nsockfd; char revbuf[LENGTH]; struct sockaddr_in remote_addr; /* Get the Socket file descriptor */ if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { fprintf(stderr, "ERROR: Failed to obtain Socket Descriptor! (errno = %d)\n",errno); exit(1); } /* Fill the socket address struct */ remote_addr.sin_family = AF_INET; remote_addr.sin_port = htons(PORT); inet_pton(AF_INET, "192.168.2.2", &remote_addr.sin_addr); bzero(&(remote_addr.sin_zero), 8); /* Try to connect the remote */ if (connect(sockfd, (struct sockaddr *)&remote_addr, sizeof(struct sockaddr)) == -1) { fprintf(stderr, "ERROR: Failed to connect to the host! (errno = %d)\n",errno); exit(1); } else printf("[Client] Connected to server at port %d...ok!\n", PORT); /* receive File to Server */ char* fr_name = "/home/ubuntu/Desktop/test.jpg"; FILE *fr = fopen(fr_name, "a"); if(fr == NULL) printf("File %s Cannot be opened\n", fr_name); 108 else { bzero(revbuf, LENGTH); int fr_block_sz = 0; while((fr_block_sz = recv(sockfd, revbuf, LENGTH, 0)) > 0) { int write_sz = fwrite(revbuf, sizeof(char), fr_block_sz, fr); if(write_sz < fr_block_sz) { error("File write failed\n"); } bzero(revbuf, LENGTH); if (fr_block_sz == 0 || fr_block_sz != 512) { break; } } if(fr_block_sz < 0) { if (errno == EAGAIN) { printf("recv() timed out.\n"); } else { fprintf(stderr, "recv() failed due to errno = %d\n", errno); exit(1); } } printf("Ok received from server!\n"); fclose(fr); } } H.9.2. Server.c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/wait.h> #include <sys/socket.h> #include <signal.h> 109 #include <ctype.h> #include <arpa/inet.h> #include <netdb.h> #define PORT 20000 #define BACKLOG 5 #define LENGTH 512 void error(const char *msg) { perror(msg); exit(1); } int main () { /* Defining Variables */ int sockfd; int nsockfd; int num; int sin_size; struct sockaddr_in addr_local; /* client addr */ struct sockaddr_in addr_remote; /* server addr */ char revbuf[LENGTH]; // Receiver buffer /* Get the Socket file descriptor */ if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1 ) { fprintf(stderr, "ERROR: Failed to obtain Socket Descriptor. (errno = %d)\n", errno); exit(1); } else printf("[Server] Obtaining socket descriptor successfully.\n"); /* Fill the client socket address struct */ addr_local.sin_family = AF_INET; // Protocol Family addr_local.sin_port = htons(PORT); // Port number addr_local.sin_addr.s_addr = INADDR_ANY; // AutoFill local address bzero(&(addr_local.sin_zero), 8); // Flush the rest of struct /* Bind a special Port */ if( bind(sockfd, (struct sockaddr*)&addr_local, sizeof(struct sockaddr)) == -1 ) { fprintf(stderr, "ERROR: Failed to bind Port. (errno = %d)\n", errno); exit(1); 110 } else printf("[Server] Binded tcp port %d in addr 127.0.0.1 sucessfully.\n",PORT); /* Listen remote connect/calling */ if(listen(sockfd,BACKLOG) == -1) { fprintf(stderr, "ERROR: Failed to listen Port. (errno = %d)\n", errno); exit(1); } else printf ("[Server] Listening the port %d successfully.\n", PORT); int success = 0; while(success == 0) { sin_size = sizeof(struct sockaddr_in); /* Wait a connection, and obtain a new socket file despriptor for single connection */ if ((nsockfd = accept(sockfd, (struct sockaddr *)&addr_remote, &sin_size)) == 1) { fprintf(stderr, "ERROR: Obtaining new Socket Despcritor. (errno = %d)\n", errno); exit(1); } else printf("[Server] Server has got connected from %s.\n", inet_ntoa(addr_remote.sin_addr)); /*send File from server */ char* fs_name = "/home/root/img.jpg"; char sdbuf[LENGTH]; printf("[Client] Sending %s to the Server... ", fs_name); FILE *fs = fopen(fs_name, "r"); if(fs == NULL) { printf("ERROR: File %s not found.\n", fs_name); exit(1); } bzero(sdbuf, LENGTH); int fs_block_sz; while((fs_block_sz = fread(sdbuf, sizeof(char), LENGTH, fs)) > 0) { if(send(nsockfd, sdbuf, fs_block_sz, 0) < 0) { 111 fprintf(stderr, "ERROR: Failed to send file %s. (errno = %d)\n", fs_name, errno); break; } bzero(sdbuf, LENGTH); } printf("Ok File %s was sent from server!\n", fs_name); close (sockfd); printf("[Client] Connection lost.\n"); return (0); } } 112 References [1] “http://kb.linksys.com/Linksys/ukp.aspx?pid=80&vw=1&articleid=17415”, Linksys article Differentiating the 5 GHz and 2.4 GHz bands [3] “http://www.solar-wind.co.uk/cable-sizing-DC-cables.html”, DC cable sizing calculator [4] “www.networktechinc.com/pdf/m12vga-extender-railway.pdf”, Railway applications Electronic equipment used on rolling stock [5] “http://www.gammon.com.au/forum/?id=11497”, Power saving techniques for microprocessors [6] “http://arduino.cc/en/Tutorial/ArduinoToBreadboard”, From Arduino to a Microcontroller on a Breadboard [7] “http://arduino.cc/en/Main/Standalone”, Building an Arduino on a Breadboard [8] “http://www.diffen.com/difference/TCP_vs_UDP”, Building an Arduino on a Breadboard [9] “http://www.radio-electronics.com/info/circuits/diode-rectifier/rectifier-filtering-smoothingcapacitor-circuits.php”, Capacitor smoothing circuits and calculations [10] “http://elinux.org/RPi_Easy_SD_Card_Setup”, Raspberry PI SD card preparation [11] “http://www.rfcafe.com/references/electrical/resistor-values.htm”, Standard resistor values [12] “http://www.rfcafe.com/references/electrical/capacitor-values.htm”, Standard capacitor values [13] “http://www.rfcafe.com/references/electrical/inductor-values.htm”, Standard inductor values 113