I want to allow the user to plug in a device into the arduino (e.g. thermostat). The problem is that I don't want them to struggle to put 3 pins into a breadboard, as that is not very user-friendly.

Therefore I decided I want them to plug in the thermostat into the Arduino using a USB port, which is much more user friendly!

How can I do this?

Is there a better way to allow a user to plug in a device?

  • 1
    Don't do that. Embedded USB Host on an ATmega-based Arduino to support connecting a device to it is utterly illogical and uneconomical, if you really want that get an ARM based board where it is at least cost effective, if still likely to be painful development-wise. But better to choose another consumer-friendly connector that doesn't have the protocol overhead of USB. – Chris Stratton Aug 1 '16 at 2:17
  • 3
    Use audio 3.5mm TRS female+male connectors instead, they're good for anything. ujacks, even. – user400344 Aug 1 '16 at 3:55
  • Where can I find info how to use it – Yahya Uddin Aug 1 '16 at 7:08

You will need to get a USB Host Shield such as this one that will allow the Arduino to act as a USB host instead of a slave. Once you get that, you should be able to find a library that will allow you to do whatever it is you want to do.

  • But of course you would also need a USB-capable device to be plugging in. And USB host shields are anything but economical. Really, this whole approach is unwise. – Chris Stratton Aug 1 '16 at 2:16
  • @ChrisStratton I think that comment belongs more on the main question than the answer. – theJack Aug 1 '16 at 2:23
  • The answer is where the economical and technical absurdity that is a host shield was suggested... – Chris Stratton Aug 1 '16 at 4:06
  • 1
    @ChrisStratton OP asked how to connect a USB device to his arduino and I told him how to do that. The only way to connect a USB slave to an arduino is to use a host shield. That is a fact. Whether doing so is economical or not is not of my concern and is outside the scope of this question. – theJack Aug 2 '16 at 17:25
  • We have no evidence that the thermostat even is a USB device. The poster seems mostly interested in the connector. If "struggle to put 3 pins into a breadboard" is the alternative, it probably doesn't speak USB anyway. Most likely the question should be closed as unclear. – Chris Stratton Aug 3 '16 at 3:01

This will complicate your application only, if you mean a real USB Interface.

You can use any wanted form of connector, from USB to Audio connectors. The only limitation is the number of wires your sensor connection needs and your chosen connectors can provide.

The Solution is easy. Take one of your chosen connectors and solder wires from it to your needed Arduino Pins. Take the counterpart of your first connector and solder wires from it to your sensor.

So the user of the product can easily connect and disconnect the sensors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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