Introduction: Remote Azan With Solar

A look at our project is a device for determining prayer times, the sound of the call to prayer, and the direction of the pure qiblah through solar energy, and this is useful to us in many places where there are no stations and the Internet to help people perform their homework


1- Raspberrypi

2-solar panel







Step 1: Raspberry Pi

‏We downloaded

the Linux system on the MOMRI and connected the computer to Raspberry by the putty

Step 2: Solar Panel

In the solar panels we have relied on all the connected parts in the raspberry and how much each element needs the required wattage and in this way we chose the necessary battery capacity to run the project

RTCwat = I*v =0.2*3.3 =0.66wat

Gps wat= I*v =0.3*3=0.9

compass wat= I*v =0.3*3.3=0.99

total wat = 0.66+0.9+0.99= 2.55 wat

Step 3: RTC

‏To run the RTC, we need to follow the following steps

1_ In order to ensure you’ve got the latest updates you should run the following commands :

sudo apt-get update
sudo apt-get -y upgrade

Now we need to modify a system file using :

sudo nano /etc/modules

If it isn’t already there add “rtc-ds1307” to the bottom so it looks something like :





You can save and quit using CTRL-X, Y and ENTER .Shutdown the Pi using

sudo halt 

and remove the power when it has completed the process.

2_ Interface Test Power up the Pi and run the following command :

sudo i2cdetect -y 1

Note : If you are using a Rev 1 you will need to use

sudo i2cdetect -y 0

You should see something similar to this :

In this example “68” is the hex address of the RTC module on the I2C interface.

3_ I2C Device Setup To ensure the DS1307 device is setup and the time synchronised when the Pi boots we need to edit another system file :

sudo nano /etc/rc.local

Add the following two lines before the exit 0 line : echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device hwclock -s so it looks something like :

Note : If you are using a Rev 1 you will need to use “/i2c-0/” instead of “/i2c-1/”. You can save and quit using CTRL-X, Y and ENTER. Now reboot the Pi using :

4_ Time Zones and Daylight Saving Time By default the Pi tends to show time as GMT or UTC. For me sat in Bristol this results in the time being 1 hour behind my local time. To tell your Pi what region you are in you can use :

sudo raspi-config 

and then select “Internationalisation Options” followed by “Change Timezone”. You can then select you location from the following screens. I set my location to “Europe/London” and this results in “date” showing the time in BST (British Summer Time) rather than UTC. The time is then correctly adjusted by +1 hour. 5_ The Final Test The final test is to determine if the RTC module is keeping time and that the Pi will use that time when it boots. The best way to do that is to : ▪ Power down the Pi ▪ Remove the power cable ▪ Remove the network connection ▪ Attach the Pi to a monitor and keyboard ▪ Leave it overnight ▪ Power it up and use “date” to see what time the Pi thinks it is Hopefully your Pi is now displaying the correct date and time and will maintain it when the Pi is powered down

Step 4: GPS

‏In GPS, the matter was clear. We downloaded the code and communicated with us everything we downloaded on GPS and this is an overview of the code

import serial

import time

import string

import pynmea2

while True

: port="/dev/ttyAMA0"


l(port, baudrat

=9600, timeout=0.5) dataout

= pynmea2.NMEAStreamReader()


if newdata[0:6]

= "$GPRMC": newmsg

=pynmea2.parse(newdata) lat

=newmsg.latitude lng

newmsg.longitude gps = "Latitude=" + str(lat) + "and Longitude=" + str(lng) print(gps)

Step 5: Compass

This link to show you the compass test video on you Tube

‏ In compass the matter was clear. We downloaded the code and communicated with us everything we downloaded on compass and this is an overview of the code

import smbus

#import SMBus module of I2C from time

import sleep

#import sleep import math

#some MPU6050 Registers and their Address Register_A = 0

#Address of Configuration register A Register_B = 0x01

#Address of configuration register B Register_mode = 0x02

#Address of mode register

X_axis_H = 0x03 #Address of X-axis MSB data register

Z_axis_H = 0x05 #Address of Z-axis MSB data register

Y_axis_H = 0x07 #Address of Y-axis MSB data register

declination = 4.8 #define declination angle of location where measurement going to be done

pi = 3.14159265359 #define pi value

def Magnetometer_Init():

#write to Configuration Register A


Register_A, 0x70)

#Write to Configuration Register B for gain

bus.write_byte_data(Device_Address, Register_B, 0xa0)

#Write to mode Register for selecting mode

bus.write_byte_data(Device_Address, Register_mode, 0)

def read_raw_data(addr):

#Read raw 16-bit value

high =

bus.read_byte_data(Device_Address, addr)

low =

bus.read_byte_data(Device_Address, addr+1)0.

#to get signed value from module

if(value > 32768):

value = value - 65536

return value

bus = smbus.SMBus(1) # or bus = smbus.SMBus(0) for older version boards Device_Address = 0x0d # HMC5883L magnetometer device address

Magnetometer_Init() # initialize HMC5883L magnetometer

print (" Reading Heading Angle")

while True: #Read Accelerometer raw value

x = read_raw_data(X_axis_H)

z = read_raw_data(Z_axis_H)

y = read_raw_data(Y_axis_H)

heading = math.atan2(y, x) + declination #Due to declination check for >360 degree if(heading > 2*pi): heading = heading - 2*pi

#check for sign if(heading < 0): heading = heading + 2*pi

#convert into angle heading_angle = int(heading * 180/pi)

print ("Heading Angle = %dDegree" %heading_angle) sleep(1)


This link to show you the final project

Step 7: Thank You Dr

‏Dr Jaber Al Yamany, we feel so truly lucky to have an adviser who shows all of the care, understanding, and patience that you do. Thank you for the project idea, the support ,the follow-up .....Thank you for everything.