Menu |
Prof /
LAN3v2-users-manualLANcube - a multispectral and multiangular sensor for the light at nightLANcube v2 User's Manual
Martin Aubé1, Ph.D. (PI) Élysé Lapalme1 1 Cégep de Sherbrooke, Sherbrooke, Québec, Canada Creative Commons Attribution-ShareAlike 4.0 International License Last update: June 5 2022 AbstractLANcube (LAN3) is a device intended to sample the multispectral and multidirectional properties of the direct artificial light at night into the urban or natural environment (indoor or outdoor). It is a powerful tool to foster new research in the fields of the impact of artificial light at night on human health and natural environments. LAN3 is a cube having on five of of its face four sensors of various spectral response (band) in the visible range (red, green, blue and clear). Each band has been calibrated in a way to deliver the integrated fluxes. Thanks to its multispectral capabilities, the sensor can provide an estimate of the illuminance, of the correlated color temperature (CCT), the Melatonin Suppression Index (MSI), the Induced Photosynthesis Index (IPI) and the Star Light Index (SLI). The minimum light level detected is 0.005 lux. LAN3 is based on raspberry pi/arduino open source hardware so that it can be replicated by anybody. It comprise a real time clock, a mode selector, a status LED, a web server, GPS module. LAN3 act as a wifi access point so that it is possible to dowload the data or check it's status with any mobile device. User's guidePower sourceThe LAN3 need to be powered using a USB-C cable. Since that the system needs around 3 Amp, you need a USB-C cable rated for that current and more importantly a power source capable to deliver such current. Keeping GMT timeThe LANcube is supposed to be synchronized with the GMT time. The LANcube comprise a Real Time Clock chip powered by a battery so that the time should be kept even after removing the power. But after a few month without connecting the LANcube to its power supply, the battery may becomes empty and then the time will be lost. If it happens, the date will be resetted to 2000-01-01. The new data should be recorded anyway but in the wrong file. The best way to avoid that problem is to connect the power supply of the LANcube for a few hours every 1 month with the switch in position 0. That will charge the battery and the GMT time will remains correct. That will also protect the battery life. If ever the time is lost, you can recover it by connecting a network cable between the LANcube and a internet-connected router that is using local network 192.168.0.X. You can check if the time is correct by typing the LANcube ip address in a web browser (even from the local network or by connecting to the wifi and use 192.168.5.1 URL). If the time is still wrong, you can configure it manually with the following sequence: sudo date +%Y%m%d -s "20120418" sudo date +%T -s "11:14:00" Please replace the date and time above by your actual GMT time. Then you can write the new time into the hardware real time clock that will be kept as long as the battery is not completely empty. sudo hwclock -w Operating buttonMeasuring (I)Putting the button to position (I) will start the measuring sequences. If any data is over/under exposed, the LED will turn solid blue. If all data are correctly exposed, but no GPS signal is found, the LED will turn solid yellow. Lastly, if all data are correctly exposed and GPS location is acquired, the LED will turn solid Green. Idle (0)Putting the button to position (0) will stop the measurements (if you are measuring). Note that the ongoing sequence will terminate first (all sensors will be sampled). This position is also the one to use when you power on the system before connecting the USB-C power cable. In that mode, the LED is yellow and flash at a constant rate of 0.5 sec on, 0.5 sec off. Off/shutdown (II)This mode is activated by putting the button in position (II). When you use it to shutdown the system, wait about 10 seconds before removing the power cable. Don't let the button to position (II) if you want to start using the LAN3. Otherwise it will shutdown right after boot. When the button is set to this position, The LED turn Red. After a shutdown, if you want to start the system you need to wait about 30 seconds unplugged. This is the time for the power stored in the condensers of the UPS hat to be emptied. After that time you can just plug back the USB-C cable with button in position (I) and the LAN3 will restart properly. LED status indicator
Access to the data
Connecting to the LAN3 wifiIt is possible to access the LAN3 from any mobile device. The only requirement is that this device have a wifi interface. The LAN3 is configured in a way that its wifi interface act as a wifi access point. To connect with your mobile device, you need to go to the network configuration and connect to the wifi network named lan3v2. The passphrase is lan3v2wifi. Once connected, you can do one of the following method to access the data: Access through a web browserSee the 5s updated measurementsEnter the following address in your web browser: 192.168.5.1 Use the update button of you browser to refresh the data. The native LAN3 sampling rate is of about 0.2 sec but that web page is only updated every 5 seconds. Access the complete dataEnter the following address in your web browser: 192.168.5.1/data In that directory your will find .csv files. To look at the file content simply click on the file name and chose the appropriate application to open it. A simple text editor/viewer is far enough. To save a file, simply use save as... Access with a SSH clientThis is by far the most powerful way to access the system. In the other hand, it is a bit more complex. You need a ssh client installed on your device. You enter the following in the client: ssh sand@192.168.5.1 Then move to the web server directory containing the data cd /var/www/html/data You can see the list of files by typing If you want to see the latest recorded data simply type the following tail name_of_the_csv_file You can download the file with a scp client (some ssh clients can do). On apple or linux in a terminal window you can simply type the following command (adapt the file name to the one you want). scp sand@192.168.5.1:/var/www/html/data/name_of_the_csv_file . If you want to download all files, replace the name_of_the_csv_file by * scp sand@192.168.5.1:/var/www/html/data/* . Data formatThe data is structured in the following way for each equivalent column number: Sensor_number Year Month Day Hour Min Sec LAT LON ALT Number_Of_Sat Gain Integration_time Correlated_color_temperature(K) Illuminance(Lux) Red_DN Green_DN Blue_DN Clear_DN Data_status EX: 'S5 2020 12 21 00 00 43.12 n/a n/a n/a XX 60.00 38.40 5332 460.2480 910 990 790 2449 OK'
Data backupThe LAN3 is provided with a USB stick on which a backup of the data is made every 15 minutes. Spectral responseThe Infrared signal (IR) may be estimated from the R, G, B values using the following equation: Afterwards we can determine the signal free of the IR contribution using this equation: It appear that g is a good proxy of the illuminance in Lux. The spectral response of the different bands of the LANcube are given in Fig. 1. Builder's guideHardwareFrom the outside, the LAN3 version 2 have a 3 way switch, a RGB LED, a USB cable and a GPS dongle. The USB cable is for powering the system, you need to provide 5V with at least 3 Amp. The power source can be either a phone charger or a power bank. If you notice that after about 1 minute, the LAN3 shut down, it means that your power sources in not powerful enough. If connected to a network the ethernet cable allow to access the integrated web server for an easy access to the data but this cable is optional because that you can connect with WiFi using any mobile device. In a permanent installation, the etheret cable can be connected to the internet, if one want to control or monitor the system remotely. The RGB LED serve as a system state indicator. The 3-way switch positions corresponds to 3 different functions. (0)=IDLE, (I)=Data acquisition, (II)=Shutdown. Components listThe system consists of the following items:
EnclosureMain enclosureWe decided to 3D print the enclosure to get the device as small as possible. The enclosure measures about 9 x 9 x 9 cm. The total mass with components is 345g including the gps module but excluding the power supply/power bank. One face of the LAN3 have the 3-way switch and the RGB LED. This face act as a reference for the orientation of the LAN3. Assuming that in a road runner mode, this face should point backward. The rear face hold the sensor #2, the right face the sensor #3, the front face sensor #4, the left face sensor #5, and the top lid holds sensor #1.
3D printed componentsWiring
The UPS hat uses rpi pin 11 and 13. No wiring is required as their GPIO ports are connected. Wiring pictureMechanical Assembly
Assembling steps
Software installations |