Location beacon

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
rdagger
Posts: 143
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Location beacon

Post by rdagger » Fri Jul 07, 2017 6:45 am

I’d like to build a battery powered device that can wake up when moved and report its position in a building. I was thinking of using beacons to determine location. Is there a board that has the following?
  • Accelerometer
    BLE
    Battery charging circuit
    Energy efficient
    MicroPython

pagano.paganino
Posts: 89
Joined: Fri Sep 11, 2015 10:47 pm
Location: Italy

Re: Location beacon

Post by pagano.paganino » Fri Jul 07, 2017 8:22 am

you can use a pyboard 1.1, Battery charging circuit and Energy efficient must be hand made or use a breakout board from adafruit or similar, for BLE you can use https://github.com/dmazzella/uble

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: Location beacon

Post by chrismas9 » Fri Jul 07, 2017 12:04 pm

Limifrog has everything you want on one board including battery. it's 75 Euro because it comes with a lot of extra sensors.

It has a low power STM32L476, Panasonic BLE module, battery and charger, accelerometer, gyro, magnetometer, barometer, light and proximity sensors, microphone and 8 Mbyte data flash. Optional display.

User avatar
rdagger
Posts: 143
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Location beacon

Post by rdagger » Fri Jul 07, 2017 5:04 pm

Thanks for the recommendations. I'll check them out. The micro:bit also looks promising: efficient power, MicroPython, battery jack, accelerometer and a low price. BLE doesn't work with MicroPython but there is a radio library that might be enough to achieve what I need in terms of location detection. It also has speech synthesis which is a plus.

chrismas9
Posts: 152
Joined: Wed Jun 25, 2014 10:07 am

Re: Location beacon

Post by chrismas9 » Sat Jul 08, 2017 1:36 am

It looks as though Limifrog doesn't have a uPy BLE driver. Another option would be Adafruit Huzzah32 with add on accelerometer

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Location beacon

Post by pythoncoder » Sat Jul 08, 2017 6:50 am

Is it feasible to use an accelerometer to determine location? Double integration is pretty hairy with errors accumulating rapidly.

Worse, how do you distinguish between a device lying at a small angle relative to horizontal from one subject to steady acceleration? I can imagine a hack to fix that one issue but in general distinguishing between the gravitational vector and that produced by acceleration is, er, "difficult".
Peter Hinch
Index to my micropython libraries.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Location beacon

Post by pythoncoder » Sat Jul 08, 2017 5:58 pm

On reflection I think the only way it might be realised is to use a 9DOF sensor with accelerometer, gyro and magnetometer, and apply sensor fusion e.g. https://github.com/micropython-IMU/micropython-fusion. This enables the attitude of the platform to be updated in real time so that you can extract the acceleration vector with reference to Earth rather than to the platform. You'd then need to double integrate the Earth-referenced acceleration to get position.

While it would be an interesting project I'm very doubtful that it would work at all well in practice. Magnetometers are sensitive to disruption by local magnetic fields and, as I remarked before, double integration magnifies errors. It's possible that the latter effect could be reduced with filtering before the integration but I think it would be difficult.

But maybe someone has practical experience to prove my pessimism wrong?
Peter Hinch
Index to my micropython libraries.

User avatar
rdagger
Posts: 143
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Location beacon

Post by rdagger » Sat Jul 08, 2017 7:11 pm

The microbit has a MicroPython radio library which lets you send and receive text messages. It also lets you adjust the strength of the signal. I only need to ensure that the device stays within 3 adjacent rooms and a hallway. In theory, I could place a microbit in each room and a microbit in the device. The room microbits could transmit the name of the room. Once awaken from sleep by movement, the device would continually monitor incoming radio messages. If the incoming messages stopped, the device would trigger an alarm state.

I couldn't find any specs on the range of the microbit transmitter, but hopefully the transmit power could be adjusted to paint a room (15x15 ft.). I can't place anything outside of the rooms because it is not our property.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Location beacon

Post by pythoncoder » Sun Jul 09, 2017 5:15 am

Apologies, I thought you were planning to build an inertial navigation system :oops:
Peter Hinch
Index to my micropython libraries.

User avatar
rdagger
Posts: 143
Joined: Tue Feb 28, 2017 6:16 pm
Contact:

Re: Location beacon

Post by rdagger » Sun Jul 09, 2017 3:25 pm

pythoncoder wrote:Apologies, I thought you were planning to build an inertial navigation system :oops:
That's a clever approach. It would be a fun project.

Post Reply