Introduction: Bluetooth and Attractive force Vanessa Stephen

You will find in this Instructable everything needed to multiply this fun little magnetic bell contained through Bluetooth.

But before starting, I would like to tell you more about the origin of this project.

The extraction

I live in the center of a big metropolis, and I am identical sensitive to make noise pollution. Most of this noise contamination comes from cars (engines running or horns honking). And arsenic a pedestrian and cyclist, I am very open.

While observing vehicles in the streets, I noticed that buses and trams (at to the lowest degree in France, but probably also elsewhere) suffer 2 types of horns: a loud hooter to warn other vehicles, and a bell to warn pedestrians. But why don't cars have this warning bell? It's definitely a mission for ME, I had to do one. My prime idea was to make up a device co-ed into my car, but it was too very much knead and non very reproducible. Indeed I came up with the idea of a Bluetooth doorbell (activated from a button deep down the car), with magnets to place it anyplace on my railroad car.

This is the name of the goals I had when starting this project:

  • Raising state-supported awareness of noise pollution in cities;
  • Reducing noise defilement, by using this Bluetooth doorbell on my car;
  • Avoiding to dash pedestrians and cyclists in the streets;
  • Create a better atmosphere in the streets. This is a device that makes people smile, and this is important :)

Features

A you can visualize, on that point are two boxes that I margin call "Bluetooth button package" and "Bluetooth bell box" all along this Instructable. You probably already guessed most of the features, merely here they are once again:

  • Bluetooth activated Alexander Bell;
  • Magnetic boxes, to fix on whatever ferromagnetic surface;
  • Power-driven with 9V batteries.

Supplies

For 3D printing:

  • A 3D printer (or whatever service to print the pieces for you);
  • PLA.

For electronic circuits:

  • Perfboards;
  • 2x Arduino Nano boards;
  • 1x pushing button;
  • 2x HC-05 Bluetooth modules;
  • 1x SG90 servo motor;
  • 1x switch push;
  • 1x 10kOhm resistor;
  • 1x emf governor (L7805CV);
  • 1x 100nF capacitor;
  • 1x 300nF capacitor
  • Wires.

New:

  • 1x bike bell;
  • 8x neodymium magnets (8 mm in diameter, 3 mm concentrated);
  • 14x M3 screws (10 mm long);
  • 8x M3 nuts.
  • 4x M2 screws (10 mm long);
  • 4x M2 nuts;
  • 2x 9V batteries (I use rechargeable batteries).

Gradation 1: Pairing HC-05 Modules

The first deputise this project is to take sure both HC-05 modules twin aright. There are a lot of datasheets and tutorials on the internet, and this one was particularly useful to Pine Tree State.

Here is a summary:

  • Upload a blank sketch on the Arduino board;
  • Unplug the Arduino board;
  • Connect the HC-05 mental faculty as shown on the picture;
  • Crush the readjust button on the HC-05 module and plug the Arduino board while holding the reset button (long moderato blink indicate AT command mode);
  • Open Arduino IDE and monitor, make sure its BAUD rate is 38400, and select "Both NL and CR";
  • Instantly you need to configure a module as a slave, and the other one A a master:
    • For the slave:
      • Type "AT+ROLE=0" in the monitor to set the module as a slave. The monitor should return "Satisfactory".
      • Type "AT+ADDR?", and write the address to employ it later with the master module. Change ":" with ",";
    • For the master:
      • Case "AT+ROLE=1" in the monitor to circle the module A a control. The monitor should return "OK".
      • Typecast "AT+CMODE=0", to connect to only one gimmick;
      • Eccentric "AT+BIND=address". With address the address you obtained from the slave mental faculty previously.

Now, to make sure some modules twosome right, plug some boards with their modules. Make sure to switch the wires connecting RX and TX:

  • Arduino RX is now connected to HC-05 TX;
  • Arduino TX is now connected to HC-05 RX.

If everything goes fine, you should honor that the modules enter in paired mode.

Pairing mode (short rapid blink):

AT command manner (long slow blink):

Paired fashion (two short blink, synchronyzed between both modules):

Now I recommend to make the full circuits (shown in steps 2 and 4) happening a bread board to make sure everything work fine.

Step 2: The Bluetooth Button (electronics)

The circuit is rather simple: the Arduino Nano board is powered with a 9V battery, with a switch in between. Then there is a simple push-button with a pull-toss off resistance. Finally, there is the HC-05 Bluetooth module (in master mode) to communicate.

I soldered the circuit on a perfboard. If you need to use the same boxes I studied and 3D written (see next steps), so you will have to stick to the dimensions I used:

  • The perfboard should personify restrained inside a saucer with a diameter of 78 mm (black grid below). For example, a perfboard with a size up of 55x50 mm is perfective;
  • The perfboard is attached to the box with two M3 screws that are located at 30 millimetre from each other, centered connected the perfboard. The holes are 3.3 mm in diameter.
  • At last, the advertise button should equal placed at heart a disk-shaped area of 20 millimetre in diameter, centered on the perfboard (see the green grid at a lower place).

For a better apprehension, ensure the drawing below:

Finally comes the Arduino codification. It is a modified version of the "Button" Arduino sketch. You can download it downstairs.

/*
Bluetooth and attractive bell: https://www.instructables.com/member/Matlek/
Bluetooth button sketch
The following code is a modified variation of the "Button" example (http://www.arduino.cc/en/Tutorial/Push button)
*/

const int buttonPin = 2; // the number of the pushbutton rowlock
const int ledPin = 13; // the number of the Light-emitting diode flag
int buttonState = 0; // versatile for interpretation the pushbutton status
String up state;

void setup() {
Ordering.begin(38400);
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop() {
if (Order.available() > 0) { // Checks whether information is comming from the serial port
state = In series.translate(); // Reads the data from the serial port
}
// understand the state of the pushbutton appreciate:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
digitalWrite(ledPin, Treble);
Serial.write(1);
delay(1000);
} else {
digitalWrite(ledPin, Crushed);
Series.write(0);
delay(1000);
}
}

Step 3: The Bluetooth Button (box)

The "Bluetooth clit box" is combined of five 3D printed parts, which I am going to identify in inside information:

  • The of import box;
  • The lid (to close the box);
  • The battery cover;
  • The button illegitimate (which is the first component of the button);
  • The button top (the intermediate part of the button);

I think it is much more relevant to describe the features I imagined and added, preferably than display you how to design the pieces. This way you can have a improved idea of how I design my projects.

There are plenty of softwares and tutorials available online. If you are a beginner, try Tinkercad. To go even further, you seat taste Fusion 360 or FreeCAD.

1 - The main box

The boxwood is the independent part of the project, and I designed it so that some the "Bluetooth clitoris loge" and the "Bluetooth bell box" have the same size, but with slight differences. Also the aesthetic aspect, its important goal is to maintain and protect the electronic circuit.

I would like to draw your aid to the following details:

  1. The box has a hole on its top, through which the release base passes. I made sure it is slightly big than the base of the clitoris, but non too tight so that the button can constitute pushed and released without getting stuck;
  2. At that place are 2 holes to attach the perfboard, with a diameter of 3.1 mm. This is small enough so that M3 screws can be straight off screwed into the plastic. Of course, the holes will be damaged after numerous times, but information technology does the job if you screw/unscrew the perfboard only a a few times.
  3. There are 4 holes to seize the lid of the box, with a diam of 3.3 mm. This is enough to net ball the M3 screws enter easily. You butt also acknowledge a pocket below, to place nuts. I designed these pockets so that the nuts tightly fit, and stay in place. As wel, the triangular shape you can see was designed happening purpose so that no supports are added during slicing (and before 3D printing), thanks to the angle. This is a quite useful feature since the pockets containing the nuts have to be with exact dimensions, and supports can modify this dimensions if not removed properly.

2 - The lid

Then comes the hat. This part is the same on some the Bluetooth button and Bluetooth bell boxes, so I am just going to distinguish it here. The main goal of the chapeau is to close the box, it contains the switch to turn Along/Hit the device, and a pocket to place the 9V battery.

The briny characteristics of the hat are the chase:

  1. I designed a pocket so that the battery cover can be removed more easily;
  2. On that point is likewise some other pocket to put on the swop. It is deep enough so the switch does not stick out, and large sufficient to entree the flip-flop;
  3. On the new side of the switch pocket, I made two opposite pockets to place M2 nuts, and holes adapted for M2 screws. This is to attach the switch to the lid;
  4. You crapper also see that there is a border all around the battery bag, in order to maintain the battery cover;
  5. Magnets are placed in holes specially designed so they stay in situ;
  6. Finally, all or so the lid there is a modest border to serve to station the palpebra correctly and aligned with the boxes (with holes for the M3 screws perfectly aligned).

3 - Shelling cover

The barrage fire cover helps to protect the battery, and make a point the bombardment stays in place. This is inspired from common battery covers used on remote controls (much as Telly remote control for example). On one edge, it has 2 sticking out pads so it is preserved on the lid. Along the opposite edge, I designed a spinnbar footslog to cut short it on the lid.

4 - Button base

The clit base is fair an assembling of 2 cylinder. The diluent cylinder passes through with the hole of the loge. The big piston chamber helps to maintain the base inside the box (since it is larger). This larger piston chamber is victimized to press directly on the push-button used on the circuit delineate antecedently. And there is also a hole finished this base with a diameter of 3.1 millimetre, to place an M3 screw. I primitively made this hole in order to adjust the Z position of the clit inside the box, but I finally found out information technology was not needed.

5 - Button top

And finally in that location is the push button height. IT is just a disk, with a hole on its depress face (to attach the button base). On its upper face, I made 2 divergent designs (on 2 different versions of the button). To black and white these shapes in another color (As you can see the chime and the border of the button are Elwyn Brooks White, while the clitoris itself is shameful), I have added the M600 command wrong my GCODE earlier printing. This M600 statement is used to change the filament during a print. I usually place the STL file in my slicer, check at which stratum the bell is being printed, exportation my GCODE, and unfold information technology in a textual matter editor. I search for the layer known previously and add "M600" in the GCODE.

Step 4: The Bluetooth Bell (electronics)

The second electrical circuit is composed of another Arduino Nano, supercharged with a 9V battery, with a switch. Again, on that point is an HC-05 module (in slave mode) to communicate. There is also a servomotor that is used to ring the bell. Since the servomotor might require more current than the Arduino give notice provide, I have used a voltage regulator to provide 5V to the servomotor from the 9V battery.

I made the circuit on a perfboard. Once more, if you decide to use the box I designed, you have to use the same dimensions:

  • The perfboard has to fit wrong a disk of 79 millimeter in diameter. A perfboard with a size of 55x50 mm is perfect;
  • Drill 4 holes with a diameter of 3.3 millimetre (to attach the perfboard to the box with M3 screws), and use the same dimensions as shown below.

The encipher is quite simple: if the Arduino receives a "1" through with Bluetooth with the HC-05 module, it means the button was pushed. The servomotor then moves from the rest put to another position to ring the Vanessa Bell. Then information technology goes back to the rest set out. You might change these positions according to the bell and the servomotor you habituate.

The code lav be downloaded beneath.

/*
Bluetooth and magnetic bell: https://www.instructables.com/penis/Matlek/
Bluetooth Bell adumbrate
*/

int state = 0;
#include <Servo.h>
Control system myservo;

void setup() {
myservo.attach(5);
pinMode(LED_BUILTIN, Outturn);
Serial.begin(38400); // Default communication rate of the Bluetooth faculty

}

void loop() {
if (Serial.available() > 0) { // Checks whether data is comming from the serial port
State Department = Serial.read(); // Reads the data from the consecutive port
}
Serial.println(state, DEC);
if (say == 1) {
myservo.write(70);
delay(500);
myservo.indite(140);
delay(1000);// wait for a bit
}
}

Step 5: The Bluetooth Toll (box)

The Bluetooth Vanessa Stephen box is very twin to the Bluetooth button box. It is tranquil of 4 parts:

  • The main boxful;
  • The bell adherence;
  • The lid (see step out 3);
  • The battery treat (see step 3).

1 - The main box

It has the exact Saame shape as the Bluetooth button box (a cylinder with the same diameter and same height). Here are a few important details to notice:

  1. Instead of the hole for the button base, the top of this box has a T-shape hole. This hole is designed so the servomotor cable send away get inside the box;
  2. In this boxful, in that respect are 4 holes to attach the perfboard, with 3.3 mm in diameter;
  3. At length, once again on that point are the unchanged pockets to position the M3 nuts represented antecedently.

2 - Bell attachment

The boxwood was at first fashioned in unity piece, combining the box and the bell attachment. But during the slicing (for 3D printing), the initial set up required overly overmuch supports. Hence I decided to split the box into 2 individual parts and paste them together with cyanoacrylate glue. I have uploaded some versions thusly you can choose the ace you prefer.

This bell attachment contains a pocket in which the SG90 servomotor can be placed. There is as wel a hole to let its cable length passes through and through.

And in that location is a cylinder to attach the ship's bell on that.

Step 6: Fabrication of the Parts

Formerly you have all the pieces, entirely you have to answer is put them unitedly. You can name to the video in step 1.

You will deman the M3 screws and nuts, and a screw device driver.

Step 7: Supports

To finish, I also made supports to place the boxes when they are non exploited. They are very simple, and tight enough so the boxes persist fixed. I at the start wanted to put them on the splasher of my car, but lastly changed my judgement because it can get truly near in summertime, and constructive will believably melt.

Footmark 8: Conclusion and Comments

To close, I really enjoyed doing this project, and I am very happy with the result. I have used information technology a a couple of multiplication already, and it will definitely quell in my car.

There are a fewer details I would like to change on future versions:

  • Better indicators to make predictable the Arduino boards are Along, and the HC-05 modules are synchronized. When making the externalise I originally though the light indicators along the devices would be visible through the thin dishonourable plastic I used for 3D impression. This is the case in my twilight workshop, withal, they are insufferable to interpret low-level sunshine because the ambient light is too bright. So it might be a swell idea to add holes to the boxes or additional LEDs as better indicators.
  • Better grip with the magnets. The current version works well, but adding additional magnets, or even diluent layer below the magnets would definitely ameliorate the grip of the boxes along ferromagnetic surfaces.

Finally, I would like to end this instructable with an image of the different failures I faced during this project. Every project is the final result of a learning cognitive operation that sometimes requires failures to go further, sol don't nonplus demoralised if it does not work in the first space.

Be the First to Share

Recommendations