pibeacon 25: DF2301Q voice recognition sensor

User avatar
kw123
Posts: 8463
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

pibeacon 25: DF2301Q voice recognition sensor

Post by kw123 »

GRAVITY is offering a new sensor DF2301Q (also known as DFRobot SEN0539-EN). It can do voice recognition locally on a chip. (euro/$ ~16). comes with a basic onboard mic and speaker
It can be connected to an RPI through I2C or UART(not tested)

The pibeacon plugin has added a new sensor type "INPUT Voice-recognition DF2301Q"
Now you can use that sensor to trigger any indigo action through voice commands. My success rate is > 90% at 4 meters away. You need to direct the mic into the room

Setup:
1. connect the sensor to the RPi V3.3, ground and i2c (the supplied cable is good and everything is well labeled )
2. create a new pibeacon device type "INPUT Voice-recognition DF2301Q"
3. edit, set RPi to which RPI the sensor is connected to. You can also set
- mute = switch off speaker
- volume of speaker, if not mute
- wake time = for how long after keyword it is listening to new commands
- keep awake = refresh awake every 200 secs for 255 secs, wake time is ignored. ==> no keyword needed
- text for user defined commands: When you create a user defined command ( by talking to the sensor) use these fields to add text to the commands besides the plain id number. This is only used in the dev states as text, beautification

4. create an indigo trigger eg "voice light on"
- trigger on any change of that device, state=counter
- condition dev/state sensorValue eq 103
- action eg turn on a light

Using:
the by speaking "hello robot" + "turn on the light" the rpi will read the sensor, find command id 103, sends that command id (103) to the plugin and the dev sensorValue will be set to 103.. and your light will turn on.
similar with command "turn off the light" and command id 104 instead of 103

More config
You can set your own key word and commands eg: "hey indigo" + "set temperature 30"
These configs are done through voice commands to the sensor (create custom key phrase, custom command)
Please see the attached help for details.

This is how the dev states look like.
It shows the current command text in sensor ui value, the sensor value is 103; last commands; when they happened; config in status etc
Screenshot 2024-10-30 at 18.15.25.png
Screenshot 2024-10-30 at 18.15.25.png (37.5 KiB) Viewed 373 times
Karl

ps in dev edit you can print this help file

Code: Select all

 
 configuring the sensor online:
====== Learning wake-up word:
· Initiate the voice assistant by employing the default wake-up word, then say "Learning wake word" Follow the prompts to learn the new wake-up word (prior to each learning command, it is necessary to remove the previously learned wake-up word; kindly refer to the instructions for wake-up word and command phrase deletion)
· Indication: Learning now, be quiet, please say the wake word to be learned!
· The designated wake-up word to be acquired (taking "hey indigo" as an example): “hey indigo”
· Indication: Learning successful, please say it again!
· The designated wake-up word to be acquired : “hey indigo”
· Prompt: Learning successful, please say it again!
· The designated wake-up word to be acquired : “hey indigo”
· Prompt: Ok, learning completed!
· Once the learning process is accomplished, you will be able to utilize the phrase "hey indigo" to awaken the voice assistant!
 
====== Learning command words:
Use a wake-up word (default or learned) to wake up the voice assistant, and then say "Learning command word" to initiate the process of learning command phrase, following the provided prompts.
     Before each session of learning command phrases, it is necessary to delete the previously learned command phrases.
· Indication: Learning now, be quiet, please learn the command word according to the prompt! Please say the first command to be learned!
· Command phrase to be learned (using "Turn on Greenlight" as an example): "Turn on Green light"
· Indication: Learning successful, please say it again!
· Command phrase to be learned : “Turn on Green light”
· Indication: Learning successful, please say it again!
· Command phrase to be learned : “Turn on Green light”
· Indication: OK, learned the first command successfully! Please say the second command to be learned!
... (Continue learning)
Command phrase to exit learning mode: "Exit learning"
After the completion of the learning process, an ID will be automatically generated.
 
 
====== Delete Wake Words and Command Words:
Use a wake-up word (default or learned) to wake up the voice assistant, and articulate the phrase "I want to delete"
      Follow the prompts to eliminate the specified command phrase as instructed.
· Indication: Do you want to delete the learned wake word or command word?
· "Delete command word " : will Remove the previously acquired command phrases.
· "Delete wake word" : will Erase the learned awakening words from the system.
· "Delete all" : Eliminate the assimilated awakening utterances and command phrases from memory.
· "Exit deleting".
 
======  command IDs 5..21 activated (set by you):

1:  Wake-up words for learning
2:  Hello robot
255: off
=== predefined  Command Words
22:  Go forward
23:  Retreat
24:  Park a car
25:  Turn left ninety degrees
27:  Turn left thirty degrees
26:  Turn left forty-five degrees
29:  Turn right forty- five degrees
30:  Turn right thirty degrees
31:  Shift down a gear
32:  Line tracking mode
33:  Light tracking mode
34:  Bluetooth mode
35:  Obstacle avoidance mode
36:  Face recognition
37:  Object tracking
38:  Object recognition
39:  Line tracking
40:  Color recognition
41:  Tag recognition
42:  Object sorting
43:  Qr code recognition
44:  General settings
45:  Clear screen
46:  Learn once
47:  Forget
48:  Load model
49:  Save model
50:  Take photos and save them
51:  Save and return
52:  Display number 0
53:  Display number 1
54:  Display number 2
55:  Display number 3
56:  Display number 4
57:  Display number 5
58:  Display number 6
59:  Display number 7
60:  Display number 8
61:  Display number 9
62:  Display smiley face
63:  Display crying face
64:  Display heart
65:  Turn off dot matrix
66:  Read current posture
67:  Read ambient light
68:  Read compass
69:  Read temperature
70:  Read acceleration
71:  Reading sound intensity
72:  Calibrate electronic gyroscope
73:  Turn on the camera
74:  Turn off the camera
75:  Turn on the fan
76:  Turn on the fan
77:  Turn fan speed to gear one
78:  Turn fan speed to gear two
79:  Turn fan speed to gear three
80:  Start oscillating
81:  Stop oscillating
82:  Reset
83:  Set servo to ten degrees
84:  Set servo to thirty degrees
85:  Set servo to forty- five degrees
86:  Set servo to sixty degrees
87:  Set servo to ninety degrees
88:  Turn on the buzzer
89:  Turn off the buzzer
90:  Turn on the speaker
91:  Turn off the speaker
92:  Play music
93:  Stop playing
94:  The last track
95:  The next track
96:  Repeat this track
97:  Volume up
98:  Volume down
99:  Change volume to maximum
100: Change volume to minimum
101: Change volume to medium
102: Play poem
103: Turn on the light
104: Turn off the light
105: Brighten the light
106: Dim the light
107: Adjust brightness to maximum
108: Adjust brightness to minimum
109: Increase color temperature
110: Decrease color temperature
111: Adjust color temperature to maximum
112: Adjust color temperature to minimum
113: Daylight mode
114: Moonlight mode
115: Color mode
116: Set to red
117: Set to orange
118: Set to yellow
119: Set to green
120: Set to cyan
121: Set to blue
122: Set to purple
123: Set to white
124: Turn on ac
125: Turn off ac
126: Increase temperature
127: Decrease temperature
128: Cool mode
129: Heat mode
130: Auto mode
131: Dry mode
132: Fan mode
133: Enable blowing up & down
134: Disable blowing up & down
135: Enable blowing right & left
136: Disable blowing right & left
137: Open the window
138: Close the window
139: Open curtain
140: Close curtain
141: Open the door
142: Close the door


=== Learning-related commands
200: Learning wake word
201: Learning command word
202: Re-learn
203: Exit learning
204: I want to delete
205: Delete wake word
207: Delete command word
208: Exit deleting
208: Delete all

=== IDs that can be set by you
none defined
 
  see https://www.tme.eu/Document/064226f2d0b3baf20e9949b0a9b6a625/DF-SEN0539-EN-TME.pdf for tech doc
 
how to connect:
Screenshot 2024-11-08 at 10.18.22.png
Screenshot 2024-11-08 at 10.18.22.png (191.45 KiB) Viewed 227 times
User avatar
kw123
Posts: 8463
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: pibeacon 25: DF2301Q voice recognition sensor

Post by kw123 »

now officially released in production as v2022.181.111

I can really recommend this device. I am using it every day in several rooms to switch things on and off

Karl
rhanson
Posts: 194
Joined: Tue Apr 30, 2013 6:31 pm

Re: pibeacon 25: DF2301Q voice recognition sensor

Post by rhanson »

Is the onboard speaker exposed to the system, like through pulseaudio or amixer? In other words, can it also be used by other processes, or is it internal only to the board and only used to say "yes, I'm here / ok" like the demo?
User avatar
kw123
Posts: 8463
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: pibeacon 25: DF2301Q voice recognition sensor

Post by kw123 »

the board ONLY transmits the recognized command numbers through i2c, nothing else.. and the speaker quality is not great, it is tiny tiny.
I have actually turned it off or set to volume =1

There is no configuring from the rpi / i2c , besides speaker volume, wake time, and mute.
All command settings are done through speaking into the mic... at least there is nothing published otherwise.

Karl
again this is really good, I was against voice commands through internet, but this one is all local and works
Post Reply

Return to “piBeacon”