There are two ways to serialize a null:

For example, to generate the following JSON:

{"myValue":null}

you can write:

DynamicJsonBuffer jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root["myValue"] = (char*)0; // or (char*)NULL if you prefer
root.printTo(Serial);
Global warming stripes by Professor Ed Hawkins (University of Reading)