How to connect alcohol sensor,relay and DC motor?

Hi There,

I’m doing project named “Accident prevention” using ultrasonic and alcohol sensors.

I want the code for connecting the alcohol sensor, relay, and dc motor.

I’ve attached the block diagram for reference

Accident prevention.pdf (101 KB)

Sorry but you will have to do better than that. You need to describe what you want to do and you need to say what sensor you have by giving a link to it.

You need to say if the motor has to move in only one direction or both.

You do not usually drive a relay from a sensor so your block diagram is not going to work.

@Grumpy_Mike:
Thank yu for ur reply.Hi im a newbie to use arduino and sensors.Im project is “Accident Prevention”. To prevent the accident i use ultrasonic sensor and alcohol sensor.

If the ultrasonic sensor detects any vehicle much closer the system automatically slows down the speed of the vehicle by using the automatic speed controller fixed to the vehicle engine.
The alcohol sensor used to detect the present of alcohol content in human breath.

Alcohol sensor, if it detects an alcohol, through the relay it is connected to DC motor. DC motor starts rotating in one direction. If there is no alcohol detection then DC motor wont rotate.

My question is how to connect the alcohol sensor,Relay and DC motor?
Can you help?

My question is how to connect the alcohol sensor,Relay and DC motor?

As I said you do not connect the sensor to a relay or a motor. You attach it to the Arduino. The Arduino then reads the sensor and if necessary it controls the relay which can turn the motor on.

But without knowing what sensor you are using it is impossible to tell you how to do it. Note that most sensors like this are not very sensitive and will not detect breath unless directly blow into.

I assume this is just a demonstration because there are several things that make the project impractical. One of these is that the processor used in the Arduino should not be used in automotive products. It says that in the small print at the very end of the data sheet, bottom of the last page.

@Grumpy_Mike:

Thank yu for ur reply.I'm using Ultrasonic sensor SR04 and MQ3 gas sensor.

Hi Tharani. You can use this tutorial on how to connect and code your MQ-3 Gas sensor with an Arduino : http://www.instructables.com/id/Arduino-Breathalyzer/?ALLSTEPS Then you can modify the code to suit your needs, like rotating a DC motor would simply require a motor shield and couple of PWM pins...

For the ultrasonic sensor use:- http://treehouseprojects.ca/ultrasonictutorial/

For controlling motors without a shield see:- http://www.thebox.myzen.co.uk/Workshop/Motors_1.html and http://www.thebox.myzen.co.uk/Workshop/Motors_2.html

Please note electronic things posted on the Instructables web site are 99% crap, do not trust the site as a source of learning.

@Chaitanya1,@Grumpy_Mike:Thank yu:)

I'm using single relay to connect with DC motor.There is NC,NO it has three pins.As im new to use, i dunno where to pin the relay pins to DC motor?

Use the relay one of two ways: 1. break the power flow to the motor, so Supply + to Relay NO, Relay Common to motor "+", motor "-" to Supply -.

  1. break the motor to Gnd connection, so Supply to motor"+", motor "-" to Relay NO, Relay Common to Supply -.

@CrossRoads: Thank you for ur reply. In my relay, it has 12v,input,gnd. And NC,COM,NO. How do i connect 12v And NC? plz bare with my stupid qns. Im a newbie to use relays and Dc motors.

Tharani: I'm using single relay to connect with DC motor.There is NC,NO it has three pins.As im new to use, i dunno where to pin the relay pins to DC motor?

It tells you in that page I linked to on motors.

@Grumpy_Mike: Thnk yu for ur reply.