Picture of Darkness Map Data Collection Device
The Darkness Map encompasses both data collection and visualization of nighttime light levels. You can add to the map by downloading the app for iPhone or Android, but you can also contribute data by creating your own data collection device. This tutorial will cover how to build an Arduino powered data logger with a light intensity sensor. Since the sensor modules are attached to the Arduino on a breadboard, it's fairly simple to swap out the light sensor for a different sensor of your choosing. You can use the device to log data about temperature, air quality, noise, and many other environmental factors, and because everything is attached by breadboard, you can easily adapt it to use in other projects.
Remove these adsRemove these ads by Signing Up

Step 1: Parts You Need

Picture of Parts You Need
Arduino Uno - available from a variety of online resellers, and even your local Radioshack.
Adafruit Proto Shield for Arduino Kit
Adafruit Ultimate GPS Breakout Kit
Adafruit MicroSD card Breakout Board
TSL2561 Digital Luminosity/Lux/Light Sensor
Half-size breadboard
CR1220 Coin Cell Battery - also available at drug stores, other online resellers
MicroSD Card - you can also repurpose one from an old mobile phone
9V Battery clip
9V Battery

The parts for each device cost about $90, not including the Arduino Uno.
rmas1 year ago
When I try to upload the code that is on page 2-3 of the instructions I get the following error messages.
TINYgps does not name a type.
RTC_millis does not name a type.
Date was not declared in this scope.
Tinygps.h; no such file or directory.
RTClib.h; no such file or directory.
in function void setup()';
I need some help with this guys.
My email is
gennaveeva (author)  rmas1 year ago
It seems like you don't have the libraries installed in a place where Arduino can find them. I have a folder called "Arduino" inside my Documents directory. Inside that, there is a folder called "libraries" , inside that are various libraries, including a folder called "TinyGPS" and "RTClib"

You may have to restart your Arduino IDE after placing the libraries inside that folder. If that still doesn't work let me know.
Hi: Thanks for your response.
The problem is that I can't compile the code to save it. I get these error messages
that I stated. I have a folder called Arduino and in that a libraries folder and various libraries. I cant save the code because of all these errors that I stated. My question is this. Could you possible have errors in the program when you published it.
gennaveeva (author)  rmas1 year ago
The code compiles fine for me. Just so we're clear, are you talking about the code on step 4? I'm not sure what specific code you're referring to on pages 2 or 3. To test the GPS module directly over serial (step 3), you hook the RX and TX pins to 0 and 1 on your Arduino, and then upload a blank sketch.

Here's that code from the Adafruit tutorial:
// this sketch will allow you to bypass the Atmega chip
// and connect the fingerprint sensor directly to the USB/Serial
// chip converter.

// Connect VIN to +5V
// Connect GND to Ground
// Connect GPS RX (data into GPS) to Digital 0
// Connect GPS TX (data out from GPS) to Digital 1

void setup() {}
void loop() {}

If you're able to see NMEA data coming in through the Serial Monitor, then I'd proceed to test whether the code examples that come with the TinyGPS library are compiling for you. In the Arduino IDE, go to File --> Examples --> TinyGPS --> Examples --> simple_test. Change your RX and TX wiring to match the example code (pins 3 and 4).

Next I'd proceed with the RTClib examples. Note: If you don't have a coin cell battery then you won't be able to access the Real Time Clock on the GPS module.

Sorry you're having a difficult time of it. I've tested that it compiles without errors, but I'll test the uploading later tonight when I have access to the module.
I'm sorry: The code I am talking about starts With Step 4 Set up the MicroSD breakout Board. It starts with Now,upload the following code to your Arduino.

#include "Wire.h"
#include "SD.h"
#include "SoftwareSerial.h"
#include "TinyGPS.h"
#include "RTClib.h"
rmas rmas1 year ago
Sorry to be such a pest but were you ever able to check the code that I am talking
about. I'm still getting errors and I cant compile it. I can't go forward with my project until I get this right. If I new how to email you all of my code for you to check I would. Thanks for all your help so fare.

gennaveeva (author)  rmas1 year ago
I'm emailing you now. Hopefully we can troubleshoot better that way.
technitute2 years ago
Nice Sir,,, I love technology and the stuffs going on electronics............
Reminds me of a nowhere-near-as-sophisticated art project I did on the impact of illumination on the perceived importance of objects in a landscape. This is way cooler.
gennaveeva (author)  The Green Gentleman2 years ago
Thanks. I'd love to read more about your project if it's online anywhere.
Fortunately, the World Wide Web was just a twinkle in Al Gore's eye when I did my project, so I am spared the embarrassment of sharing it!
What exactly does this do? Does it create a map or what?
gennaveeva (author)  szulli-randall2 years ago
I plan to update the tutorial with instructions for how to add the CSV files to the web-based map visualization. The hardware device was an initial prototype, and we're now developing a way to add to the map with a mobile app. I've made maps from the CSV data in Processing, but wanted to focus on the hardware aspect for this tutorial. Sorry if I wasn't entirely clear.
james.m.k2 years ago
I don't get it. You're mapping light intensity? Why?
gennaveeva (author)  james.m.k2 years ago
I think light, and especially the amount and quality of light at night make up a large part of a city's phenomenological qualities, and how they affect your perceptual experience of the city. It's also part of an experiment in building a crowd-sourced dataset, which might have useful applications to reference against public safety data, like crime or traffic incidents.
irishjim682 years ago
It would be a nice touch to give some background info about the "Darkness Map" project considering how the web site has four links that go nowhere, and therefore really contains NO useful information.
gennaveeva (author)  irishjim682 years ago
Sorry about the issues with the website, they should be fixed now. The Darkness Map is currently being developed, but I wanted to put this tutorial up as a basic overview of how to build a gps enabled data logger, in the hope that it might benefit people in their own projects. Ultimately, the easiest way to contribute to the Darkness Map project will be using the mobile app for data collection, but I thought a tutorial for this initial prototype might be useful outside of my project.