Brainstorm (RAK5005/4631/12007)

wondering if anyone could help me brainstorm, i’m using an ultrasonic sensor with a wisblock and the 4631. Rather than the distance being live on an OLED, I was hoping to use that data to send an uplink under specific distance criteria. any thoughts?

i mean, rather than distance being printed on a screen, i intend to set an expected distance, and receive an uplink if it’s less than that, if that makes sense.

(end solution- baby carseat occupancy detection: periodic uplinks sent, decoded for push notifications, if the driver’s seat is empty while baby carseat is occupied. )

There are people that would claim that blasting some ultrasonic sound at your baby is not the best thing, but leaving that out of the question!

I think you can mount it under the headrest with two distance sensors. You can measure the person sittin in the seat (on the neck?) and you can beam towards the baby carseat?

Once you have that lined up, it should be an effort of understanding what the distances are and sending a link from there…

Not sure if this helps :wink:

How about a flex sensor? Will the baby create enough bending? :sweat_smile:

thanks for the feedback folks! the flex sensor was the original plan but I was saving $75 on the design by swapping ultrasonic. i suppose there could be some inherent risk at emitting ultrasonic waves at a baby. perhaps I could use an infrared proximity sensor instead?

my big task is to try to decipher the data going to the OLED, trying to set a desired distance rather than reading the live distance, not sure where exactly where in the code to capture that data. Looks like the distance is measured in a formula that equates time to distance, so I’ll have to do some experimenting I think.

You’ll have to write the code yourself for this. It’s fairly simple to create an if-statement that checks the distance and then sends out the data.
How did you want to send out the data anyway?

If you’re struggling with the code part, then maybe share what you’ve tried and what your experience is…

Thanks for the feedback guys, sorry for the slow replies. I’ve got the parts coming in and will begin really digging in here once it’s assembled. Does anyone have any recommendations for example codes I should look at for guidance. I’m green in my programming, and learning what I can, but went in circles a few times just trying to get started. It’d be great to see a similar example if there’s anything like this out there.

There are a lot of examples in our WisBlock Github repo.

You might need to stitch them together, but we have examples for each of our modules and some examples that show “solutions” where sensor data is sent over LoRaWAN.