loading

We will use a Open Source radiation measuring kit to send data to a platform for exchange and citizen oversight.

Step 1: List of Materials/Requirements

  • Arduino YUN
  • Cooking Hack Radiation Kit
  • Computer
  • mini-USB to USB cable
  • Arduino IDE 1.6.7 ou newer
  • Internet access

Step 2: Create an Account on SafeCast and Retrieve Your API Key

First, create an account on safecast.org site to be able to share your measures with the community.

Then in the "Your Profile" page, find the API key and save it somewhere.

Step 3: Test the API Call on SafeCast

We will now test access to the server through SafeCast with your API key.

For Windows user, on the program search bar, you can find Powershell ISE then copy the following code in the execution interface.

Clear
$safeCastApi = "https://api.safecast.org" $apiKey = "QEETXXXXXXX" $captureTime = Get-Date -format "yyyy-MM-d h:mm:s" $captureTime $body = @{location_name="XXXXXXX";captured_at=$captureTime;longitude=6.333336000000029;latitude=49.33333;value=1.2;unit="microsievert"} $header = @{ "Content-Type" = "application/json"; }; Invoke-RestMethod -Method Post -Uri ("$safeCastAPI/measurements.json?api_key=" + $apiKey) -Body (ConvertTo-Json $body) -Header $header

Before running this script, you need to adapt on the 3rd line the allocation of the variable $apiKey with your API key.

Save and then run this code with F5.

For Linux user, in the same way, replace the value following api_key the right combination and then run the following script in a console:

curl -k -H "Content-Type: application/json" -X POST -d '{"location_name":"XXXXXXX","longitude":6.333336000000029,"latitude":49.33333,"value":1.2,"unit":"microsievert"}'https://api.safecast.org/measurements.json?api_key=QEETXXXXXXXXXX

Step 4: Assemble YUN With the Radiation Card

Connect all components together: YUN Arduino and radiation card. Then the LCD screen above.

The Geiger tube plugs into radiation card by pines. Polarity is visible on the circuit.

Step 5: Power the YUN and Connect to the Interface Linino

Power your YUN with a mini-USB to USB cable directly to your computer (the program transfer will use this).

Connect YUN also via the Ethernet port to your local network.

On Windows, use putty to connect to YUN. On Linux, you would use ssh.

By default, it goes to the address 192.168.240.1, username: root, password: doghunter.

Step 6: Update YUN

To update the YUN, run the following script:

$ cd /tmp $ wgethttp://download.linino.org/linino_distro/master/latest/openwrt-ar71xx-generic-linino-yun-16M-250k-squashfs-sysupgrade.bin $ sysupgrade -v openwrt-ar71xx-generic-linino-yun-16M-250k-squashfs-sysupgrade.bin after about 1 minute the board will reboot and the new image will be loaded on the board.
if you want to overwrite all the configuration settings present on the previous image, you have to add the -n option to the sysupgrade command $ sysupgrade -v -n openwrt-ar71xx-generic-linino-yun-16M-250k-squashfs-sysupgrade.bin

Step 7: Launch Arduino Development Tool and Adapt Some Variables

Download the file radiationKitMyfood_v.0.6.zip and unpack it:

Under the Arduino IDE interface, adapt the following variables to your situation:
location_name
longitude
latitude
api_key (with the value get via your SafeCast account)

Save the program.

Step 8: Upload the Program and Check Values on the SafeCast Map

Make sure your YUN is connected through the USB port of your computer.

On "Tools" / "Board" select "Arduino YUN"

On "Tools" / "Port", select your USB connector

Compile the program by clicking the button on the top left of the screen.

Upload the program cliquand on the up arrow to the left of the screen.

At the end of upload, YUN restarts and the program runs. The LCD displays the radioactivity of the environment. Data is sent every hour to SafeCast. So you can see your contribution directly on the site map.

About This Instructable

5,711views

78favorites

License:

Bio: We believe that sustainable food production and security can be achieved in every backyard.
More by myfood:Connect Your Garden With an Information Sharing Platform - Installation of a Radiation Measurement Kit Simple Garden Automation With An Open Hardware Stack How to Build a Raised Permaculture Bed 
Add instructable to: