# Hidden Ink UV Message Reader

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/051/710/medium800/adafruit_gemma_UV_Message_Beauty02.jpg?1520574971)

## Passing Secrets

Any proper spy will find the need on occasion to pass secret information along to an ally securely. There are many techniques to do so — sometimes, they can be highly technical, such as an encrypted digital message, but other times they may need to be decidedly simple and low tech -- hiding information just outside of plain sight can be very effective.

For example, you can write an innocuous-looking letter that will pass scrutiny should it be seen by enemy eyes, yet have top secret information written in invisible fluorescent ink! Your intended recipient can use an ultraviolet (UV) light to read the message!!

https://youtu.be/M-S_P_Vn1xw

In this project we'll use your Gemma M0 to create a touch-sensitive UV light illuminator. Plus, you'll learn a little coding with **maker.makecode.com** so this is a great way to make your first spy project

## Materials and Parts

You'll need some paper and an invisible UV marking pen, as well as the parts listed below.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/709/medium800/adafruit_gemma_IMG_1394_2k.jpg?1520573639)

### Part: Gemma M0
quantity: 1
Tiny microcontroller
[Gemma M0](https://www.adafruit.com/product/3501)

### Part: UV LED
quantity: 1
UVA/Purple 5mm LED
[UV LED](https://www.adafruit.com/product/1793)

### Part: USB Cable
quantity: 1
Micro USB to USB A 
[USB Cable](https://www.adafruit.com/product/592)

### Part: 3x AAA Battery Holder
quantity: 1
with JST connector and ON/OFF switch
[3x AAA Battery Holder](https://www.adafruit.com/product/727)

### Part: USB Cable
quantity: 1
A/MicroB - 6"
[USB Cable](https://www.adafruit.com/product/898)

Additionally, you'll use two M3 x 8mm screws and nuts to connect the LED to the Gemma M0.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/711/medium800/adafruit_gemma_screws.jpg?1520575110)

# Hidden Ink UV Message Reader

## Building the UV Reader

## Hide in Plain Sight

Ultraviolet marker pens use ink which lacks color pigment, so it doesn’t leave a mark visible to the naked eye under normal lighting conditions. However, when illuminated with a UV light source (sometimes called a blacklight), it fluoresces brightly. This is easiest to see in dim lighting conditions.

A nice, compact source for UV light is a UV/Purple LED which emits light in the 400nm wavelength. This is right at the edge of the visible light spectrum, so you will see a purple glow cast from it, but it is a long enough wave to excite the fluorescent material and reveal the secret message.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/713/medium800/adafruit_gemma_IMG_1320.jpg?1520575443)

## Build the UV Light Decoder

With a forward voltage of 3.4V DC, you can power the UV light very well with the 3.3V output of your Gemma M0. No resistor required! We’ll connect the short, cathode leg of the LED to the **GND** pad and the long, anode leg to the **D2** pad.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/717/medium800/adafruit_gemma_IMG_1359_2k.jpg?1520575631)

![](https://cdn-learn.adafruit.com/assets/assets/000/051/712/medium800/adafruit_gemma_uv_reader_fritzing.jpg?1520575266)

Coil each leg so that it will fit an M3 screw as shown here -- be sure to pay attention to the which is the long, anode leg so you can connect them properly in the next step.

![adafruit_gemma_IMG_1362_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/714/medium640/adafruit_gemma_IMG_1362_2k.jpg?1520575533)

![adafruit_gemma_IMG_1364_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/715/medium640/adafruit_gemma_IMG_1364_2k.jpg?1520575542)

![adafruit_gemma_IMG_1369_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/716/medium640/adafruit_gemma_IMG_1369_2k.jpg?1520575551)

- Fit the LED leg coils over the respective pad holes on the Gemma M0 -- long, anode leg to&nbsp; **D2** , short, cathode leg to&nbsp; **GND**
- Push the screws through the pads and LED coils as shown
- Thread the nuts onto the screws

![adafruit_gemma_IMG_1371_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/718/medium640/adafruit_gemma_IMG_1371_2k.jpg?1520575695)

![adafruit_gemma_IMG_1372_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/719/medium640/adafruit_gemma_IMG_1372_2k.jpg?1520575703)

![adafruit_gemma_IMG_1374_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/720/medium640/adafruit_gemma_IMG_1374_2k.jpg?1520575711)

![adafruit_gemma_IMG_1378_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/721/medium640/adafruit_gemma_IMG_1378_2k.jpg?1520575719)

![adafruit_gemma_IMG_1380_2k.jpg](https://cdn-learn.adafruit.com/assets/assets/000/051/722/medium640/adafruit_gemma_IMG_1380_2k.jpg?1520575728)

![](https://cdn-learn.adafruit.com/assets/assets/000/051/723/medium800/adafruit_gemma_IMG_1382_2k.jpg?1520575876)

![](https://cdn-learn.adafruit.com/assets/assets/000/051/724/medium800/adafruit_gemma_IMG_1383_2k.jpg?1520575887)

Next, we’ll code the Gemma M0 to light up the LED when we press the **D0** capacitive touch pad!

# Hidden Ink UV Message Reader

## Coding with MakeCode

## Coding Options

You've got lots of options when it comes to coding the Gemma M0! You can use Arduino, [CircuitPython](https://www.adafruit.com/circuitpython), and MakeCode. For this project we'll use the drag-and-drop GUI interface of MakeCode to quickly and easily build our program.

## Create a MakeCode Project

First, head to the [Maker.MakeCode](https://maker.makecode.com/) site in your web browser. This version of MakeCode is in beta as of the writing of this guide, and it expands the available boards beyond the Circuit Playground Express to include the Gemma M0, Trinket M0, Metro M0 Express, and Feather M0 Express.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/051/725/medium800/adafruit_gemma_gemmaM0_UV_Reader01.jpg?1520576302)

Click on the Gemma M0 image to select it.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/726/medium800/adafruit_gemma_gemmaM0_UV_Reader02.jpg?1520576551)

Now, click the **New Project** button to create a new program using the Gemma M0.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/727/medium800/adafruit_gemma_gemmaM0_UV_Reader03.jpg?1520576588)

## Building Blocks

This is the default MakeCode screen. On the left is the simulator which can be used to test your program before uploading it to the Gemma M0.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/728/medium800/adafruit_gemma_gemmaM0_UV_Reader04.jpg?1520576823)

In the center is the palate of programing block categories.

On the right is the canvas where you'll drag blocks to create your program.

Click on the&nbsp; **forever&nbsp;** block to select it, and then press&nbsp; **delete** on your keyboard to get rid of it, we won't need it for this program because everything that happens will be triggered by an input action.

Then, click on the input category to expand it and drag the&nbsp; **on touch D0 click&nbsp;** block onto the canvas.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/051/729/medium800/adafruit_gemma_gemmaM0_UV_Reader05.jpg?1520576966)

## Touch Input

You'll see that there are a couple of drop down lists on this input block that you can use to adjust the behavior. You can choose between **touch&nbsp;** and&nbsp; **button&nbsp;** modes for each of the three pins on the Gemma M0 --&nbsp; **D0, D1,** and **D2.&nbsp;** We'll leave this in the default setting of&nbsp; **touch D0.**

You can also fine tune the input so that it reacts to one of four states --&nbsp;**click (**which means press and release),&nbsp; **long click, up&nbsp;** (just the release action by itself), and&nbsp; **down&nbsp;** (just the press action).

Since we want to hold the&nbsp; **D0&nbsp;** pad to light the UV LED, and then release it to turn it off, we'll change this dropdown from&nbsp; **click&nbsp;** to&nbsp; **down.**

![](https://cdn-learn.adafruit.com/assets/assets/000/051/730/medium800/adafruit_gemma_gemmaM0_UV_Reader06.jpg?1520577365)

## Simulator Update

Notice, when you add this input block, the simulator updates to reflect the new circuit. While it has built a button wired through a breadboard in this case, and we are actually going to use the capacitive touch, it is a pretty interesting and helpful graphical layout nonetheless.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/731/medium800/adafruit_gemma_gemmaM0_UV_Reader07.jpg?1520577480)

## Turn On the Lights

Now we have an input block that can detect when the&nbsp; **D0&nbsp;** capacitive pad is touched, but it doesn't actually do anything when pressed. Whatever action block we drag inside the&nbsp; **on touch** block is the action that will occur.

From the&nbsp; **Pins&nbsp;** category, drag a&nbsp; **digital write pin D0 to LOW** block onto the canvas **.&nbsp;** A&nbsp; **digital write&nbsp;** command sets a pin either&nbsp; **HIGH&nbsp;** to enable 3.3 volts on the pin, or&nbsp; **LOW&nbsp;** which sends the pin to ground.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/732/medium800/adafruit_gemma_gemmaM0_UV_Reader08.jpg?1520577960)

Drag the&nbsp; **digital write&nbsp;** block inside of the&nbsp; **on touch&nbsp;** input block. Since we want the LED that we'll plug into pin&nbsp; **D2&nbsp;** to turn on when the&nbsp; **D0&nbsp;** pad is touched, change the dropdown to pin&nbsp; **D2,&nbsp;** and switch the state slider from&nbsp; **LOW&nbsp;** to&nbsp; **HIGH.**

![](https://cdn-learn.adafruit.com/assets/assets/000/051/733/medium800/adafruit_gemma_gemmaM0_UV_Reader09.jpg?1520578626)

You'll see that the simulator has added an LED to represent the digital write command -- press the button on the breadboard to see it light up!

![](https://cdn-learn.adafruit.com/assets/assets/000/051/735/medium800/adafruit_gemma_gemmaM0_UV_Reader11.jpg?1520579492)

## Release the Hounds

You'll notice that once you release the button, the simulated LED stays lit. This is because there is no command currently telling it to do otherwise! Let's add an input that tells the LED to turn off when your finger is "up" off the touch pad.

Duplicate the&nbsp; **on touch D0 down&nbsp;** block by right mouse button clicking on it and choosing&nbsp; **Duplicate.**

![](https://cdn-learn.adafruit.com/assets/assets/000/051/736/medium800/adafruit_gemma_gemmaM0_UV_Reader12.jpg?1520579689)

The duplicated block set will be greyed out because it is an identical input to the existing one, which is not allowed.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/051/737/medium800/adafruit_gemma_gemmaM0_UV_Reader13.jpg?1520579796)

Change the condition from&nbsp; **down&nbsp;** to&nbsp; **up.**

![](https://cdn-learn.adafruit.com/assets/assets/000/051/738/medium800/adafruit_gemma_gemmaM0_UV_Reader14.jpg?1520579811)

## Lights Out

Now, you can tell the digital write to go&nbsp; **LOW&nbsp;** when the touch pad is released, or "up".&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/051/739/medium800/adafruit_gemma_gemmaM0_UV_Reader15.jpg?1520579874)

Test out the simulator -- now the LED will illuminate when you push the button down, and turn off when you release the button.

https://makecode.com/_MuqLfP1HUdHX

## Name It & Download It

Give your project a meaningful name, such as, oh, I don't know, " **Gemma\_UV\_Reader**", and then press the download button.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/740/medium800/adafruit_gemma_gemmaM0_UV_Reader16.jpg?1520580031)

When prompted, save the file to a memorable location. This file is a&nbsp; **.uf2** &nbsp;(USB Flashing Format) file which we'll use in a moment to flash the Gemma M0 with the new program.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/741/medium800/adafruit_gemma_gemmaM0_UV_Reader17.jpg?1520580208)

## Upload the Code

Now you can put the code on your Gemma M0! Plug the Gemma M0 into you computer with the USB cable. After a moment it will be recognized by your computer as a USB drive. (If it doesn't show up, make sure the Gemma M0's power switch is in the ON position.)

It should show up with the name ' **CIRCUITPY**'. In order to upload the new program, double click the reset button on the Gemma M0 -- the red onboard LED will start to pulse and the USB drive will show up named ' **GEMMABOOT**'.

Drage the&nbsp; **.uf2&nbsp;** file onto the&nbsp; **GEMMABOOT&nbsp;** drive.

![](https://cdn-learn.adafruit.com/assets/assets/000/051/742/medium800/adafruit_gemma_gemmaM0_UV_Reader18.jpg?1520580564)

After the file transfers, the Gemma M0 will reboot, and the program will run. Unplug it from the USB cable, and get ready to try it out!

# Hidden Ink UV Message Reader

## Revealing Messages

Plug in the AAA battery holder to the Gemma M0 and turn on the battery pack's power switch. Be sure not to touch the capacitive pins on the Gemma M0 while it is starting up, as there is a capacitive touch calibration that runs to get a baseline value.

Once it has started, touch the&nbsp; **D0&nbsp;** pad and you'll see the LED light up!

![](https://cdn-learn.adafruit.com/assets/assets/000/051/743/medium800/adafruit_gemma_IMG_1387_2k.jpg?1520580722)

![](https://cdn-learn.adafruit.com/assets/assets/000/051/744/medium800/adafruit_gemma_IMG_1392_2k.jpg?1520580834)

![](https://cdn-learn.adafruit.com/assets/assets/000/051/745/medium800/adafruit_gemma_IMG_1393_2k.jpg?1520580844)

## Invisible Writing

Use your UV marking pen to write a secret message on a piece of paper, or page of a newspaper or book. The naked eye won't see any indications of the writing. Now you can send the message along to a compatriot, and nobody snooping around will be able to see your important intel...

![](https://cdn-learn.adafruit.com/assets/assets/000/051/746/medium800/adafruit_gemma_IMG_1401_2k.jpg?1520581072)

## Let There Be (Ultraviolet) Light

Then, by deploying the UV reader, the message will be clear!

![](https://cdn-learn.adafruit.com/assets/assets/000/051/747/medium800/adafruit_gemma_IMG_1410_2k.jpg?1520581090)

Especially if you turn out the lights first! This composite photo shows the full message at one time -- you'll need to reveal each letter one by one, unless you and your fellow spies have very small handwriting!

![](https://cdn-learn.adafruit.com/assets/assets/000/051/748/medium800/adafruit_gemma_secretMessageReveal.jpg?1520581133)

Unlike the old lemon juice and light bulb trick -- the marker ink isn't "developed" it fluoresces under UV light -- if you hear someone coming, lift your finger off the cap touch pad and the message will disappear!


## Featured Products

### AdaBox Subscription

[AdaBox Subscription](https://www.adafruit.com/adabox_get_started)
Subscription
[Buy Now](https://www.adafruit.com/adabox_get_started)
[Related Guides to the Product](https://learn.adafruit.com/products/3067/guides)
### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### UV/UVA 400nm Purple LED 5mm Clear Lens - 10 pack

[UV/UVA 400nm Purple LED 5mm Clear Lens - 10 pack](https://www.adafruit.com/product/1793)
Need some really bright LEDs? We are big fans of these 5mm clear **UV / Purple** LEDs. These emit UV 'blacklight' in the UVA spectrum so they are great for projects with fluorescent materials referred to as UV/blacklight-reactive or 'glow-in-the dark'. They are...

In Stock
[Buy Now](https://www.adafruit.com/product/1793)
[Related Guides to the Product](https://learn.adafruit.com/products/1793/guides)
### 3 x AAA Battery Holder with On/Off Switch and 2-Pin JST

[3 x AAA Battery Holder with On/Off Switch and 2-Pin JST](https://www.adafruit.com/product/727)
This battery holder connects 3 AAA batteries together in series for powering all kinds of projects. We spec'd these out because the box is slim, and 3 AAA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries and have an on-off switch. That makes...

In Stock
[Buy Now](https://www.adafruit.com/product/727)
[Related Guides to the Product](https://learn.adafruit.com/products/727/guides)
### Alkaline AAA batteries - 3 pack

[Alkaline AAA batteries - 3 pack](https://www.adafruit.com/product/3520)
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAA's. This is a pack of **3 AAA batteries**.  
  
These batteries are Alkaline (MnO2) chemistry, with a...

In Stock
[Buy Now](https://www.adafruit.com/product/3520)
[Related Guides to the Product](https://learn.adafruit.com/products/3520/guides)
### USB cable - 6" A/MicroB

[USB cable - 6" A/MicroB](https://www.adafruit.com/product/898)
This here is your standard A-microB USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your NETduino, Arduino Leonardo, Raspberry Pi (among other things).  
  
Approximately 6.5" long from end to end, its a little more compact than our classic 3' long cable  
<br...></br...>

In Stock
[Buy Now](https://www.adafruit.com/product/898)
[Related Guides to the Product](https://learn.adafruit.com/products/898/guides)

## Related Guides

- [Trinket / Gemma Blinky Eyes](https://learn.adafruit.com/trinket-gemma-blinky-eyes.md)
- [Simple and Beautiful NeoPixel Holiday Lights](https://learn.adafruit.com/simple-beautiful-color-changing-light-strand.md)
- [Playa Festival Bike](https://learn.adafruit.com/playa-festival-bike.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [Chirping Plush Owl Toy](https://learn.adafruit.com/chirping-plush-owl-toy.md)
- [Superhero Power Plant](https://learn.adafruit.com/superhero-power-plant.md)
- [GEMMA Hoop Earrings](https://learn.adafruit.com/gemma-hoop-earrings.md)
- [Starduino: 8-Bit Super Mario Tree Topper](https://learn.adafruit.com/starduino-neopixel-8-bit-mario-star-tree-topper.md)
- [Glowing Scale Armor](https://learn.adafruit.com/glowing-scale-armor.md)
- [CPU Temperature Logging with CircuitPython](https://learn.adafruit.com/cpu-temperature-logging-with-circuit-python.md)
- [Gemma Firewalker Lite Sneakers](https://learn.adafruit.com/gemma-led-sneakers.md)
- [Cyberpunk Spikes](https://learn.adafruit.com/cyberpunk-spikes.md)
- [The Foul Fowl -- Keystroke Injection Attack Tool with Gemma M0](https://learn.adafruit.com/the-foul-fowl-keyboard-injection-payload-gemma-m0.md)
- [AM Radio Morse Code Paddle](https://learn.adafruit.com/am-radio-morse-code-paddle.md)
- [Using DS18B20 Temperature Sensor with CircuitPython](https://learn.adafruit.com/using-ds18b20-temperature-sensor-with-circuitpython.md)
