1
\$\begingroup\$

Here is the proyect, making a failsafe autonome Baby Cart

believe me my life is at risk here, im in high school studyng mechatronics so im still learning how to make some stuff but i know the basics the thing is an aunt wants me to make a baby cart for my newly born cousin that can be radiocontrolled or moved by the baby and stops automatically if there is a fall when the baby is in free roam mode.

Using a PIC for the proyect, the circuit uses 2 voltage lines, a main 5V supply is for powering the PIC controller, sensors, output relays, the logic circuit and the RC control (borrowed from a RC car), the secondary 12v power supply is used for the motors for the wheels and the motors on the deployable legs (for stopping the cart if the baby wants to go off a cliff and the sensors stop dettecting ground).

i want to connect 8 sensors but the pic only has 6 input ports and 2 are used for the RC control is it plausible to connect 2 sensors to each port while passing by the same "not" gate?

if the baby falls im going to be dead

\$\endgroup\$
5
  • 2
    \$\begingroup\$ This question is very important. The technical half may or may not get answered by others below. But the big topic here, for someone who may go on to become a professional engineer is: how do I know when I should say "no". You're still learning - you say so yourself. And yet a newly born baby's life is being put in your hands. This is when you say no. As a learning exercise this is fine - but in real life, I repeat again, no. \$\endgroup\$
    – stefandz
    Aug 12, 2015 at 21:13
  • \$\begingroup\$ Agreed. I would not consider designing this, and I've been engineering for a while. No no no. \$\endgroup\$
    – bitsmack
    Aug 12, 2015 at 21:29
  • \$\begingroup\$ ok, i have already showed your comment to my cousins, they are also, half minded and they wanted me to do it anyways, i was seeking someone to tell me exactly that so they could listen, thank you very much \$\endgroup\$ Aug 12, 2015 at 22:12
  • \$\begingroup\$ "Or moved by the baby?" \$\endgroup\$
    – EM Fields
    Aug 12, 2015 at 23:01
  • \$\begingroup\$ "if the baby falls im going to be dead" No, the baby will die, you will live on your loooong life, seeing as you are only in highschool, knowing what you did. \$\endgroup\$
    – KyranF
    Aug 12, 2015 at 23:16

2 Answers 2

1
\$\begingroup\$

My answer is no you can't but there is some way to reduce the number of ports used to 4 ports, assuming one of port can be used as ADC port and the other 3 ports can be used as logic output (so it depends the PIC you use, look at the datasheet.)

Use alanog proximity sensors like this and DG528 analog multiplexer. Assuming you have heard about multiplexer, DG528 is the analog-version-multiplexer that have 8 analog input channels and 1 analog output channel. Look at the page 7 of the datasheet of DG528. Depending on the input value of address input, pin A2, A1 and A0, the output channel(pin D) is connected to one of input channel(pin S1 to S8). So you should connect the output channel to a ADC port of PIC to read, and connect A2-A0 ports to the other three digital output ports of the PIC. In this way you can read sensors with reduced number of ports of the PIC.

\$\endgroup\$
2
  • \$\begingroup\$ And, so I don't want to be responsible for a baby's safety neither, but just consider this as a generic solution to reduce the number of ports used :) Please do not use this for REAL babies :P \$\endgroup\$
    – Bumsik Kim
    Aug 12, 2015 at 23:32
  • \$\begingroup\$ I looked through the comments after writing this. It feels like I am doing something bad :P \$\endgroup\$
    – Bumsik Kim
    Aug 12, 2015 at 23:40
0
\$\begingroup\$

Firstly, I agree with the others (comments). There are many things that could go wrong here and I know I wouldn't want to be responsible for a baby's safety.

With that said, the simple answer here is to get a PIC with enough I/O to support everything instead of trying to make it work with what you got.

If you absolutely must use the PIC you have then you can use a multiplexer (mux) on the front-end.

\$\endgroup\$
4
  • \$\begingroup\$ And, so, even though you say you wouldn't want to be responsible for a baby's safety, you spill the beans? \$\endgroup\$
    – EM Fields
    Aug 12, 2015 at 23:20
  • \$\begingroup\$ @EMFields Haha, someone was going to anyway ;) Just like Bumsik did. And, I'm not going to be responsible ;) Op is. \$\endgroup\$ Aug 12, 2015 at 23:22
  • \$\begingroup\$ So if you give a child a loaded gun and he shoots someone it's the child's fault? \$\endgroup\$
    – EM Fields
    Aug 13, 2015 at 9:11
  • \$\begingroup\$ @EMFields Really? He's a high school student not a child. He can make decisions for himself and the parents of the baby can either allow it or not. I didn't tell him how to use the mux, if he figures it all out and the baby get's hurt, then yes, it's his fault and the parents for putting their baby in it. \$\endgroup\$ Aug 13, 2015 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.