Recent

Author Topic: using the raspberry pico to drive the electronics for a parcel delivery vault.  (Read 4113 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
This night I dreamt up something that looks to me just a job for the Pico.
The probem I want to solve is, that all the members in my household are trying to make the  Chinese very rich by ordering lots of small and big stuff from the likes of AliBaba and Temu. that means that we miss out on lots of deliveries because we either are not there or asleep. (my wife often runs night shifts and the household adapts to her rithm)

The parts list starts like this:
- a metal dustbin with cover (painted post office red of course
- a metal Z arm to switch he lock, I fabricate that myself if not available.
- a relay, or two
- possibly stepper motor
- A solenoid (Thx, Dave!), latch/lock type (thx ccrause)
- a rubber numeric keyboard. (or a couple of buttons, three will do)
- a pico, optionally with Wifi kit
- a motion detector or light sensor
- some custom software to drive that all

There is a starters kit for the Pico that contains most of the parts, including a small breadboard and the detectors but not the relay(s) and a stepper motor.

The inner workings are very simple:
- When the delivery bin is empty the access code are zero's and the bin is open.
- When a delivery is made through the bin and the lid closes, the bin locks with a code that only we have. That's where the relays solenoid and the motion or light detection detector comes in.
Ideally a possbility to remotely reset the code (through the Wifi module)

Now, my problem is that I never worked with the pico to drive hardware like this.

So, my question is:
Can somebody provide me with:
- If possible, schematics to pull this off
- recommedation on what type of relay and motor   solenoid to use? Solved. Thx ccrause.
I think help with the software development is not really necessary although tips are welcome.

If somebody wants to help, the reward is that I will build TWO delivery bins, one for the person that helps me out!
« Last Edit: May 10, 2024, 04:39:49 pm by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

dbannon

  • Hero Member
  • *****
  • Posts: 2985
    • tomboy-ng, a rewrite of the classic Tomboy
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #1 on: May 10, 2024, 06:57:26 am »
See attached, particularly bottom right hand side. Trivial.

I think I'd use a solenoid to do the locking, might be simpler than a motor.

Davo

PS : why not just ask them to leave to parcel on your door step ?
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #2 on: May 10, 2024, 07:08:31 am »
Yes a solenoid is a better option, did not think of that and it is the obvious solution.
I adapted the parts list accordingly.
The reason for the bin is just that we have bad experiences with deliveries on the doorstep.
Although we live in an affluent neighbourhood, theft is an issue, as are certain weather conditions, e.g. if a parcel is packed in cardboard. And we already have security camera's in place. The delivery bin can be secured to the floor or wall next to my front door.
(AI image creator at its best: the delivery bin is 80 litres so this would fit)
« Last Edit: May 10, 2024, 07:39:50 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #3 on: May 10, 2024, 07:51:00 am »
Except for the solenoid this link seems to contain all the parts.
Must have a look which pins are occupied by the wifi module, though.
Any advice?
https://www.bol.com/nl/nl/p/raspberry-pi-pico-w-starter-kit/9300000135837158/?s2a=&bltgh=j1HSbWUo66xqSiNXrr9Hsg.2_56_57.58.FeatureOptionButton#productTitle

Since solenoids are not expensive the whole project can be build for under $70, 65 euro
« Last Edit: May 10, 2024, 08:03:15 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

ccrause

  • Hero Member
  • *****
  • Posts: 930
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #4 on: May 10, 2024, 08:13:46 am »
Are you planning on using FPC for the programming? Michael Ring's pico-fpcexamples does not include support for the PicoW (see device list). It is probably not too much work to rebuild the latest Pico SDK though.  FPC wifi capability also available via ESP8266 & ESP32.

Regarding the locking mechanism, one get various types of electric door latches/locks that may be relevant for this project (basically a solenoid, but specialized for latching/locking). Another idea is to use a simple cheap sliding bolt and drive this with a small servo (requires PWM to position).

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #5 on: May 10, 2024, 08:25:20 am »
Yes, I indeed want to use FPC and I am capable of adapting the code for the pico if necessary.. The specialized latch/lock is a good idea. Your last remark is pretty much how I dreamt it. I will have a look on where to source a latch/lock solenoid.
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

dbannon

  • Hero Member
  • *****
  • Posts: 2985
    • tomboy-ng, a rewrite of the classic Tomboy
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #6 on: May 10, 2024, 10:19:52 am »
Are you planning on using FPC for the programming? Michael Ring's pico-fpcexamples does not include support for the PicoW (see device list). It is probably not too much work to rebuild the latest Pico SDK though.  FPC wifi capability also available via ESP8266 & ESP32.
Yep, Michael's excellent model does not cover wifi. I looked at doing so but the newer release of the Pico's C libraries are contain a very closely cross conected mess of modules and in the end, I found it easier to do what I needed using C  :(

Regarding the locking mechanism, one get various types of electric door latches/locks that may be relevant for this project (basically a solenoid, but specialized for latching/locking). Another idea is to use a simple cheap sliding bolt and drive this with a small servo (requires PWM to position).

Hmm, I initially suggested a solenoid instead of a motor but did not consider a stepper to be honest. I reconsider, a stepper driving a small shaft probably would be easier mechanically. I have not used a stepper with a Pico but have done so, very easily, with an Arduino.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

cdbc

  • Hero Member
  • *****
  • Posts: 1496
    • http://www.cdbc.dk
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #7 on: May 10, 2024, 10:21:48 am »
Hi Thaddy
Nice project, very interesting use of the 'pico', will you keep us posted in this thread?
I for one, am intrigued  8)
Happy fiddling...  :D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dbannon

  • Hero Member
  • *****
  • Posts: 2985
    • tomboy-ng, a rewrite of the classic Tomboy
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #8 on: May 10, 2024, 10:24:11 am »
Another approach, far, far simpler.  Seeing a plastic box in use, how about a reed switch in not obvious position, you hold a magnet near it, switch closes, it drives the solenoid/motor. Only you know where to hold the magnet, indeed, only you know you have a magnet in your hand.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #9 on: May 10, 2024, 10:57:10 am »
The plasic box is merely a suggestion by AI, nothing to do with that! I asked for a metal box, and, yes I got some very retro cast-iron metal boxes too. Would be cool to combine that with a retro phone dialer disk.... (but that is for V2)
But it is an option  ;)
I also asked on the Raspberry Pi pico forum.
« Last Edit: May 10, 2024, 12:20:25 pm by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #10 on: May 10, 2024, 11:05:58 am »
Hmm, I initially suggested a solenoid instead of a motor but did not consider a stepper to be honest. I reconsider, a stepper driving a small shaft probably would be easier mechanically. I have not used a stepper with a Pico but have done so, very easily, with an Arduino.

Davo
So back to my original functional design? (Where the Z-arm closes at both sides using a stepper motor?
I am working on the parts list and I think the suggestion from ccrause is a better one if I can source it.
BTW, I am cocky enough to pretend I can get the wifi working.  O:-)

So it is stepper motor vs solenoid and I am not decided. (Just because of lack of experience with hardware, having to design the hardware that is.)
« Last Edit: May 10, 2024, 11:12:12 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
« Last Edit: May 10, 2024, 11:40:47 am by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

ccrause

  • Hero Member
  • *****
  • Posts: 930
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #12 on: May 10, 2024, 11:43:21 am »
Hmm, I initially suggested a solenoid instead of a motor but did not consider a stepper to be honest. I reconsider, a stepper driving a small shaft probably would be easier mechanically. I have not used a stepper with a Pico but have done so, very easily, with an Arduino.

Davo
So back to my original functional design? (Where the Z-arm closes at both sides using a stepper motor?
I am working on the parts list and I think the suggestion from ccrause is a better one if I can source it.
BTW, I am cocky enough to pretend I can get the wifi working.  O:-)

So it is stepper motor vs solenoid and I am not decided. (Just because of lack of experience with hardware, having to design the hardware that is.)
A stepper motor will be more expensive and more complicated to drive compared to a servo for the same effective torque.

ccrause

  • Hero Member
  • *****
  • Posts: 930
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #13 on: May 10, 2024, 11:54:05 am »
I found this one and it is 5v and cheap. Found cheaper ones, but this looks easy.
https://nl.aliexpress.com/item/1005004695149344.html?spm=a2g0o.productlist.main.3.b9c72a5G2a5GFF&algo_pvid=64bb2e8b-cf1d-48e3-8f09-7932d1cdb56d&algo_exp_id=64bb2e8b-cf1d-48e3-8f09-7932d1cdb56d-1&pdp_npi=4%40dis%21EUR%215.43%213.26%21%21%2141.33%2124.80%21%40211b600217153335488141365ef37a%2112000030129346387%21sea%21NL%214880512478%21&curPageLogUid=U7WqY7sORGaO&utparam-url=scene%3Asearch%7Cquery_from%3A

The very cheap ones are hampered by delivery fees, so everything turns out at about 3-4 euro.

Any advice?
The specs show that it requires about 3A @5V, that is quite a lot! And the pullin force is only 8g (gram I suppose?).  Will work, but seems inefficient.

Compare this against a SG90 servo that outputs ~1.5kg.cm torque at 5V.  The stall current is about 0.7A.

Thaddy

  • Hero Member
  • *****
  • Posts: 15487
  • Censorship about opinions does not belong here.
Re: using the raspberry pico to drive two relays and a few other bits.
« Reply #14 on: May 10, 2024, 04:21:10 pm »
I found one that draws 0.8A and ordered that together with the rest of the parts - including for both locking mechanisms that were suggested.
I also ordered 10 extra pico's.

Now I have to wait... The parts from China have suggested delivery date of May 17, the rest is on 24 hour delivery and they work on Saturdays.

Also I have a different idea for the bin: I have some sheet metal lying around and I will see if I can either weld it (my spot welder is broken, though, another thing to investigate) or rivot it together for a prototype.
« Last Edit: May 10, 2024, 04:37:20 pm by Thaddy »
My great hero has found the key to the highway. Rest in peace John Mayall.
Playing: "Broken Wings" in your honour. As well as taking out some mouth organs.

 

TinyPortal © 2005-2018