fixed sensor declaration
final sketch