This document presents a project report for an HNR Weather Station created using a BeagleBone Black single board computer. The weather station measures temperature, pressure, and UV index using two I2C sensors - an SI1145 UV sensor and a BMP180 temperature and pressure sensor. It displays readings on a serial LCD screen and uses four LEDs (one RGB) to indicate UV levels. The software was programmed on the BeagleBone Black using Cloud9 and takes readings from the sensors to display in an automatic or manual mode. The goal of the project was to create a portable weather station that provides users with real-time outdoor condition updates through a simple interface.
This document describes the development of a CNC Drawbot project. The Drawbot is a vertical plotter that uses two stepper motors and pulleys connected to a gondola holding a pen to draw images on a vertical surface. The hardware components include an Arduino Uno, L293D motor driver shield, stepper motors, servo motor, timing belts, pulleys, pen and cooling fan. The software used includes the Arduino IDE to program the Arduino and Processing, an open-source programming language, to control the plotter and convert images into drawing instructions. The goal of the project is to create a low-cost drawing machine that can reproduce images on a wall-mounted whiteboard.
Smart real time embedded arduino based data acquisition systemeSAT Journals
Abstract In this paper, an effort has been made to design and develop a smart real time embedded Arduino based data logger for indoor and outdoor environment. The present work has been concentrated to environmental parameters such as temperature, humidity and solar insolation. The data logger is proposed to be developed with the use of Arduino Uno based on ATmega328. The Arduino Microcontroller board is used which has inbuilt ADC and other peripheral circuitry necessary for operation. The physical parameter is sensed by the sensors and is converted into analog signal. This analog signal is fed to the Arduino board ADC pins which is then converted in to an equivalent digital quantity and is further processed in the microcontroller. The raw digital signal or processed signal out of microcontroller may be displayed on the LCD display or it’s saved in a database or even at the same time this data is sent to computer through the USB serial port. The serial port data is then accessed and is imported in Microsoft excel for computation and graphical representation. Key Words: Arduino Uno, ATmega328, DHT 11, Solar cell, LCD etc.
The electronic diary allows users to store and display predetermined daily schedule events and message reminders. It combines clock, calendar, and message storage functions. Users can input schedule events and messages using the keyboard and associate them with times of day. The device will then display the messages at the appropriate times and can also sound an alarm. This allows the electronic diary to remind users of important events and messages at scheduled times throughout the day.
This document is a project report on a Smart Street System. It describes a system that aims to automate street lighting and enable real-time monitoring of streets. The system connects all streetlights to a central server using IoT. This allows the lights to be controlled remotely and usage to be analyzed. Sensors detect factors like light levels and motion to automatically adjust brightness or turn lights on/off. Video cameras monitor streets for unusual activities which are reported. The project aims to improve energy efficiency of street lighting and enhance security.
Weather monitoring plays a very important role in human life hence study of weather system is necessary.
Currently there are two types of the weather monitoring stations available i.e. wired and wireless. Wireless
system has some advantages over the wired one hence popular now a days. The parameters are include in
weather monitoring usually temperature, humidity atmospheric pressure, light intensity, rainfall etc. There are
many techniques existed using different processor such as PIC, AVR, ARM etc. Analog to digital channel are
used to fetch the analog output of the sensors. The wireless techniques used in the weather monitoring having
GSM, FM channel, Zigbee, RF etc Protocols.
ALAM SURVEY hadir untuk menjadi rekan kerja terbaik dalam menyediakan beragam alat survey yang dibutuhkan sesuai dengan biaya yang dimiliki oleh Anda.
Informasi Lengkap :
FERY – Alam Survey
0878 8502 8163
0812 1953 9224
0856 992 7447
Daryl Bess has over 27 years of experience as an electrician and electronics technician, including 11 years as Chief Electrician on offshore vessels. He is Coast Guard certified and holds a Top Secret clearance from his time serving in the U.S. Navy. Bess seeks a senior electrical position where he can utilize his skills and experience to contribute to a reputable company. He has extensive qualifications in industrial electrical work, electronics maintenance, and supervisory experience.
This document describes the development of a CNC Drawbot project. The Drawbot is a vertical plotter that uses two stepper motors and pulleys connected to a gondola holding a pen to draw images on a vertical surface. The hardware components include an Arduino Uno, L293D motor driver shield, stepper motors, servo motor, timing belts, pulleys, pen and cooling fan. The software used includes the Arduino IDE to program the Arduino and Processing, an open-source programming language, to control the plotter and convert images into drawing instructions. The goal of the project is to create a low-cost drawing machine that can reproduce images on a wall-mounted whiteboard.
Smart real time embedded arduino based data acquisition systemeSAT Journals
Abstract In this paper, an effort has been made to design and develop a smart real time embedded Arduino based data logger for indoor and outdoor environment. The present work has been concentrated to environmental parameters such as temperature, humidity and solar insolation. The data logger is proposed to be developed with the use of Arduino Uno based on ATmega328. The Arduino Microcontroller board is used which has inbuilt ADC and other peripheral circuitry necessary for operation. The physical parameter is sensed by the sensors and is converted into analog signal. This analog signal is fed to the Arduino board ADC pins which is then converted in to an equivalent digital quantity and is further processed in the microcontroller. The raw digital signal or processed signal out of microcontroller may be displayed on the LCD display or it’s saved in a database or even at the same time this data is sent to computer through the USB serial port. The serial port data is then accessed and is imported in Microsoft excel for computation and graphical representation. Key Words: Arduino Uno, ATmega328, DHT 11, Solar cell, LCD etc.
The electronic diary allows users to store and display predetermined daily schedule events and message reminders. It combines clock, calendar, and message storage functions. Users can input schedule events and messages using the keyboard and associate them with times of day. The device will then display the messages at the appropriate times and can also sound an alarm. This allows the electronic diary to remind users of important events and messages at scheduled times throughout the day.
This document is a project report on a Smart Street System. It describes a system that aims to automate street lighting and enable real-time monitoring of streets. The system connects all streetlights to a central server using IoT. This allows the lights to be controlled remotely and usage to be analyzed. Sensors detect factors like light levels and motion to automatically adjust brightness or turn lights on/off. Video cameras monitor streets for unusual activities which are reported. The project aims to improve energy efficiency of street lighting and enhance security.
Weather monitoring plays a very important role in human life hence study of weather system is necessary.
Currently there are two types of the weather monitoring stations available i.e. wired and wireless. Wireless
system has some advantages over the wired one hence popular now a days. The parameters are include in
weather monitoring usually temperature, humidity atmospheric pressure, light intensity, rainfall etc. There are
many techniques existed using different processor such as PIC, AVR, ARM etc. Analog to digital channel are
used to fetch the analog output of the sensors. The wireless techniques used in the weather monitoring having
GSM, FM channel, Zigbee, RF etc Protocols.
ALAM SURVEY hadir untuk menjadi rekan kerja terbaik dalam menyediakan beragam alat survey yang dibutuhkan sesuai dengan biaya yang dimiliki oleh Anda.
Informasi Lengkap :
FERY – Alam Survey
0878 8502 8163
0812 1953 9224
0856 992 7447
Daryl Bess has over 27 years of experience as an electrician and electronics technician, including 11 years as Chief Electrician on offshore vessels. He is Coast Guard certified and holds a Top Secret clearance from his time serving in the U.S. Navy. Bess seeks a senior electrical position where he can utilize his skills and experience to contribute to a reputable company. He has extensive qualifications in industrial electrical work, electronics maintenance, and supervisory experience.
Una red social es una estructura social compuesta por individuos u organizaciones relacionados entre sí según algún criterio como amistad o parentesco. Las redes sociales representan estos actores como nodos y sus relaciones como líneas que los unen. El análisis de redes sociales aplica la teoría de grafos para estudiar esta estructura social, identificando entidades como nodos y relaciones como enlaces.
Pemerintah Indonesia berencana mengembangkan industri halal untuk meningkatkan ekspor dan pariwisata. Industri halal diharapkan dapat menjadi andalan baru ekonomi dengan memanfaatkan sumber daya alam dan SDM yang melimpah. Kerjasama dengan negara-negara lain diperlukan untuk mewujudkan potensi besar industri halal Indonesia.
The Indian Railways is an integral part of India’s economy. Each and every one of us is directly or indirectly dependent on it. However our railways is very obsolete in nature. A lot has been said nowadays about the introducing metros and bullet trains. However we must first conduct a ground study on the current situation. We must first identify the areas which need urgent improvement. There is no better way that accessing the Indian Railways than by taking a passenger feedback. We therefore decided to understand the situation and arrive at some conclusions by undertaking a passenger survey.
The document discusses potential hair care sales promotion strategies for Boots, a UK-based retailer. It analyzes the advantages and disadvantages of three strategies: 3 for 2, receive a gift with purchase (GWP), and on-pack coupon worth 50% off. Of the three options, the analysis finds that the 3 for 2 strategy has the highest estimated sales growth of 300% and lowest promotional costs per unit, making it the most profitable promotion. However, it notes that the GWP and coupon strategies could work well with modifications to increase their impact and differentiate from competitors' approaches.
This document describes a parking monitoring control system project created by a group of electrical engineering students. The system uses RFID sensors and an IR sensor to detect vehicles and available parking spaces. An Arduino microcontroller processes the sensor signals. A 16x24 LED matrix displays the status of parking spaces. A servo motor and cellular shield allow remote monitoring via SMS. The system aims to help drivers locate available spaces and provide data on parking usage.
This document is a project report submitted by group 7 for the ECE:5995 Spring 2016 course at the University of Iowa. It details the development of a system called LiveLongTM to monitor heart rate and environmental sensors over 3 weeks under the supervision of two professors. The system uses an Arduino, Bluetooth LE, Raspberry Pi, BME280 sensor and heart rate sensor to collect and analyze biometric and environmental data with the goals of predicting health issues and providing alerts. It discusses the hardware and software components, security considerations, data analytics, limitations and future work.
The City of Bakersfield, CA GIS Implementation Plan (1997 - 1998)Juan Tobar
The document provides an implementation plan for the City of Bakersfield Geographic Information System (COBGIS) for 1997-1998. It conducted a data survey and needs analysis of each city department to identify key spatial datasets and GIS needs. It then outlines the proposed system design, including software/hardware platforms and standards. The implementation plan describes projects to complete over the next year, including porting existing datasets into the GIS, updating parcel and address information, linking databases, and performing image analysis. Completing these projects would help develop a shared GIS resource across city departments.
1. The document provides an operation manual for the IQ-BASIC-GPS flight instrument.
2. It describes the instrument's key features and functions, including altimeters, variometers, navigation functions using GPS, waypoints, routes, and flight memory recording.
3. The manual provides detailed instructions on operating the instrument, navigating menus to adjust settings, and using functions like variometer tones, waypoints, and flight analysis.
1. The document provides an operation manual for the IQ-BASIC-GPS flight instrument.
2. It describes the instrument's key features and functions, including altimeters, variometers, navigation functions using GPS, waypoints, routes, flight memory and data transfer.
3. The manual provides detailed instructions on operating the instrument, navigating menus and settings, and using functions for optimizing flight like wind data, glide ratio and relocating thermals.
This document describes a heart monitoring system that measures heart rate and body temperature. The system uses sensors worn by the user that send data to an LCD interface. It aims to allow users to safely monitor their heart rate during exercise and ensure their safety by also displaying temperature. The system measures heart rate every 3 seconds and will alert the user if their heart rate exceeds a predefined safe zone. It also measures body temperature and will alert if temperature exceeds a preset level. The target market is people interested in mobile health, especially younger males. The system provides real-time feedback to help users understand their cardiovascular health and physical activity safety.
1) The document describes a proposed miniature satellite that would use sensors and machine learning to analyze atmospheric conditions.
2) The satellite would be housed in a 4cm cube and carry sensors to measure pressure, temperature, UV radiation, acceleration and rotation. It would store data on an SD card.
3) The satellite would use multiple linear regression machine learning on the sensor data to predict future atmospheric conditions and satellite trajectories, helping with weather forecasting and research. It aims to make satellites cheaper and easier to deploy.
This document describes a 3D microwave scanning system project. The goal is to design a scanner that can move in three dimensions and use microwave radiation to scan objects and detect defects. The scanner will obtain 3D data by merging multiple 2D image layers taken at different depths. LabVIEW will be used to control the scanner hardware and collect voltage data, which will then be converted to a 3D image using MATLAB. The project aims to address issues with an existing scanner design and improve the system's ability to acquire accurate 3D microwave imaging data.
This document is a project report on an Eye Tracking Interpretation System submitted by three students as a partial fulfillment of their Bachelor of Electronics and Telecommunication Engineering degree. It includes sections on introduction, literature survey, system description, software description, methodology, results, applications, and conclusion. The system uses an ultrasonic sensor and microcontroller to measure the distance to obstacles and displays it on an LCD screen. It aims to provide a low-cost solution for distance measurement that works in different light conditions including underwater.
This document is a user's guide for an infrared thermometer calibrator that provides instructions on its safe operation and maintenance. It contains warnings about not touching hot surfaces on the device and maintaining proper spacing. The guide also outlines the device's specifications, operation instructions, and calibration procedures.
Alarm System for Medicine Reminder Based on Microcontrollerijtsrd
This paper investigates based on microcontroller medicine reminder alarm system. This system includes the DS1307 Real Time Clock RTC module, L298N motor driver, DC motor, I2C Liquid Crystal Display LCD module, four pushbuttons and buzzer. Arduino UNO is used to activate the whole system. Four types of push button enter the time for the person to take medicine. The clock module is used to set up time and LCD is used to display time for the taking medicine. The buzzer is used to alarm the time for taking medicine. The motor driver is used to drive the DC motor which controls the opening and closing function of the medical box. Ni Ni San Hlaing | San San Naing "Alarm System for Medicine Reminder Based on Microcontroller" Published in International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-3 | Issue-5 , August 2019, URL: https://www.ijtsrd.com/papers/ijtsrd26518.pdfPaper URL: https://www.ijtsrd.com/engineering/electronics-and-communication-engineering/26518/alarm-system-for-medicine-reminder-based-on-microcontroller/ni-ni-san-hlaing
IRJET- Arduino Based Weather Monitoring SystemIRJET Journal
This document describes an Arduino-based weather monitoring system that was developed to automatically collect weather data including temperature, humidity, and light intensity. The system uses sensors connected to an Arduino microcontroller to measure these variables over time. The sensor readings are stored in a file and can be displayed graphically to analyze weather patterns. The system was designed to forecast weather without human error by sensing key factors that determine weather conditions. It was found to successfully collect weather data through experiments and demonstrate weather patterns through generated graphs.
The document describes a project to design an instrument that takes measurements from two sensors in a physics lab and calculates the power ratio between them in real-time. The design includes both analog and digital processing components. The analog portion performs a division of the sensor signals, while the digital portion handles data collection, display, and user interface functions using a microcontroller. Through testing, the designers found that software played a larger role than anticipated. While accurate for power meters, the design was not suitable for photon detectors due to their signal characteristics. With further optimization, the instrument could achieve greater accuracy.
Una red social es una estructura social compuesta por individuos u organizaciones relacionados entre sí según algún criterio como amistad o parentesco. Las redes sociales representan estos actores como nodos y sus relaciones como líneas que los unen. El análisis de redes sociales aplica la teoría de grafos para estudiar esta estructura social, identificando entidades como nodos y relaciones como enlaces.
Pemerintah Indonesia berencana mengembangkan industri halal untuk meningkatkan ekspor dan pariwisata. Industri halal diharapkan dapat menjadi andalan baru ekonomi dengan memanfaatkan sumber daya alam dan SDM yang melimpah. Kerjasama dengan negara-negara lain diperlukan untuk mewujudkan potensi besar industri halal Indonesia.
The Indian Railways is an integral part of India’s economy. Each and every one of us is directly or indirectly dependent on it. However our railways is very obsolete in nature. A lot has been said nowadays about the introducing metros and bullet trains. However we must first conduct a ground study on the current situation. We must first identify the areas which need urgent improvement. There is no better way that accessing the Indian Railways than by taking a passenger feedback. We therefore decided to understand the situation and arrive at some conclusions by undertaking a passenger survey.
The document discusses potential hair care sales promotion strategies for Boots, a UK-based retailer. It analyzes the advantages and disadvantages of three strategies: 3 for 2, receive a gift with purchase (GWP), and on-pack coupon worth 50% off. Of the three options, the analysis finds that the 3 for 2 strategy has the highest estimated sales growth of 300% and lowest promotional costs per unit, making it the most profitable promotion. However, it notes that the GWP and coupon strategies could work well with modifications to increase their impact and differentiate from competitors' approaches.
This document describes a parking monitoring control system project created by a group of electrical engineering students. The system uses RFID sensors and an IR sensor to detect vehicles and available parking spaces. An Arduino microcontroller processes the sensor signals. A 16x24 LED matrix displays the status of parking spaces. A servo motor and cellular shield allow remote monitoring via SMS. The system aims to help drivers locate available spaces and provide data on parking usage.
This document is a project report submitted by group 7 for the ECE:5995 Spring 2016 course at the University of Iowa. It details the development of a system called LiveLongTM to monitor heart rate and environmental sensors over 3 weeks under the supervision of two professors. The system uses an Arduino, Bluetooth LE, Raspberry Pi, BME280 sensor and heart rate sensor to collect and analyze biometric and environmental data with the goals of predicting health issues and providing alerts. It discusses the hardware and software components, security considerations, data analytics, limitations and future work.
The City of Bakersfield, CA GIS Implementation Plan (1997 - 1998)Juan Tobar
The document provides an implementation plan for the City of Bakersfield Geographic Information System (COBGIS) for 1997-1998. It conducted a data survey and needs analysis of each city department to identify key spatial datasets and GIS needs. It then outlines the proposed system design, including software/hardware platforms and standards. The implementation plan describes projects to complete over the next year, including porting existing datasets into the GIS, updating parcel and address information, linking databases, and performing image analysis. Completing these projects would help develop a shared GIS resource across city departments.
1. The document provides an operation manual for the IQ-BASIC-GPS flight instrument.
2. It describes the instrument's key features and functions, including altimeters, variometers, navigation functions using GPS, waypoints, routes, and flight memory recording.
3. The manual provides detailed instructions on operating the instrument, navigating menus to adjust settings, and using functions like variometer tones, waypoints, and flight analysis.
1. The document provides an operation manual for the IQ-BASIC-GPS flight instrument.
2. It describes the instrument's key features and functions, including altimeters, variometers, navigation functions using GPS, waypoints, routes, flight memory and data transfer.
3. The manual provides detailed instructions on operating the instrument, navigating menus and settings, and using functions for optimizing flight like wind data, glide ratio and relocating thermals.
This document describes a heart monitoring system that measures heart rate and body temperature. The system uses sensors worn by the user that send data to an LCD interface. It aims to allow users to safely monitor their heart rate during exercise and ensure their safety by also displaying temperature. The system measures heart rate every 3 seconds and will alert the user if their heart rate exceeds a predefined safe zone. It also measures body temperature and will alert if temperature exceeds a preset level. The target market is people interested in mobile health, especially younger males. The system provides real-time feedback to help users understand their cardiovascular health and physical activity safety.
1) The document describes a proposed miniature satellite that would use sensors and machine learning to analyze atmospheric conditions.
2) The satellite would be housed in a 4cm cube and carry sensors to measure pressure, temperature, UV radiation, acceleration and rotation. It would store data on an SD card.
3) The satellite would use multiple linear regression machine learning on the sensor data to predict future atmospheric conditions and satellite trajectories, helping with weather forecasting and research. It aims to make satellites cheaper and easier to deploy.
This document describes a 3D microwave scanning system project. The goal is to design a scanner that can move in three dimensions and use microwave radiation to scan objects and detect defects. The scanner will obtain 3D data by merging multiple 2D image layers taken at different depths. LabVIEW will be used to control the scanner hardware and collect voltage data, which will then be converted to a 3D image using MATLAB. The project aims to address issues with an existing scanner design and improve the system's ability to acquire accurate 3D microwave imaging data.
This document is a project report on an Eye Tracking Interpretation System submitted by three students as a partial fulfillment of their Bachelor of Electronics and Telecommunication Engineering degree. It includes sections on introduction, literature survey, system description, software description, methodology, results, applications, and conclusion. The system uses an ultrasonic sensor and microcontroller to measure the distance to obstacles and displays it on an LCD screen. It aims to provide a low-cost solution for distance measurement that works in different light conditions including underwater.
This document is a user's guide for an infrared thermometer calibrator that provides instructions on its safe operation and maintenance. It contains warnings about not touching hot surfaces on the device and maintaining proper spacing. The guide also outlines the device's specifications, operation instructions, and calibration procedures.
Alarm System for Medicine Reminder Based on Microcontrollerijtsrd
This paper investigates based on microcontroller medicine reminder alarm system. This system includes the DS1307 Real Time Clock RTC module, L298N motor driver, DC motor, I2C Liquid Crystal Display LCD module, four pushbuttons and buzzer. Arduino UNO is used to activate the whole system. Four types of push button enter the time for the person to take medicine. The clock module is used to set up time and LCD is used to display time for the taking medicine. The buzzer is used to alarm the time for taking medicine. The motor driver is used to drive the DC motor which controls the opening and closing function of the medical box. Ni Ni San Hlaing | San San Naing "Alarm System for Medicine Reminder Based on Microcontroller" Published in International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-3 | Issue-5 , August 2019, URL: https://www.ijtsrd.com/papers/ijtsrd26518.pdfPaper URL: https://www.ijtsrd.com/engineering/electronics-and-communication-engineering/26518/alarm-system-for-medicine-reminder-based-on-microcontroller/ni-ni-san-hlaing
IRJET- Arduino Based Weather Monitoring SystemIRJET Journal
This document describes an Arduino-based weather monitoring system that was developed to automatically collect weather data including temperature, humidity, and light intensity. The system uses sensors connected to an Arduino microcontroller to measure these variables over time. The sensor readings are stored in a file and can be displayed graphically to analyze weather patterns. The system was designed to forecast weather without human error by sensing key factors that determine weather conditions. It was found to successfully collect weather data through experiments and demonstrate weather patterns through generated graphs.
The document describes a project to design an instrument that takes measurements from two sensors in a physics lab and calculates the power ratio between them in real-time. The design includes both analog and digital processing components. The analog portion performs a division of the sensor signals, while the digital portion handles data collection, display, and user interface functions using a microcontroller. Through testing, the designers found that software played a larger role than anticipated. While accurate for power meters, the design was not suitable for photon detectors due to their signal characteristics. With further optimization, the instrument could achieve greater accuracy.
This document provides installation, service and maintenance instructions for low voltage air circuit breakers. It details specifications of SACE PR122/P and PR123/P protection relays, including their identification, characteristics, user interface, protection functions, measuring functions and main functions. The document contains warnings about safety procedures that must be followed when installing or servicing circuit breakers.
This quick start tutorial demonstrated some of the basic modeling and analysis features of PHASE2 using a simple excavation model:
1. The excavation geometry and external boundary were created, and the model was meshed using default parameters.
2. Constant field stresses were applied, and material properties for the rockmass were defined.
3. The model was then analyzed, and results such as displacements, stresses, and strength factors could be interpreted.
4. Basic interpretation tools like data queries, graphs, and the info viewer were demonstrated.
The document provides a user guide for a component preparation system. It outlines 10 main sections: 1) Logging in, 2) System Administration including user registration, 3) Changing passwords, 4) Master data maintenance, 5) Label printing, 6) Material movement, 7) Material adjustments, 8) Production ordering, 9) Reset durations, and 10) Reporting including monitoring, history reports, and more. The guide describes the key functions within each section and provides screenshots of relevant system menus and forms.
This document provides a tutorial on using an Arduino board with an MPU-6050 inertial measurement unit (IMU) sensor and nRF24L01 wireless communication module. It describes the history and software of Arduino, details of IMUs and the specific MPU-6050 sensor, schematics and code for reading data from the MPU-6050 over I2C, and schematics and code for wireless data transmission with the nRF24L01 module. The goal is to integrate these components to create a functioning motion sensing and wireless data transmission project using the Arduino platform.
5. 5
ABSTRACT
The object of this project was to build a single compact system that could properly read various climate
conditions and then alert the host via text messaging of those conditions. The idea was sparked by the
coming of spring and the inconsistency of the weather. Our small boxed station provided the user quick
reminders of the current conditions outside without watching the news or even opening your phone.
BeagleBone Black and Cloud9 software was use to program one BeagleBone Black single board
computer. Two I2C sensors were used to take readings. One of the two was the SI1145 UV sensor, the
other was the BMP180 temperature and barometric pressure sensor. On the front panel is a single serial
LCD screen, four LEDs one of which is RGB, a toggle switch for mode selection and two pushbuttons for
manual manipulation. The LEDs are color coded for UV indications and the Serial LCD screen gives
prompts and shows visible readings.
The end game of the project is to model a portable, easy to set up, weather station that can notify anyone
what the outside conditions are at any given moment. The system can help prioritize ones activities and
time with precise readings and clear notifications.
6. 6
INTRODUCTION
The weather is constantly fluctuating throughout the day. At one time it can be sunny with no clouds in
sight then 30 minutes later it can be raining. On other days the UV rays can be really high and other it will
not be. These fluctuations on climates conditions can cause some people hassle and other to be ill
prepared to go outside.
This is why we engineered the weather station. This station helps utilize time management by pre-
prompting the user with valuable outside information catering to their condition. Some of these conditions
include but are not limited to temperature, humidity, barometric pressure and UV index. One does not
have to turn on the TV and wait for the news to inform them that it’s raining outside. One also does not
have to get a weather app or widget on their phone since the weather information will already be sent to
them.
Engineering is a way to simplify the future and help the mass public prioritize every measure of their life.
This small system helps that future prioritize.
7. 7
OPERATING INSTRUCTIONS
User Interface:
4-Leds UV index:
1) UV index 0-2 (indicates safe UV reading, Green LED)
2) UV index 3-5 (indicates average UV reading, Yellow LED)
3) UV index 6-7 (indicates high UV reading, Orange LED)
4) UV index 8-10 (indicates very high UV reading, Red LED)
5) UV index 11+ (RGB LED shared with green, indicates dangerous levels of UV, Blue LED)
Figure 1.User Interface
1-Toggle Switch:
Mode select (up-manual, down-automatic)
2-Push-buttons (manual mode only):
Black (Scroll button, scrolls available reading options)
Red (Select button, Takes the reading indicated by the scroll push button)
1-Serial LCD screen:
Displays information to user of which reading is currently displayed which mode you are in and
team name and information.
8. 8
Operating Instructions:
1) Plug a 5v barrel jack into the system.
Figure 2. HNR Weather Station Ports
Upon being powered on the project name and the initials of the group member will be displayed.
Figure 3. Startup Display
After the startup, the system will be in auto mode.
In auto mode, the screen will cycle through the readings and light the corresponding LED.
2) At this point you can set the desired mode by flipping the toggle switch.(up-manual or down-
auto)
This can be set at any time after the startup. The device can transition from one mode to another
at any time during the device operation.
3) If auto is set (toggle-down), the system cycles through the reading as shown below.
9. 9
Figure 4. Auto Mode-Current Temp
Figure 5. Auto Mode-Baro. Pressure
10. 10
Figure 6. Auto Mode-UV Index
4) If manual mode is set (toggle-up), the system operates by pressing the pushbuttons.
By pressing the scroll, button the screen cycles through the readings.
After which by pressing the select button you have selected that reading for display.
Figure 7. Manual Mode
13. 13
Hardware Description
Figure 12. BeagleBone Black
The central controller is the BeagleBone Black. The capabilities of this single board computer include but
not limited to: 2 ports with 46 I/O pins, UART, SPI, I2C, 1GHz processor, and the Linux operating
system.
This single board controls all of the switches, LEDs, communication with the two I2
C sensors,
communication with the serial LCD , call functions, and everything else that has to do with the project.
Through a series of serial and I2C commands the computer gets the sensor data and displays it on the
screen.
LEDs:
Figure 13. LEDs
The 4 LEDs provide real-time indication of the current UV index value. The first LED is a RGB LED that
shows both green and blue when indicated. The LEDs are setup to respond to an active high from the
BBB. The other three LEDs are red, yellow, and orange. These LEDs correspond to the UV index levels.
These LEDs are also connected to pins 7, 8, 9, 10, and 11 on the P8 header of the BBB.
14. 14
Switches:
Figure 14. Mode Selection Switch
There is one SPST toggle switches that controls the mode selection. One side of the switch is tied to
ground and the other is tied to a controller pin and the BBB’s internal pull-up resistor. This switch is
connected to the P8 header pin 14 on the board.
Pushbuttons:
Figure 15. Scroll & Select Buttons
Two pushbuttons are implemented in the design. The pushbuttons are normally open circuits. On one side
of the pushbuttons is ground. The other side connects to P8 pin 12 and 13 on the board as well as a pull-
up resistor to 3.3v.
Serial LCD:
Figure 16. Sparkfun Serial LCD
A 3.3v 16x2 serial LCD display is used in the design. The LCD has 3 wires power, ground and receive.
The receive wire connects to the controller using P9 pins 13. The other two wires are connected to 3.3v
and ground on the board P9 pin 3 and P9 pin 1 respectively.
15. 15
SI1145 UV sensor:
Figure 17. SI1145 UV Index Sensor
The SI1145 is a UV sensor that runs off 3.3v and is I2
C compatible. The board has the standard data line,
clock line, power and ground. The board uses P9 pin 19 for SCL and P9 pin 20 for SDA. The power and
ground are connected to the on board 3.3v supply and ground. This sensor gives off the UV reading as a
16bit Hex number that has to be converted in to the proper UV index reading.
BMP180 Temp. Pressure sensor:
Figure 18. BMP180 Temp. & Baro. Pressure Sensor
The BMP180 is a temperature and pressure sensor. It runs off 3.3v and is I2
C compatible. The board has
the standard data line, clock line, power and ground. The board uses P9 pin 19 for SCL and P9 pin 20 for
SDA. The power and ground are connected to the on board 3.3v supply and ground. The sensor returns
the readings as character strings.
16. 16
Software Description:
The BBB computer sends data to the SI1145 and BMP180 respectively to initialize both sensors and take
a reading. To do this a series of system commands are sent through I2C connection to each board. In case
of the SI1145 one must first write 0x17 HEX to address 0x07 via the i2cset command. After a few other
set commands, when ready by writing 0x07 HEX to address 0x18, 0x12 HEX to address 0x18 and
reading registers 0x2C and 0x2D respectively you have just forced a measurement and read the return
value After this is done the read output is redirected into a file on the BBB for manipulating. See Figure
18 for a code example.
Figure 19. SI1145 Configuration
To use the BMP180, I2
C must be enabled first on the BBB. This is done by using the echo command and
directing the output to /sys/device/bone_capemgr.9/slots. The output path is referred to as SLOTS in
Figure 19. Next the device drives must be load by using the command echo "bmp085 0x77" >
/sys/class/i2c-adapter/i2c-1/new_device. Next, the dmesg | grep bmp command is used to read the
kernel message to verify the device drivers were loaded properly
Figure 20. BMP180 Configuration
17. 17
To use the BMP180 sensor the device file paths is defined in the BMP180Temp-Pressure.c file. These
defined paths are then used to directly communicate with the board through file handling. The fopen
command is used to open the device file and the data is read into a character string buffer. These
characters have to be converted into floats in order to properly be displayed on the LCD. The atof
function is used to convert the character string to a float value. Figure 20 shows the exact code snippet
that does what was mentioned above.
Figure 21. BMP180 Operation Code
18. 18
Conclusion
Key Results and Findings
Designing an impromptu project on the fly with limited time and actually finish most of it was
great to see firsthand. By working in a group and dividing up the workload this was possible.
Unlike in digital we were able to skip some steps to speed up the process and used a better
controller and a higher level coding language. This helped the project run more smoothly but did
not extinguish all problems. We as a group had to be okay with making decisions that directly
affected our project and cope with major setbacks. This process helped developed skills that will
be essential as engineers. Skills from critical thinking to research and development were tested
and honed for future use in industry. The overall project experience was a step up from our last
one due to the upgrade in information and equipment. Therefore, this resulted in the process
running smoother.
Difficulties
Working with the BeagleBone Black single board computer was the focus of the project, but
surprisingly this was not the biggest issue we had. The I2
C set up gave us the biggest hassle due
to the lack of information on I2
C configuration. This caused us to use up valuable time in
understanding how our board uses its I2
C ports and how to communicate with our sensors within
c programing. We also spent multiple days reading the sensor data sheets trying to understand
how they communicate through I2
C. These tasks took away valuable time that could have been
used to refine and enhance the project. We had to remove one of the sensors as well as the Wi-Fi
dongle for text messaging. However, this simplified the project and taught us how to deal with
setbacks.
Next steps
Our original goal was to build a user friendly that would prepare the user for outside activates via
text messaging and/or email of the following conditions:
Temperature
Humidity
Barometric Pressure
UV index
Once this is accomplished we wanted to implement some type of internet connection that would
pull in more weather data and send that data to the user. Since these features were not
implemented in the current system, they are in the plans for future revisions. A better enclosure
that is durable for outside conditions should be used as well as some better wire connectors.
Lastly, some more LEDs for UV index should be included on the front panel to better display the
index.
19. 19
APPENDIX 1 – Parts List
Hardware
Part name Part number Quantity Price Total Vendor Surplus
BeagleBoneBlack (P/N:83-16241) 1 $39.99 $39.99 Microcenter Surplus
SI1145 (P/N: 1777) 1 $9.95 $9.95 Adafruit ----------
BMP180 (P/N: 1603) 1 $9.95 $9.95 Adafruit Surplus
3.3 V Serial LCD (P/N: LCD-09066) 1 $24.95 $24.95 SparkFun Surplus
LED Holders (Catalog #: 2760080) 2 $1.99 $3.98 Radioshack Surplus
SPST Momentary
Switch
(Catalog #: 2751547) 1 $3.99 $3.99 Radioshack Surplus
Toggle Switch (Catalog #: 55050562) 1 $3.20 $3.20 Radioshack Surplus
RGB LED (P/N:NTE30115) 1 $4.99 $4.99 Microcenter Surplus
LEDS N/A 3 N/A N/A SPSU Tech. Shop ----------
M to F Jumper
Cable Wires
(P/N: GK1212750) 1 $2.51 $2.51 Amazon Surplus
Resistors 1kΩ N/A 5 N/A N/A SPSU Tech. Shop -----------
-
Breadboard (P/N: 090302_F) 1 $5.95 $5.95 Amazon Surplus
TOTAL $109.46
23. 23
APPENDIX 4 – Source Code
WeatherStationMain.c
/******************************************************************************
* Name : WeatherStationMain.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* This code handles the running of the system while in manual
* mode.
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "WeatherStation.h"
int main()
{ int modeSwitchState;
int trueLock =1;
int increment = 0;
char tempBuffer[7];
char pressureBuffer[11];
char startScreen1 [] = " HNR ";
char startScreen2 [] = " Weather Station";
char tempString [] = " Current Temp: ";
char tempPrintPosition [] = "xC5";
char baroString [] = " Baro. Pressure:";
char baroPrintPosition [] = "xC3";
char manualModeString [] = " Manual Mode ";
char UVString [] = " UV Index: ";
char UVindex[6];
char UVPrintPosition [] = "xC6";
float UVvalue;
clearScreen();
writeToScreen(startScreen1);
writeToScreen(startScreen2);
sleep(2);
clearScreen();
initSi1145();
//---------------------------------------------------------------------------
// infinite loop
// Continually gets the current temperature and barometric pressure and
// writes it to the LCD screen. In addition, it continually gets the
// UV index value and displays it on the screen and turns on the
// corresponding LED. Also, this loop continually checks to see if the
// Manual Mode Switch has been activated.
//---------------------------------------------------------------------------
while (trueLock ==1)
{
clearScreen();
writeToScreen(tempString);
24. 24
strcpy(tempBuffer, getTemp()); //copies the return value of getTemp into
//tempBuffer
moveCursor(tempPrintPosition);
writeToScreen(tempBuffer);
ManualModeCheck();
clearScreen();
writeToScreen(baroString);
strcpy(pressureBuffer, getPressure()); //copies the return value of
//getPressure into pressureBuffer
moveCursor(baroPrintPosition);
writeToScreen(pressureBuffer);
ManualModeCheck();
clearScreen();
resetLEDS();
UVvalue = readUV();
sprintf(UVindex, "%.3f",UVvalue); //float to string conversion
writeToScreen(UVString);
moveCursor(UVPrintPosition);
writeToScreen(UVindex);
turnOnUVIndexLEDs(UVvalue);
ManualModeCheck();
}
return EXIT_SUCCESS;
}
UVLEDs.c
/******************************************************************************
* Name : UVLEDs.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* Compares the inputted UV index value to determine which LED to
* turn on.
*****************************************************************************/
#include <stdio.h>
#include "WeatherStation.h"
/*==============================================================================
* Function : turnOnUVIndexLEDs
* Return : none
* Parameters : float UVvalue: UV index value
* Description :
* Compares the inputted UV index value to determine which LED to
* turn on.
*
* Green Yellow Orange Red Blue
* 1 2 3 4 5 6 7 8 9 10 11
*==============================================================================
*/
25. 25
void turnOnUVIndexLEDs(float UVvalue)
{
if (UVvalue <=2.00)
{
printf ("Green LED ON!n");
setLed('g', LED_ON);
}
if (UVvalue >2.00 && UVvalue <= 5.00)
{
printf ("Yellow LED ON!n");
setLed('y', LED_ON);
}
if (UVvalue >5.00 && UVvalue <= 7.00)
{
printf ("Orange LED ON!n");
setLed('o', LED_ON);
}
if (UVvalue >7.00 && UVvalue <= 10.00)
{
printf ("Red LED ON!n");
setLed('r', LED_ON);
}
if (UVvalue >10.00)
{
printf ("Blue LED ON!n");
setLed('b', LED_ON);
}
}
SI1145Handle.c
/******************************************************************************
* Name : SI1145Handle.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* Controls all the guts of the programming. The text output of the
* readings are redirected into the "UV.txt" file. That file is then
* read into a buffer which is compared to known HEX values for
* decimal conversion:
*
* 'Handle' = Compares UV.txt to known HEX values.
* 'Convert' = Makes decimal equivalent of HEX values.
*
*****************************************************************************/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
26. 26
#include "WeatherStation.h"
//--Global variables for loops and usleep constants---------------------------
int a;
int b;
int c;
int d;
/*==============================================================================
* Function : Handle
* Return : none
* Parameters : none
* Description :
* Compares UV.txt to HEX char array and index holds value.
* Calls Convert when all HEX compares are done.
*==============================================================================
*/
void Handle(void)
{
//--Clears all variables before compares are done-------------------------
a = 0;
b = 0;
c = 0;
d = 0;
//--established standard array/w pointer---------------------------------
char UVband[17]={'0','1','2','3','4','5','6','7','8','9',
'a','b','c','d','e','f'};
//--Initialization of buffer array---------------------------------------
char UVbuffer[9];
FILE *fileHandle = NULL;
//--Read UV.txt Hex values------------------------------------------------
if ((fileHandle = fopen("UV.txt", "r")) != NULL)
{
fread(UVbuffer, sizeof(char), 9, fileHandle);
fclose(fileHandle);
}
//--Print what's in the UV.txt file to the front screen------------------
do
{
printf("n %c", UVbuffer[a]);
a ++;
}
while(a < 9);
//--Clears the a variable to be reused for the compare-------------------
a = a*0;
//------------------------------------------------------------------------
// do while loop
27. 27
// Comparing the frist Hex value in UV.txt to '0' in the char array.
//------------------------------------------------------------------------
do
{
//--Compares if valus is equal----------------------------------------
if (UVbuffer[2] == UVband[a])
{
//--if compare true sleep for a second--------------------------------
sleep(1);
}
//--Handles prompt if nothing was matched-----------------------------
else
{
//--moves to the next index in char array------------------------
++ a;
}
}
//--Continues the do/while until a match is found------------------------
while(UVbuffer[2] != UVband[a]);
//-----------------------------------------------------------------------
// do while loop
// Comparing the second Hex value in UV.txt to '0' in the char array.
//------------------------------------------------------------------------
do
{
//--Compares if valus is equal----------------------------------------
if (UVbuffer[3] == UVband[b])
{
//--if compare true sleep for a second--------------------------------
sleep(1);
}
//--Handles prompt if nothing was matched------------------------------
else
{
//--moves to the next index in char array-------------------------
++ b;
}
}
//--Continues the do/while until a match is found------------------------
while(UVbuffer[3] != UVband[b]);
//------------------------------------------------------------------------
// do while loop
// Comparing the third Hex value in UV.txt to '0' in the char array.
//------------------------------------------------------------------------
do
{
//--Compares if valus is equal----------------------------------------
if (UVbuffer[7] == UVband[c])
{
//--if compare true sleep for a second--------------------------------
sleep(1);
}
//--Handles prompt if nothing was matched-------------------------------
else
28. 28
{
//--moves to the next index in char array------------------------
++ c;
}
}
//--Continues the do/while until a match is found------------------------
while(UVbuffer[7] != UVband[c]);
//------------------------------------------------------------------------
// do while loop
// Comparing the fourth Hex value in UV.txt to '0' in the char array.
//------------------------------------------------------------------------
do
{
//--Compares if valus is equal----------------------------------------
if (UVbuffer[8] == UVband[d])
{
//--if compare true sleep for a second--------------------------------
sleep(1);
}
//--Handles prompt if nothing was matched-------------------------------
else
{
//--moves to the next index in char array------------------------
++ d;
}
}
//--Continues the do/while until a match is found------------------------
while(UVbuffer[8] != UVband[d]);
}
/*==============================================================================
* Function : Convert
* Return : none
* Parameters : none
* Description :
* Called from Handle takes the global variables and adds them
* together to get the decimal equivalent of those HEX values. Then
* does the UV conversion turning the decimal into a float that
* holds the UV index number.
*==============================================================================
*/
float Convert()
{
printf("n you are in convert");
//--Local variables to hold float UV index-------------------------------
float e = 0;
//--Multiplying the Global variables by there decimal equivalent---------
a = a*256;
b = b*16;
//--Turns the decimal number into a float--------------------------------
e = (a + b + c)/1000.00;
//--Prints float to the front screen-------------------------------------
printf("n %f", e);
return e;
29. 29
}
SI1145main.c
/******************************************************************************
* Name : SI1145main.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* Controls all system commands and I2C setup for communicating to
* the UV sensor. This code is also responsible for redirecting the
* UV reading output into the UV.txt file for future comparison:
*
* 'main' = Sets all parameters for the I2C communication between
* the UV board and the BBB.
* 'reset' = Resets all registers and parameters in the UV board.
* 'readUV' = Calls Handle and Convert for processing of the UV
* reading.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
#include "WeatherStation.h"
/*==============================================================================
* Function : main
* Return : none
* Parameters : none
* Description :
* Sets up all I2C commands, UV board registers and parameters for
* communication.
*==============================================================================
*/
void initSi1145()
{
//--I2C command to Initialize UV board--------------------------------------
system("i2cset -y 1 0x60 0x07 0x17");
usleep(100);
//--I2C commands for setting proper coefficents for UV reading--------------
system("i2cset -y 1 0x60 0x13 0x29");
system("i2cset -y 1 0x60 0x14 0x89");
system("i2cset -y 1 0x60 0x15 0x02");
system("i2cset -y 1 0x60 0x16 0x00");
//--I2C command for setting enabling the UV reader-------------------------
system("i2cset -y 1 0x60 0x17 0xf0");
system("i2cset -y 1 0x60 0x18 0xa1");
//--I2C command for UV enable confirmation---------------------------------
system("i2cget -y 1 0x60 0x2e");
//--Calls for a UV reading and reset when doone----------------------------
}
30. 30
/*==============================================================================
* Function : reset
* Return : none
* Parameters : none
* Description :
* Resets all prior set parameters and registers in case of error.
*==============================================================================
*/
void reset(void)
{
//--I2C comand for resetting all set registers and parameters---------------
system("i2cset -y 1 0x60 0x18 0x01");
}
/*==============================================================================
* Function : readUV
* Return : none
* Parameters : none
* Description :
* Makes conversion in UV board pulls it out and populates UV.txt.
* Also calls proper functions for hadling the UV.txt compares.
*==============================================================================
*/
float readUV(void)
{
//--I2C command for taking a forced reading and redirecting the output------
system("i2cset -y 1 0x60 0x18 0x07");
system("i2cset -y 1 0x60 0x18 0x12");
system("i2cget -y 1 0x60 0x2D > UV.txt");
system("i2cget -y 1 0x60 0x2C >> UV.txt");
//--Calls Handle and Convert for file manipulation-------------------------
float indexValue;
Handle();
indexValue=Convert();
return indexValue;
}
SerialLCD.c
/******************************************************************************
* Name : SerialLCD.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* This file contains the functions necessary to use the
* SparkFun 3.3V Serial Enabled 16x2 LCD.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "WeatherStation.h"
31. 31
#define LCD_UART4_FILE "/dev/ttyO4"
/*==============================================================================
* Function : writeToScreen
* Return : none
* Parameters : String of chars
* Description :
* Writes the input string to the LCD screen.
*==============================================================================
*/
void writeToScreen(char * buffer)
{
FILE * filePtr;
filePtr = fopen (LCD_UART4_FILE ,"r+"); //r+:Open a file for reading&write
fputs (buffer,filePtr);
fclose (filePtr);
}
/*==============================================================================
* Function : clearScreen
* Return : none
* Parameters : none
* Description :
* Sends the clear command (xFE followed by x01) to the LCD.
*==============================================================================
*/
void clearScreen()
{
char clearScreen[] = "xFEx01";
FILE * filePtr;
filePtr = fopen (LCD_UART4_FILE ,"r+"); //r+:Open a file for reading&write
fputs (clearScreen,filePtr);
fclose (filePtr);
}
/*==============================================================================
* Function : moveCursor
* Return : none
* Parameters : String of chars: The cursor position in hex to move to.
* Description :
* Concatenates "xFE with the input char string. This will give
* the LCD the command to move the cursor and the position to
* move the cursor to.
*==============================================================================
*/
void moveCursor(char * position)
{
char moveCursor[7] = "xFE";
strcat(moveCursor, position); //concatenates:(dest,src)
FILE * filePtr;
filePtr = fopen (LCD_UART4_FILE ,"r+"); //r+:Open a file for reading&write
fputs (moveCursor,filePtr);
fclose (filePtr);
}
32. 32
ManualMode.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include "WeatherStation.h"
/******************************************************************************
* Name : ManualMode.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* This code handles the running of the system while in manual
* mode.
*****************************************************************************/
int modeSwitchState;
int increment = 0;
char manualModeString [] = " Manual Mode ";
char tempString [] = " Current Temp: ";
char tempBuffer[7];
char tempPrintPosition [] = "xC5";
char baroString [] = " Baro. Pressure:";
char baroPrintPosition [] = "xC3";
char pressureBuffer[11];
/*==============================================================================
* Function : ManualModeCheck
* Return : none
* Parameters : none
* Description :
* Checks if the Manual Modee Switch has been activated. If the
* Manual Mode Switch has been activated it checks whether the
* scroll switch has been pressed. If the Scroll Button has been
* pressed it checks what the current increment is and whether the
* Select Button has been pressed. The increment is used to
* determine what to write to the screen. If the Select Button is
* pressed and the increment is at one, the program will write the
* current temperature value to the screen. If the increment is at
* two, the program will write the current barometric pressure to
* the screen.
*==============================================================================
*/
void ManualModeCheck()
{
//--Creates 2 sec delay and checks switch state---------------------------------
for (int index = 0; index <200; index++)
{
modeSwitchState=isModeSwitchActive();
if (modeSwitchState==1) // if active
{
clearScreen();
writeToScreen(manualModeString);
sleep(2);
clearScreen();
33. 33
while (isModeSwitchActive() ==1)
{
if (isScrollButtonActive() ==1)
{ increment ++;
if (increment==1)
{
clearScreen();
writeToScreen(" Temperature ");
while (increment ==1)
{
//--checks state of the Select Button, Scrolll Button, and the Mode Switch------
if (isSelectButtonActive()==1)
{
clearScreen();
writeToScreen(tempString);
strcpy(tempBuffer, getTemp());
moveCursor(tempPrintPosition);
writeToScreen(tempBuffer);
break;
}
if (isScrollButtonActive() ==1)
{
increment ++;
break;
}
if (isModeSwitchActive() == 0) //Not active
{
break;
}
}
}
if (increment==2)
{
clearScreen();
writeToScreen(" Pressure ");
while (increment ==2)
{
//--checks state of the Select Button, Scrolll Button, and the Mode Switch------
if (isSelectButtonActive()==1)
{
clearScreen();
writeToScreen(baroString);
strcpy(pressureBuffer, getPressure());
moveCursor(baroPrintPosition);
writeToScreen(pressureBuffer);
break;
}
if (isScrollButtonActive() ==1)
{
increment ++;
break;
}
34. 34
if (isModeSwitchActive() == 0) //Not active
{
break;
}
}
}
if (increment ==3)
{
increment =0;
}
}
}
increment =0;
break;
}
//--10 ms delay-----------------------------------------------------------------
usleep(10000);
}
}
LED_Switches.c
/******************************************************************************
* Name : LED_Switches.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* This file contains the functions to initailize the LEDs and
* switches. In addition, this file contains the functions to check
* the state of the switches and reset the LEDs to off.
*
*****************************************************************************/
#include <stdio.h>
#include "WeatherStation.h"
#define MODE_SWITCH_DIRECTION_FILE "/sys/class/gpio/gpio26/direction"
#define MODE_SWITCH_VALUE_FILE "/sys/class/gpio/gpio26/value"
#define SCROLL_BUTTON_DIRECTION_FILE "/sys/class/gpio/gpio44/direction"
#define SCROLL_BUTTON_VALUE_FILE "/sys/class/gpio/gpio44/value"
#define SELECT_BUTTON_DIRECTION_FILE "/sys/class/gpio/gpio23/direction"
#define SELECT_BUTTON_VALUE_FILE "/sys/class/gpio/gpio23/value"
#define RED_LED_DIRECTION_FILE "/sys/class/gpio/gpio68/direction"
#define GREEN_LED_DIRECTION_FILE "/sys/class/gpio/gpio66/direction"
#define BLUE_LED_DIRECTION_FILE "/sys/class/gpio/gpio45/direction"
#define YELLOW_LED_DIRECTION_FILE "/sys/class/gpio/gpio67/direction"
#define ORANGE_LED_DIRECTION_FILE "/sys/class/gpio/gpio69/direction"
/*==============================================================================
* Function : initSwitchLed
35. 35
* Return : none
* Parameters : none
* Description :
* Initialize switch hardware and set default led state.
*==============================================================================
*/
void initSwitchLed(void)
{
//--place files paths within arrays to enable indexing through LEDs-------
const char *ledFiles[] = {RED_LED_DIRECTION_FILE,
GREEN_LED_DIRECTION_FILE,
BLUE_LED_DIRECTION_FILE,
YELLOW_LED_DIRECTION_FILE,
ORANGE_LED_DIRECTION_FILE};
FILE *fileHandle = NULL;
int i;
//--set initial LED state to off and port direction as output-------------
for (i=0; i<5; i++)
{
if ((fileHandle = fopen(ledFiles[i], "r+")) != NULL)
{
fwrite("low", sizeof(char), 3, fileHandle);
fclose(fileHandle);
}
}
//--set switch port direction----------------------------------------------
if ((fileHandle = fopen(MODE_SWITCH_DIRECTION_FILE, "r+")) != NULL)
{
fwrite("in", sizeof(char), 2, fileHandle);
fclose(fileHandle);
}
//--set button port direction----------------------------------------------
if ((fileHandle = fopen(SCROLL_BUTTON_DIRECTION_FILE, "r+")) != NULL)
{
fwrite("in", sizeof(char), 2, fileHandle);
fclose(fileHandle);
}
//--set button port direction----------------------------------------------
if ((fileHandle = fopen(SELECT_BUTTON_DIRECTION_FILE, "r+")) != NULL)
{
fwrite("in", sizeof(char), 2, fileHandle);
fclose(fileHandle);
}
}
/*==============================================================================
* Function : resetLEDs
* Return : none
* Parameters : none
* Description :
* Turns off all of the LEDs.
*==============================================================================
*/
36. 36
void resetLEDS()
{
//--place files paths within arrays to enable indexing through LEDs-------
const char *ledFiles[] = {RED_LED_DIRECTION_FILE,
GREEN_LED_DIRECTION_FILE,
BLUE_LED_DIRECTION_FILE,
YELLOW_LED_DIRECTION_FILE,
ORANGE_LED_DIRECTION_FILE};
FILE *fileHandle = NULL;
int i;
//--set initial LED state to off and port direction as output-------------
for (i=0; i<5; i++)
{
if ((fileHandle = fopen(ledFiles[i], "r+")) != NULL)
{
fwrite("low", sizeof(char), 3, fileHandle);
fclose(fileHandle);
}
}
}
/*==============================================================================
* Function : setLed
* Return : none
* Parameters : led = {Color}
* theState = {SWITCHLED_ON, SWITCHLED_OFF}
* Description :
* Change state of LED.
*==============================================================================
*/
void setLed(char led, int theState)
{
char *ledFile;
FILE *fileHandle = NULL;
switch(led)
{
case 'r':
ledFile = RED_LED_DIRECTION_FILE;
break;
case 'g':
ledFile = GREEN_LED_DIRECTION_FILE;
break;
case 'b':
ledFile = BLUE_LED_DIRECTION_FILE;
break;
case 'y':
ledFile = YELLOW_LED_DIRECTION_FILE;
break;
case 'o':
ledFile = ORANGE_LED_DIRECTION_FILE;
break;
}
if (theState == LED_ON)
{
//--turn LED on-------------------------------------------------------
37. 37
if ((fileHandle = fopen(ledFile, "r+")) != NULL)
{
fwrite("high", sizeof(char), 4, fileHandle);
fclose(fileHandle);
}
}
else
{
//--turn LED off------------------------------------------------------
if ((fileHandle = fopen(ledFile, "r+")) != NULL)
{
fwrite("low", sizeof(char), 3, fileHandle);
fclose(fileHandle);
}
}
}
/*==============================================================================
* Function : isModeSwitchActive
* Return : int {0 if not active, 1 if active}
* Parameters : none
* Description :
* Test switch state then return.
*==============================================================================
*/
int isModeSwitchActive(void)
{
FILE *fileHandle = NULL;
char buffer[2];
//--Read switch value-----------------------------------------------------
if ((fileHandle = fopen(MODE_SWITCH_VALUE_FILE, "r+")) != NULL)
{
fread(buffer, sizeof(char), 1, fileHandle);
fclose(fileHandle);
}
//--return appropriate value based upon switch position-------------------
if (buffer[0]=='0')
{
return 1; // Button is active.
}
else
{
return 0; // Button is not active.
}
}
/*==============================================================================
* Function : isScrollButtonActive
* Return : int {0 if not active, 1 if active}
* Parameters : none
* Description :
* Test switch state then return.
*==============================================================================
*/
int isScrollButtonActive(void)
{
38. 38
FILE *fileHandle = NULL;
char buffer[2];
//--Read switch value-----------------------------------------------------
if ((fileHandle = fopen(SCROLL_BUTTON_VALUE_FILE, "r+")) != NULL)
{
fread(buffer, sizeof(char), 1, fileHandle);
fclose(fileHandle);
}
//--return appropriate value based upon switch position-------------------
if (buffer[0]=='0')
{
return 1; // Button is active.
}
else
{
return 0; // Button is not active.
}
}
/*==============================================================================
* Function : isSelectButtonActive
* Return : int {0 if not active, 1 if active}
* Parameters : none
* Description :
* Test switch to state then return.
*==============================================================================
*/
int isSelectButtonActive(void)
{
FILE *fileHandle = NULL;
char buffer[2];
//--Read switch value-----------------------------------------------------
if ((fileHandle = fopen(SELECT_BUTTON_VALUE_FILE, "r+")) != NULL)
{
fread(buffer, sizeof(char), 1, fileHandle);
fclose(fileHandle);
}
//--return appropriate value based upon switch position-------------------
if (buffer[0]=='0')
{
return 1; // Button is active.
}
else
{
return 0; // Button is not active.
}
}
39. 39
BMP180Temp-Pressure.c
/******************************************************************************
* Name : BMP180Temp-Pressure.c
* Author : Harshpreet Saini, Norman Sims, Rahu M. Bannister
* Version : 1.0
* Copyright : 2015
* Description :
* This file contains the functions necessary to use the
* bmp180 temperature/barometric Pressure sensor.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "WeatherStation.h"
#define TEMPERATURE_FILE "/sys/bus/i2c/drivers/bmp085/1-0077/temp0_input"
#define PRESSURE_FILE "/sys/bus/i2c/drivers/bmp085/1-0077/pressure0_input"
/*==============================================================================
* Function : getTemp
* Return : temperatureF: static char array
* Parameters : none
* Description :
* Reads the temperature value from the BMP180 as celsius, then
* converts it to fahrenheit.
*==============================================================================
*/
char * getTemp()
{
char buffer[4];
FILE * filePtr;
float result;
float celsiusValue;
float fahrenheitValue;
static char temperatureF[7];
filePtr = fopen (TEMPERATURE_FILE ,"r"); //r:Open a file for reading
fread(buffer, sizeof(char), 4, filePtr);
fclose (filePtr);
result = atof(buffer);
celsiusValue= (result /10);
fahrenheitValue=((celsiusValue*9)/5)+32; //celsius to farenheit conversion
sprintf(temperatureF, "%.1f",fahrenheitValue); //float to string conversion
strcat(temperatureF, " F"); //append fahrenheit units
return temperatureF;
}
/*==============================================================================
* Function : getPressure
* Return : pressureInHG: static char array
* Parameters : none
* Description :
* Reads the barometric pressure value in as Pascal from the BMP180
* then converts it to inches of mercury.
*==============================================================================
*/
40. 40
char * getPressure()
{
char buffer[6];
FILE * filePtr;
float result; //units = Pascal
float hPaValue; //units = hectopascal
float pressureValue; // units = inches of mercury
float conversionNum = 0.0295301;
static char pressureInHG[11];
filePtr = fopen (PRESSURE_FILE,"r"); //r:Open a file for reading
fread(buffer, sizeof(char), 6, filePtr);
fclose (filePtr);
result = atof(buffer); //string to float conversion
hPaValue = (result /100); //Pascal to hectopascal
pressureValue= hPaValue*conversionNum; //conversion to inches of mercury
sprintf(pressureInHG, "%.2f",pressureValue); //float to string conversion
strcat(pressureInHG, " inHg"); //append inches of mercury units
return pressureInHG;
}