http://www.element14.com/community/videos/10789/l/the-henrietta-project--bluetooth


For a video demonstrating voice control over Bluetooth check out this link:

http://www.element14.com/community/videos/10808/l/the-henrietta-project--voice-control


To see the full android app in operation check this link:

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/12/smarter-life-challenge--the-henrietta-project--android-app

HenriettaAndroidApp2.png

Why does this project include Bluetooth?

The Henrietta Project uses Bluetooth for the following reasons:

  • Wireless monitoring and programming adds a significant convenience factor to the system. The system can be controlled from a comfortable chair, making use of scattered free time like during TV commercials.
  • Standard wireless capability allows the system to leverage the large expensive displays and ergonomic input systems of PCs, tablets and phones without large additional cost. This can add much better graphics to the system without additional hardware cost. It allows system capabilities to grow and could even add voice recognition.
  • Bluetooth is ubiquitous on mobile devices and less expensive than WiFi.
  • Bluetooth is less likely to be monitored by big brother or hacked from a foreign land than WiFi.
  • Bluetooth is unique for thermostats (WiFi thermostats are commercially available)

 

The Solution

The upper level communication protocol is super simple - most commands are implemented as a single letter, allowing any terminal program to provide remote monitoring and control. In most cases the upper case letter turns a parameter on and the lower case turns it off. This allows testing of Henrietta's firmware independent of programming and testing the remote app.

Commands fall into 2 categories - query commands that request sensor readings shown in the "Get" column and action commands shown in the "Set" column.

 

Parameter

Commands

Format

 

Get

Set

 

Temperature

T

-

 

Pressure

P

-

 

Humidity

H

-

 

Light

L

-

 

Microphone

M

-

 

Clock

C

c(n14)

6 digit time + 8 digit date

Fan On

-

F

 

Fan OFF

-

f

 

Heat On

-

W

 

Heat Off

-

w

 

AC On

-

A

 

AC Off

-

a

 

Red LED On

-

R

 

Red LED Off

-

r

 

Green LED On

-

G

 

Green LED Off

-

g

 

Blue LED On

-

B

 

Blue LED Off

-

b

 

Open Door

-

D

 

Close Door

-

d

 

Eyes Open

-

E

 

Eyes Closed

-

e

 

Eyes Off

-

O

 

Day

N

n(1-7)

 

STime

-

i,j,k,l(0000-2459)

 

STemp

-

s,t,u,v(10-30)

 

Keypad

-

-

X-Y coordinates in %

 

 

 

 

 

Implementation

The HC05 Bluetooth module on a carrier card is extremely simple to connect and use. I simply left it in its default state and connected 2 signal wires. It automatically handles all low level Bluetooth protocols and pairing. The PSoC4 only needs to implement a 9600 baud UART with transmit and receive signals. This 7$ wireless module made Bluetooth functionality the only aspect of the whole project that turned out to be easier than expected.

Actually configuring the PWM signal for the servo motor was also surprisingly simple on the PSoC4, but there were lots of mechanical headaches with the servo subsystem to compensate.

Initial Bluetooth testing with an android phone used the Sena BTerm android terminal application.

The enclosed video shows some of the more visible Bluetooth commands in action.

 

Conclusions

Implementing Bluetooth turned out to be such a simple and cheap way to leverage use of my smart phone, I will certainly be using it in many more projects.

 

Next Steps

I expect my next update to cover the custom furnace control interface in a bit more detail.

 

For more info on the Henrietta Project, which is entered in the Smarter Life Challenge, check these logs:

http://www.element14.com/community/videos/10631/l/smarter-life-challenge--the-henrietta-project-intro

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/15/smarter-life-challenge--the-henrietta-project

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/17/smarter-life-challenge--the-henrietta-project--touch-screen-subsystem

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/23/smarter-life-challenge--the-henrietta-project--personality-infusion

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2013/12/29/smarter-life-challenge--the-henrietta-project--wire-wrap-versus-jumpers

http://www.element14.com/community/community/knode/dev_platforms_kits/element14_dev_kits/psoc4_pioneer_kit/blog/2014/01/02/smarter-life-challenge--the-henrietta-project--furnace-interface